Commit 71987f07 authored by Simon Persson's avatar Simon Persson
Browse files

Port from KStandardDirs to QStandardPaths

The porting script also ported from KGlobal::config to KSharedConfig::openConfig.
parent c2e554e6
......@@ -38,7 +38,6 @@
#include <KDE/KComponentData>
#include <KDE/KLocale>
#include <kde_file.h>
#include <KDE/KStandardDirs>
#include <KDE/KMimeType>
#include <KIOCore/KFileItem>
......@@ -168,7 +167,7 @@ kio_krarcProtocol::kio_krarcProtocol(const QByteArray &pool_socket, const QByteA
krConfig = new KConfig("krusaderrc");
confGrp = KConfigGroup(krConfig, "Dependencies");
arcTempDir = KStandardDirs::locateLocal("tmp", QString());
arcTempDir = QDir::tempPath() + DIR_SEPARATOR;
QString dirName = "krArc" + QDateTime::currentDateTime().toString(Qt::ISODate);
dirName.replace(QRegExp(":"), "_");
QDir(arcTempDir).mkdir(dirName);
......@@ -1485,7 +1484,7 @@ bool kio_krarcProtocol::initArcParameters()
getCmd << fullPathName("unzip") << "-p";
copyCmd << fullPathName("unzip") << "-jo";
if (KStandardDirs::findExe("zip").isEmpty()) {
if (QStandardPaths::findExecutable(QStringLiteral("zip")).isEmpty()) {
delCmd = QStringList();
putCmd = QStringList();
} else {
......@@ -1499,7 +1498,7 @@ bool kio_krarcProtocol::initArcParameters()
putCmd << "-P" << password;
}
} else if (arcType == "rar") {
if (KStandardDirs::findExe("rar").isEmpty()) {
if (QStandardPaths::findExecutable(QStringLiteral("rar")).isEmpty()) {
cmd = fullPathName("unrar");
listCmd << fullPathName("unrar") << "-c-" << "-v" << "v";
getCmd << fullPathName("unrar") << "p" << "-ierr" << "-idp" << "-c-" << "-y";
......@@ -1598,7 +1597,7 @@ bool kio_krarcProtocol::initArcParameters()
} else if (arcType == "7z") {
noencoding = true;
cmd = fullPathName("7z");
if (KStandardDirs::findExe(cmd).isEmpty())
if (QStandardPaths::findExecutable(cmd).isEmpty())
cmd = fullPathName("7za");
listCmd << cmd << "l" << "-y";
......@@ -1624,7 +1623,7 @@ bool kio_krarcProtocol::initArcParameters()
if (cmd.startsWith(DIR_SEPARATOR))
return true;
#endif
if (KStandardDirs::findExe(cmd).isEmpty()) {
if (QStandardPaths::findExecutable(cmd).isEmpty()) {
error(KIO::ERR_CANNOT_LAUNCH_PROCESS,
cmd +
i18n("\nMake sure that the %1 binary is installed properly on your system.", cmd));
......@@ -1759,9 +1758,9 @@ QString kio_krarcProtocol::detectArchive(bool &encrypted, QString fileName)
else { // we try to find whether the 7z archive is encrypted
// this is hard as the headers are also compresseds
QString tester = fullPathName("7z");
if (KStandardDirs::findExe(tester).isEmpty()) {
if (QStandardPaths::findExecutable(tester).isEmpty()) {
tester = fullPathName("7za");
if (KStandardDirs::findExe(tester).isEmpty()) {
if (QStandardPaths::findExecutable(tester).isEmpty()) {
return type;
}
}
......
......@@ -30,13 +30,13 @@
#include <QtCore/QTextStream>
#include <QtCore/QFile>
#include <QtCore/QEvent>
#include <QtCore/QStandardPaths>
#include <QtGui/QMouseEvent>
#include <QtGui/QCursor>
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KDebug>
#include <KDE/KStandardDirs>
#include <KIconThemes/KIconLoader>
#include <KWidgetsAddons/KMessageBox>
......@@ -64,7 +64,8 @@ KrBookmarkHandler::KrBookmarkHandler(FileManagerWindow *mainWindow) : QObject(ma
importFromFile();
// hack
manager = KBookmarkManager::managerForFile(KStandardDirs::locateLocal("data", BOOKMARKS_FILE), "krusader");
QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + BOOKMARKS_FILE;
manager = KBookmarkManager::managerForFile(filename, QStringLiteral("krusader"));
connect(manager, SIGNAL(changed(const QString&, const QString&)), this, SLOT(bookmarksChanged(const QString&, const QString&)));
}
......@@ -196,7 +197,7 @@ void KrBookmarkHandler::exportToFile()
}
QString filename = KStandardDirs::locateLocal("data", BOOKMARKS_FILE);
QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + BOOKMARKS_FILE;
QFile file(filename);
if (file.open(QIODevice::WriteOnly)) {
QTextStream stream(&file);
......@@ -278,7 +279,7 @@ void KrBookmarkHandler::importFromFile()
{
clearBookmarks(_root);
QString filename = KStandardDirs::locateLocal("data", BOOKMARKS_FILE);
QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + BOOKMARKS_FILE;
QFile file(filename);
if (!file.open(QIODevice::ReadOnly))
return; // no bookmarks file
......
......@@ -43,7 +43,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KCoreAddons/KProcess>
#include <KCompletion/KLineEdit>
......
......@@ -32,7 +32,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KDE/KStandardGuiItem>
#include <kdeversion.h>
......
......@@ -18,6 +18,7 @@
#include "krkeydialog.h"
#include <QtCore/QStandardPaths>
#include <QtCore/QTextStream>
#include <QtWidgets/QLayout>
#include <QtWidgets/QDialogButtonBox>
......@@ -26,7 +27,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KDE/KDebug>
#include <KDE/KGlobal>
#include <KDE/KDialog>
......@@ -76,7 +76,8 @@ KrKeyDialog::~KrKeyDialog()
void KrKeyDialog::slotImportShortcuts()
{
// find $KDEDIR/share/apps/krusader
QString basedir = KGlobal::dirs()->findResourceDir("appdata", "total_commander.keymap");
QString basedir= QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("total_commander.keymap"));
basedir = QFileInfo(basedir).absolutePath();
// let the user select a file to load
QString filename = QFileDialog::getOpenFileName(0, i18n("Select a keymap file"), basedir, i18n(FILE_FILTER));
if (filename.isEmpty())
......
......@@ -20,9 +20,6 @@
#include <QtGui/QFont>
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KGlobal>
#include <KConfigCore/KConfig>
#include <KConfigCore/KSharedConfig>
#include <KConfigCore/KConfigGroup>
......@@ -38,7 +35,7 @@ Filelight::MapScheme Config::scheme;
inline KConfigGroup
Filelight::Config::kconfig()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
return KConfigGroup(config, "DiskUsage");
}
......
......@@ -47,7 +47,6 @@
#include <QtWidgets/QLabel>
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KStandardDirs>
#include <KDE/KLocale>
#include <KDE/KGlobalSettings>
......
......@@ -27,12 +27,12 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KGlobal>
#include <KDE/KIcon>
#include <KDELibs4Support/kmessagebox_queued.h>
#include <KWidgetsAddons/KMessageBox>
#include <KConfigCore/KConfigGroup>
#include <KConfigCore/KSharedConfig>
#include <KIO/Global>
#include <KIOCore/KMountPoint>
......@@ -211,7 +211,7 @@ bool MediaButton::getNameAndIcon(Solid::Device & device, QString &name, KIcon &k
else if (icon == "media-optical")
type = i18n("Recordable CD/DVD-ROM");
KConfigGroup cfg(KGlobal::config(), "MediaMenu");
KConfigGroup cfg(KSharedConfig::openConfig(), QStringLiteral("MediaMenu"));
if (printSize) {
QString showSizeSetting = cfg.readEntry("ShowSize", "Always");
......
......@@ -21,7 +21,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KGlobal>
#include <KDE/KStandardDirs>
#include <KDE/KDebug>
#include <KDE/KLocale>
#include <KDE/KDialog>
......
......@@ -33,6 +33,7 @@
#include "../Panel/krcolorcache.h"
#include <QtCore/QList>
#include <QtCore/QStandardPaths>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QTabWidget>
#include <QtWidgets/QHeaderView>
......@@ -41,8 +42,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KDE/KGlobal>
#include <KConfigWidgets/KColorScheme>
#include <KWidgetsAddons/KMessageBox>
......@@ -567,7 +566,8 @@ bool KgColors::apply()
void KgColors::slotImportColors()
{
// find $KDEDIR/share/apps/krusader
QString basedir = KGlobal::dirs()->findResourceDir("appdata", "total_commander.keymap");
QString basedir= QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("total_commander.keymap"));
basedir = QFileInfo(basedir).absolutePath();
// let the user select a file to load
QString file = QFileDialog::getOpenFileName(0, i18n("Select a color-scheme file"), basedir, QStringLiteral("*.color"));
if (file.isEmpty()) {
......
......@@ -42,8 +42,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KGlobal>
#include <KDE/KStandardDirs>
#include <KWidgetsAddons/KMessageBox>
......
......@@ -41,8 +41,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KGlobal>
#include <KDE/KStandardDirs>
#include <KDE/KDialog>
#include <KWidgetsAddons/KMessageBox>
......
......@@ -36,6 +36,7 @@ A
#include <QtCore/QMetaEnum>
#include <QtCore/QFile>
#include <QtCore/QResource>
#include <QtCore/QStandardPaths>
#include <QtWidgets/QLayout>
#include <QtWidgets/QWidget>
#include <QtWidgets/QHBoxLayout>
......@@ -44,11 +45,8 @@ A
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KDE/KComponentData>
#include <KDE/KDebug>
#include <KDE/KDialog>
#include <KDE/KGlobal>
#define XMLFILE_VERSION "1.0"
#define MAIN_FILE "layout.xml"
......@@ -79,14 +77,12 @@ bool KrLayoutFactory::parseFiles()
if (_parsed)
return true;
QString dataDir = KGlobal::mainComponent().componentName() + "/";
QString mainFilePath = KStandardDirs::locate("data", dataDir + MAIN_FILE);
QString mainFilePath = QStandardPaths::locate(QStandardPaths::DataLocation, MAIN_FILE);
if (!mainFilePath.isEmpty())
_parsed = parseFile(mainFilePath, _mainDoc);
else
krOut << "can't locate" << dataDir + MAIN_FILE << endl;
krOut << "can't locate" << MAIN_FILE << endl;
if (!_parsed)
_parsed = parseRessource(MAIN_FILE_RC_PATH, _mainDoc);
......@@ -94,7 +90,7 @@ bool KrLayoutFactory::parseFiles()
if (!_parsed)
return false;
QStringList extraFilePaths = KGlobal::dirs()->findAllResources("data", dataDir + EXTRA_FILE_MASK);
QStringList extraFilePaths = QStandardPaths::locateAll(QStandardPaths::DataLocation, EXTRA_FILE_MASK);
foreach(QString path, extraFilePaths) {
krOut << "extra file: " << path << endl;
......
......@@ -23,12 +23,12 @@
#include "../krglobal.h"
#include "../defaults.h"
#include <QtCore/QStandardPaths>
#include <QtWidgets/QApplication>
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KGlobal>
#include <QtWidgets/QStyle>
#include <KCoreAddons/KUrlMimeData>
#include <KConfigCore/KSharedConfig>
#define CANCEL_TWO_CLICK_RENAME {_singleClicked = false;_renameTimer.stop();}
......@@ -38,7 +38,8 @@ KrMouseHandler::KrMouseHandler(KrView * view, int contextMenuShift) : _view(view
{
KConfigGroup grpSvr(krConfig, "Look&Feel");
// decide on single click/double click selection
_singleClick = grpSvr.readEntry("Single Click Selects", _SingleClickSelects) && KGlobalSettings::singleClick();
bool singleClickTmp = QApplication::style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick);
_singleClick = grpSvr.readEntry("Single Click Selects", _SingleClickSelects) && singleClickTmp;
connect(&_contextMenuTimer, SIGNAL(timeout()), this, SLOT(showContextMenu()));
connect(&_renameTimer, SIGNAL(timeout()), this, SIGNAL(renameCurrentItem()));
}
......@@ -177,7 +178,7 @@ bool KrMouseHandler::mouseReleaseEvent(QMouseEvent *e)
} else if (!_singleClick && e->button() == Qt::LeftButton) {
if (item && e->modifiers() == Qt::NoModifier) {
if (_singleClicked && !_renameTimer.isActive() && _singleClickedItem == item) {
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup group(krConfig, "KDE");
int doubleClickInterval = group.readEntry("DoubleClickInterval", 400);
......
......@@ -57,7 +57,6 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KMimeType>
#include <KDE/KStandardDirs>
#include <KDE/KGlobalSettings>
#include <KDE/KDebug>
#include <kdeversion.h>
......
......@@ -44,7 +44,6 @@ A
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KDE/KInputDialog>
#include <KDE/KDebug>
#include <KIO/NetAccess>
......
......@@ -46,12 +46,12 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KGlobal>
#include <KDE/KDebug>
#include <KDE/KIcon>
#include <KWidgetsAddons/KMessageBox>
#include <KConfigCore/KConfigGroup>
#include <KConfigCore/KSharedConfig>
struct SplitterGUI::PredefinedDevice
{
......@@ -169,7 +169,7 @@ SplitterGUI::SplitterGUI(QWidget* parent, QUrl fileURL, QUrl defaultDir) :
setWindowTitle(i18n("Krusader::Splitter"));
KConfigGroup cfg(KGlobal::config(), "Splitter");
KConfigGroup cfg(KSharedConfig::openConfig(), QStringLiteral("Splitter"));
overwriteCb->setChecked(cfg.readEntry("OverWriteFiles", false));
connect(sizeCombo, SIGNAL(activated(int)), this, SLOT(sizeComboActivated(int)));
......@@ -183,7 +183,7 @@ SplitterGUI::SplitterGUI(QWidget* parent, QUrl fileURL, QUrl defaultDir) :
SplitterGUI::~SplitterGUI()
{
KConfigGroup cfg(KGlobal::config(), "Splitter");
KConfigGroup cfg(KSharedConfig::openConfig(), QStringLiteral("Splitter"));
cfg.writeEntry("OverWriteFiles", overwriteCb->isChecked());
}
......
......@@ -49,7 +49,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KDebug>
#include <KDE/KInputDialog>
#include <KDE/KStandardDirs>
#include <KWidgetsAddons/KMessageBox>
......
......@@ -18,9 +18,10 @@
#include "useraction.h"
#include <QtCore/QFile>
#include <QtCore/QHash>
#include <QtCore/QStandardPaths>
#include <QtCore/QTextStream>
#include <QtCore/QFile>
#include <QtCore/QUrl>
#include <QtXml/QDomDocument>
#include <QtXml/QDomElement>
......@@ -28,7 +29,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KDebug>
#include <KDE/KStandardDirs>
#include <KXmlGui/KActionCollection>
#include <KWidgetsAddons/KActionMenu>
......@@ -141,13 +141,13 @@ QStringList UserAction::allNames()
void UserAction::readAllFiles()
{
QString filename = KStandardDirs::locate("data", ACTION_XML); // locate returns the local file if it exists, else the global one is retrieved.
QString filename = QStandardPaths::locate(QStandardPaths::GenericDataLocation, ACTION_XML); // locate returns the local file if it exists, else the global one is retrieved.
if (! filename.isEmpty())
readFromFile(KStandardDirs::locate("data", ACTION_XML), renameDoublicated);
readFromFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, ACTION_XML), renameDoublicated);
filename = KStandardDirs::locate("data", ACTION_XML_EXAMPLES);
filename = QStandardPaths::locate(QStandardPaths::GenericDataLocation, ACTION_XML_EXAMPLES);
if (! filename.isEmpty())
readFromFile(KStandardDirs::locate("data", ACTION_XML_EXAMPLES), ignoreDoublicated); // ignore samples which are already in the normal file
readFromFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, ACTION_XML_EXAMPLES), ignoreDoublicated); // ignore samples which are already in the normal file
}
void UserAction::readFromFile(const QString& filename, ReadMode mode, KrActionList* list)
......@@ -255,7 +255,7 @@ QDomDocument UserAction::createEmptyDoc()
bool UserAction::writeActionFile()
{
QString filename = KStandardDirs::locateLocal("data", ACTION_XML);
QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + ACTION_XML;
QDomDocument doc = createEmptyDoc();
QDomElement root = doc.documentElement();
......
......@@ -32,12 +32,12 @@
#include <unistd.h> // for usleep
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtWidgets/QApplication>
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KWidgetsAddons/KMessageBox>
#include <KWidgetsAddons/KPasswordDialog>
......@@ -318,9 +318,8 @@ bool KRarcHandler::unpack(QString archive, QString type, QString password, QStri
packer << KrServices::fullPathName("unarj") << "x";
} else if (type == "-7z") packer << KrServices::fullPathName("7z") << "-y" << "x";
else if (type == "-rpm") {
QString tempDir = KStandardDirs::locateLocal("tmp", QString());
cpioName = tempDir + "/contents.cpio"; // TODO use QTemporaryFile (setAutoRemove(false) when asynchrone)
// TODO use QTemporaryFile (setAutoRemove(false) when asynchrone)
cpioName = QDir::tempPath() + QStringLiteral("/contents.cpio");
KrLinecountingProcess cpio;
cpio << KrServices::fullPathName("rpm2cpio") << archive;
......@@ -334,9 +333,8 @@ bool KRarcHandler::unpack(QString archive, QString type, QString password, QStri
archive = cpioName;
packer << KrServices::fullPathName("cpio") << "--force-local" << "--no-absolute-filenames" << "-iuvdF";
} else if (type == "-deb") {
QString tempDir = KStandardDirs::locateLocal("tmp", QString());
cpioName = tempDir + "/contents.tar"; // TODO use QTemporaryFile (setAutoRemove(false) when asynchrone)
// TODO use QTemporaryFile (setAutoRemove(false) when asynchrone)
cpioName = QDir::tempPath() + QStringLiteral("/contents.tar");
KrLinecountingProcess dpkg;
dpkg << KrServices::fullPathName("dpkg") << "--fsys-tarfile" << archive;
......
......@@ -26,9 +26,7 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <kde_file.h>
#include <KDE/KGlobalSettings>
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KIOCore/KFileItem>
#include <KWidgetsAddons/KMessageBox>
......
......@@ -27,7 +27,6 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KDebug>
#include <KDE/KStandardDirs>
#include "krglobal.h"
#include "defaults.h"
......@@ -40,7 +39,7 @@ bool KrServices::cmdExist(QString cmdName)
if (QFile(group.readEntry(cmdName, QString())).exists())
return true;
return !KStandardDirs::findExe(cmdName).isEmpty();
return !QStandardPaths::findExecutable(cmdName).isEmpty();
}
static const QStringList bin_suffixes = QStringList()
......@@ -62,7 +61,7 @@ QString KrServices::fullPathName(QString name, QString confName)
if (QFile(supposedName = config.readEntry(confName, QString())).exists())
return supposedName;
if ((supposedName = KStandardDirs::findExe(name)).isEmpty())
if ((supposedName = QStandardPaths::findExecutable(name)).isEmpty())
return "";
config.writeEntry(confName, supposedName);
......
......@@ -42,11 +42,12 @@
#include <KDE/KLocale>
#include <KDE/KCmdLineArgs>
#include <KXmlGui/KToolBar>
#include <KCoreAddons/KShell>
#include <KWidgetsAddons/KToggleAction>
#include <KWidgetsAddons/KMessageBox>
#include <KCoreAddons/KShell>
#include <KConfigCore/KSharedConfig>
#include <KXmlGui/KEditToolBar>
#include <KXmlGui/KToolBar>
#ifdef __KJSEMBED__
#include <kjsembed/jsconsolewidget.h>
......@@ -499,7 +500,7 @@ void KRslots::rootKrusader()
// settings slots
void KRslots::configToolbar()
{
KConfigGroup cg(KGlobal::config(), QString());
KConfigGroup cg(KSharedConfig::openConfig(), QString());
krApp->saveMainWindowSettings(cg);
QPointer<KEditToolBar> dlg = new KEditToolBar(krApp->factory());
connect(dlg, SIGNAL(newToolBarConfig()), this, SLOT(saveNewToolbarConfig()));
......@@ -511,7 +512,7 @@ void KRslots::configToolbar()
void KRslots::saveNewToolbarConfig()
{
KConfigGroup cg(KGlobal::config(), QString());
KConfigGroup cg(KSharedConfig::openConfig(), QString());
krApp->applyMainWindowSettings(cg);
krApp->updateGUI();
}
......
......@@ -32,10 +32,9 @@
#include <QtCore/QByteArray>
#include <QtCore/QDataStream>
#include <QtCore/QStandardPaths>
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <KDE/KGlobal>
#include <KDE/KStandardDirs>
#include <KDE/KIcon>
#include <KConfigCore/KConfig>
......@@ -154,7 +153,7 @@ void KonqMultiRestoreJob::slotResult(KJob *job)
KrTrashWatcher::KrTrashWatcher()
{
QString trashrcFile = KGlobal::dirs()->saveLocation("config") +
QString trashrcFile = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) +
QString::fromLatin1("trashrc");
_watcher = new KDirWatch();
// connect the watcher
......
......@@ -35,9 +35,9 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
#include <sys/param.h>
#include <unistd.h>
#include <QtCore/QStringList>
#include <QtCore/QDir>
#include <QtCore/QDateTime>
#include <QtCore/QStringList>
#include <QtGui/QPixmap>
#include <QtGui/QMoveEvent>
#include <QtGui/QResizeEvent>
......@@ -64,6 +64,7 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
#include <KWidgetsAddons/KCursor>
#include <KCoreAddons/KRandom>
#include <KConfigCore/KSharedConfig>
#include <KXmlGui/KXMLGUIFactory>
#include <KXmlGui/KToolBar>
#include <KWidgetsAddons/KAcceleratorManager>
......@@ -313,7 +314,7 @@ bool Krusader::versionControl()
#define FIRST_RUN "First Time"
bool retval = false;
// create config file
krConfig = KGlobal::config().data();
krConfig = KSharedConfig::openConfig().data();
KConfigGroup nogroup(krConfig, QString());
bool firstRun = nogroup.readEntry(FIRST_RUN, true);
......
......@@ -32,10 +32,11 @@
#include <unistd.h>
#include <signal.h>
#include <QtCore/QAbstractEventDispatcher>
#include <QtCore/QCommandLineOption>
#include <QtCore/QCommandLineParser>
#include <QtCore/QEventLoop>
#include <QtCore/QAbstractEventDispatcher>
#include <QtCore/QStandardPaths>
#include <QtGui/QPixmap>
#include <QtDBus/QtDBus>
#include <QtWidgets/QSplashScreen>
......@@ -43,10 +44,9 @@
// TODO KF5 - these headers are from deprecated KDE4LibsSupport : remove them
#include <kde_file.h>
#include <KDE/KLocale>
#include <KDE/KStandardDirs>
#include <KDE/KGlobal>