Fixed update of network links in user folder. This resolves bug 2903.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/2/head
Michele Calgaro 6 years ago
parent 301796c02e
commit 00dfa3aec6

@ -599,28 +599,26 @@ void KonqSidebarTree::scanDir( KonqSidebarTreeItem *parent, const TQString &path
if ( isRoot ) if ( isRoot )
{ {
bool copyConfig = ( entries.count() == 0 && dirEntries.count() == 0 ); bool copyConfig = false;
if (!copyConfig) // Check version number
{ // Version 1 was the dirtree of KDE 2.0.x (no versioning at that time, so default)
// Check version number // Version 2 includes the history
// Version 1 was the dirtree of KDE 2.0.x (no versioning at that time, so default) // Version 3 includes the bookmarks
// Version 2 includes the history // Version 4 includes lan.desktop and floppy.desktop, Alex
// Version 3 includes the bookmarks // Version 5 includes the audiocd browser
// Version 4 includes lan.desktop and floppy.desktop, Alex // Version 6 includes the printmanager and lan browser
// Version 5 includes the audiocd browser // Version 7 includes update of network places
// Version 6 includes the printmanager and lan browser const int currentVersion = 7;
const int currentVersion = 6; TQString key = TQString::fromLatin1("X-TDE-DirTreeVersionNumber");
TQString key = TQString::fromLatin1("X-TDE-DirTreeVersionNumber"); KSimpleConfig versionCfg( path + "/.directory" );
KSimpleConfig versionCfg( path + "/.directory" ); int versionNumber = versionCfg.readNumEntry( key, 0 );
int versionNumber = versionCfg.readNumEntry( key, 1 ); kdDebug(1201) << "KonqSidebarTree::scanDir found version " << versionNumber << endl;
kdDebug(1201) << "KonqSidebarTree::scanDir found version " << versionNumber << endl; if ( versionNumber < currentVersion )
if ( versionNumber < currentVersion ) {
{ versionCfg.writeEntry( key, currentVersion );
versionCfg.writeEntry( key, currentVersion ); versionCfg.sync();
versionCfg.sync(); copyConfig = true;
copyConfig = true; }
}
}
if (copyConfig) if (copyConfig)
{ {
// We will copy over the configuration for the dirtree, from the global directory // We will copy over the configuration for the dirtree, from the global directory
@ -655,8 +653,7 @@ void KonqSidebarTree::scanDir( KonqSidebarTreeItem *parent, const TQString &path
for (; eIt != eEnd; ++eIt ) for (; eIt != eEnd; ++eIt )
{ {
//kdDebug(1201) << "KonqSidebarTree::scanDir dirtree_dir contains " << *eIt << endl; //kdDebug(1201) << "KonqSidebarTree::scanDir dirtree_dir contains " << *eIt << endl;
if ( *eIt != "." && *eIt != ".." if ( *eIt != "." && *eIt != "..")
&& !entries.contains( *eIt ) && !dirEntries.contains( *eIt ) )
{ // we don't have that one yet -> copy it. { // we don't have that one yet -> copy it.
TQString cp("cp -R -- "); TQString cp("cp -R -- ");
cp += TDEProcess::quote(dirtree_dir + *eIt); cp += TDEProcess::quote(dirtree_dir + *eIt);

@ -3,7 +3,7 @@
# A script to perform R14.0.0 XDG compliance updates. # A script to perform R14.0.0 XDG compliance updates.
SCRIPT_NAME="`basename \`readlink -f $0\``" SCRIPT_NAME="`basename \`readlink -f $0\``"
SCRIPT_VERSION=201412270 SCRIPT_VERSION=201805230
# This script should be needed to run only once, but corner cases # This script should be needed to run only once, but corner cases
# and file/directory permissions could cause incomplete updates. # and file/directory permissions could cause incomplete updates.
@ -947,6 +947,26 @@ if [ "$R14_VERSION" -lt "201412270" ]; then
fi fi
fi fi
# Rename/remove old link files in Konqueror sidebar network panel.
# Updated links will be installed when the user open the panel from Konqueror
if [ "$R14_VERSION" -lt "201805230" ]; then
if [ -f "$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/ftp/kde_ftp.desktop" ]; then
Log " kde_ftp.desktop->tde_ftp.desktop"
mv "$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/ftp/kde_ftp.desktop" \
"$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/ftp/tde_ftp.desktop" 2>/dev/null
fi
if [ -f "$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/web/kde_web.desktop" ]; then
Log " kde_web.desktop->tde_web.desktop"
mv "$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/web/kde_web.desktop" \
"$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/web/tde_web.desktop" 2>/dev/null
fi
if [ -f "$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/web/look_web.desktop" ]; then
Log " Remove look_web.desktop"
rm "$PROFILE_DIR/share/apps/konqsidebartng/virtual_folders/remote/web/look_web.desktop" 2>/dev/null
fi
fi
# Perform some nominal update validations. # Perform some nominal update validations.
# First clean house from any previous failures. # First clean house from any previous failures.
if [ "$CACHE_DIR" = "" ]; then if [ "$CACHE_DIR" = "" ]; then
@ -1117,6 +1137,10 @@ unset R14_UPDATE_TEST3
unset R14_UPDATE_TEST4 unset R14_UPDATE_TEST4
unset R14_UPDATE_TEST5 unset R14_UPDATE_TEST5
unset R14_UPDATE_TEST6 unset R14_UPDATE_TEST6
unset R14_UPDATE_TEST7
unset R14_UPDATE_TEST8
unset R14_UPDATE_TEST9
unset R14_UPDATE_TEST10
unset KDEGLOBALS_KEY_VALUE unset KDEGLOBALS_KEY_VALUE
unset TEST_NUM unset TEST_NUM
unset SCRIPT_NAME unset SCRIPT_NAME

Loading…
Cancel
Save