Remove very outdated config upgrding in kio_desktop

Summary:
This is clearly some upgrade code from many years ago - before Plasma 5.

Gets rid of a whole lot of deprecated function calls (and a unsigned vs
signed int wraning

Test Plan: make

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D2579
wilder-5.14
David Edmundson 10 years ago
parent e2967421cd
commit e38897c057
  1. 46
      kioslave/desktop/kio_desktop.cpp

@ -79,24 +79,6 @@ void DesktopProtocol::checkLocalInstall()
const QDir desktopDir(desktopPath);
bool desktopIsEmpty;
bool newRelease;
// Check if we have a new KDE release
KConfig config(QStringLiteral("kio_desktoprc"));
KConfigGroup cg(&config, "General");
QString version = cg.readEntry("Version", "0.0.0");
int major = version.section('.', 0, 0).toInt();
int minor = version.section('.', 1, 1).toInt();
int release = version.section('.', 2, 2).toInt();
if (KDE_MAKE_VERSION(major, minor, release) < KDE::version()) {
const QString version = QString::number(KDE::versionMajor()) + '.' +
QString::number(KDE::versionMinor()) + '.' +
QString::number(KDE::versionRelease());
cg.writeEntry("Version", version);
newRelease = true;
} else
newRelease = false;
// Create the desktop folder if it doesn't exist
if (!desktopDir.exists()) {
@ -122,34 +104,6 @@ void DesktopProtocol::checkLocalInstall()
if (!file.desktopGroup().readEntry("Hidden", false))
QFile::copy(link, desktopPath + link.mid(link.lastIndexOf('/')));
}
} else if (newRelease) {
// Update the icon name in the .directory file to the FDO naming spec
const QString directoryFile = desktopPath + "/.directory";
if (QFile::exists(directoryFile)) {
KDesktopFile file(directoryFile);
if (file.readIcon() == QLatin1String("desktop"))
file.desktopGroup().writeEntry("Icon", "user-desktop");
} else
QFile::copy(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kio_desktop/directory.desktop")), directoryFile);
// Update the home icon to the FDO naming spec
const QString homeLink = desktopPath + "/Home.desktop";
if (QFile::exists(homeLink)) {
KDesktopFile home(homeLink);
const QString icon = home.readIcon();
if (icon == QLatin1String("kfm_home") || icon == QLatin1String("folder_home"))
home.desktopGroup().writeEntry("Icon", "user-home");
}
// Update the trash icon to the FDO naming spec
const QString trashLink = desktopPath + "/trash.desktop";
if (QFile::exists(trashLink)) {
KDesktopFile trash(trashLink);
if (trash.readIcon() == QLatin1String("trashcan_full"))
trash.desktopGroup().writeEntry("Icon", "user-trash-full");
if (trash.desktopGroup().readEntry("EmptyIcon") == QLatin1String("trashcan_empty"))
trash.desktopGroup().writeEntry("EmptyIcon", "user-trash");
}
}
#endif
}

Loading…
Cancel
Save