Commit 29c01adc authored by Kevin Ottens's avatar Kevin Ottens
Browse files

Get rid of KGlobalSettings

Summary:
After grepping in all our repositories, it looks like the SETTINGS_PATHS
category is completely unused (at least I couldn't find anyone doing
anything paths related on the slot end).

Reviewers: #plasma, mart, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26388
parent bde038c0
......@@ -12,7 +12,6 @@ target_link_libraries(kcm_desktoppaths
KF5::I18n
KF5::KIOCore
KF5::KIOWidgets
KF5::KDELibs4Support # kglobalsettings
)
install(TARGETS kcm_desktoppaths DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -51,7 +51,6 @@
// KDE
#include <kconfiggroup.h>
#include <kfileitem.h>
#include <kglobalsettings.h> //KDELibs4Support
#include <kio/copyjob.h>
#include <kio/deletejob.h>
#include <kio/job.h>
......@@ -237,7 +236,6 @@ void DesktopPathConfig::save()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup configGroup( config, "Paths" );
bool pathChanged = false;
bool autostartMoved = false;
QUrl desktopURL(desktopLocation());
......@@ -287,7 +285,6 @@ void DesktopPathConfig::save()
KConfig xdgUserConf( userDirsFile, KConfig::SimpleConfig );
KConfigGroup g( &xdgUserConf, "" );
g.writeEntry( "XDG_DESKTOP_DIR", QString("\"" + translatePath( urlDesktop ) + "\"") );
pathChanged = true;
}
}
......@@ -298,31 +295,16 @@ void DesktopPathConfig::save()
if (autostartMoved)
{
configGroup.writePathEntry( "Autostart", urAutostart->url().toLocalFile(), KConfigBase::Normal | KConfigBase::Global );
pathChanged = true;
}
}
config->sync();
if (xdgSavePath(urDocument, documentsLocation(), "XDG_DOCUMENTS_DIR", i18n("Documents")))
pathChanged = true;
if (xdgSavePath(urDownload, downloadLocation(), "XDG_DOWNLOAD_DIR", i18n("Downloads")))
pathChanged = true;
if (xdgSavePath(urMovie, moviesLocation(), "XDG_VIDEOS_DIR", i18n("Movies")))
pathChanged = true;
if (xdgSavePath(urPicture, picturesLocation(), "XDG_PICTURES_DIR", i18n("Pictures")))
pathChanged = true;
if (xdgSavePath(urMusic, musicLocation(), "XDG_MUSIC_DIR", i18n("Music")))
pathChanged = true;
if (pathChanged) {
qCDebug(KCM_DESKTOPPATH) << "sending message SettingsChanged";
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
}
xdgSavePath(urDocument, documentsLocation(), "XDG_DOCUMENTS_DIR", i18n("Documents"));
xdgSavePath(urDownload, downloadLocation(), "XDG_DOWNLOAD_DIR", i18n("Downloads"));
xdgSavePath(urMovie, moviesLocation(), "XDG_VIDEOS_DIR", i18n("Movies"));
xdgSavePath(urPicture, picturesLocation(), "XDG_PICTURES_DIR", i18n("Pictures"));
xdgSavePath(urMusic, musicLocation(), "XDG_MUSIC_DIR", i18n("Music"));
}
bool DesktopPathConfig::xdgSavePath(KUrlRequester* ur, const QUrl& currentUrl, const char* xdgKey, const QString& type)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment