Fix migration issue, a local "history.desktop" file from kde <= 4.2 would prevent the new history module from showing up.

Thanks to squan at web.de for testing the beta and discovering this before 4.4 final is released :-)
CCBUG: 193966

svn path=/trunk/KDE/kdebase/apps/; revision=1065660
This commit is contained in:
David Faure 2009-12-24 00:44:07 +00:00
parent 374b8c4551
commit 61bc2320d6

View file

@ -218,6 +218,14 @@ void ModuleManager::sortGlobalEntries(QStringList& fileNames) const
KConfigGroup configGroup(config, "Desktop Entry");
const int weight = configGroup.readEntry("X-KDE-Weight", 0);
sorter.insert(weight, fileName);
// While we have the config file open, fix migration issue between old and new history sidebar
if (configGroup.readEntry("X-KDE-TreeModule") == "History") {
// Old local file still there; remove it
const QString localFile = KStandardDirs::locateLocal("data", path);
QFile::rename(localFile, localFile + ".orig");
kDebug() << "Migration: moving" << localFile << "out of the way";
}
}
}
fileNames = sorter.values();