summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-04 23:13:19 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-04 23:13:19 (GMT)
commit869646ecb4eb74ca063f9f5401785a07849869fd (patch)
tree425fc6bb6d08596605bcc8563322b1839810a208
parent4e1e27a2fced2562390a1aa25548eead0769aef0 (diff)
Port from KStandardDirs to QStandardPath.
There is one instance of KStandardDirs left where permissions are set to 700.
-rw-r--r--editor/kgpgeditor.cpp7
-rw-r--r--keysmanager.cpp13
-rw-r--r--kgpgfirstassistant.cpp7
-rw-r--r--kgpgoptions.cpp11
4 files changed, 21 insertions, 17 deletions
diff --git a/editor/kgpgeditor.cpp b/editor/kgpgeditor.cpp
index 2990e02..a1ed889 100644
--- a/editor/kgpgeditor.cpp
+++ b/editor/kgpgeditor.cpp
@@ -38,6 +38,7 @@
#include <KLocale>
#include <KMessageBox>
#include <KRecentFilesAction>
+#include <KSharedConfig>
#include <KStandardAction>
#include <KToggleAction>
#include <KToolBar>
@@ -108,7 +109,7 @@ KgpgEditor::KgpgEditor(KeysManager *parent, KGpgItemModel *model, Qt::WFlags f)
KgpgEditor::~KgpgEditor()
{
- m_recentfiles->saveEntries( KConfigGroup(KGlobal::config(), "Recent Files" ) );
+ m_recentfiles->saveEntries( KConfigGroup(KSharedConfig::openConfig(), "Recent Files" ) );
}
void KgpgEditor::openDocumentFile(const KUrl& url, const QString &encoding)
@@ -145,7 +146,7 @@ void KgpgEditor::slotSetFont(QFont myFont)
void KgpgEditor::closeWindow()
{
- m_recentfiles->saveEntries( KConfigGroup(KGlobal::config(), "Recent Files" ) );
+ m_recentfiles->saveEntries( KConfigGroup(KSharedConfig::openConfig(), "Recent Files" ) );
close();
}
@@ -179,7 +180,7 @@ void KgpgEditor::initActions()
m_recentfiles = KStandardAction::openRecent(this, SLOT(openDocumentFile(KUrl)), this);
menuBar()->addAction(m_recentfiles);
- m_recentfiles->loadEntries( KConfigGroup(KGlobal::config(), "Recent Files" ) );
+ m_recentfiles->loadEntries( KConfigGroup(KSharedConfig::openConfig(), "Recent Files" ) );
m_recentfiles->setMaxItems(KGpgSettings::recentFiles());
QAction *action = actionCollection()->addAction(QLatin1String("file_encrypt"), this, SLOT(slotFilePreEnc()));
diff --git a/keysmanager.cpp b/keysmanager.cpp
index 4a0f7ee..6d6957f 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -72,6 +72,7 @@
#include <KRun>
#include <KSelectAction>
#include <KService>
+#include <KSharedConfig>
#include <KStandardAction>
#include <KStandardGuiItem>
#include <KStandardShortcut>
@@ -414,7 +415,7 @@ KeysManager::KeysManager(QWidget *parent)
exportPublicKey->setEnabled(false);
- KConfigGroup cg = KConfigGroup(KGlobal::config().data(), "KeyView");
+ KConfigGroup cg = KConfigGroup(KSharedConfig::openConfig().data(), "KeyView");
iview->restoreLayout(cg);
connect(photoProps, SIGNAL(triggered(int)), this, SLOT(slotSetPhotoSize(int)));
@@ -460,7 +461,7 @@ KeysManager::KeysManager(QWidget *parent)
// statusbar->insertPermanentFixedItem(KGpgItemModel::statusCountMessageString(9999, 999), 0); FIXME: KF5
// statusbar->changeItem(QString(), 0); FIXME: KF5
- cg = KConfigGroup(KGlobal::config().data(), "MainWindow");
+ cg = KConfigGroup(KSharedConfig::openConfig().data(), "MainWindow");
setAutoSaveSettings(cg, true);
applyMainWindowSettings(cg);
@@ -505,7 +506,7 @@ void KeysManager::slotGenerateKey()
m_genkey->start();
QApplication::setOverrideCursor(Qt::BusyCursor);
} else {
- KConfigGroup config(KGlobal::config(), "General");
+ KConfigGroup config(KSharedConfig::openConfig(), "General");
QString terminalApp(config.readPathEntry("TerminalApplication", QLatin1String( "konsole" )));
QStringList args;
@@ -1130,7 +1131,7 @@ void KeysManager::quitApp()
void KeysManager::saveToggleOpts(void)
{
- KConfigGroup cg = KConfigGroup(KGlobal::config().data(), "KeyView");
+ KConfigGroup cg = KConfigGroup(KSharedConfig::openConfig().data(), "KeyView");
iview->saveLayout(cg);
KGpgSettings::setPhotoProperties(photoProps->currentItem());
KGpgSettings::setShowTrust(sTrust->isChecked());
@@ -2059,7 +2060,7 @@ void KeysManager::slotCaffDone()
void KeysManager::signKeyOpenConsole(const QString &signer, const QString &keyid, const int checking, const bool local)
{
- KConfigGroup config(KGlobal::config(), "General");
+ KConfigGroup config(KSharedConfig::openConfig(), "General");
KProcess process;
process << config.readPathEntry("TerminalApplication", QLatin1String("konsole"))
@@ -2267,7 +2268,7 @@ void KeysManager::slotedit()
return;
KProcess *kp = new KProcess(this);
- KConfigGroup config(KGlobal::config(), "General");
+ KConfigGroup config(KSharedConfig::openConfig(), "General");
*kp << config.readPathEntry("TerminalApplication", QLatin1String("konsole"))
<< QLatin1String("-e")
<< KGpgSettings::gpgBinaryPath()
diff --git a/kgpgfirstassistant.cpp b/kgpgfirstassistant.cpp
index 442e109..648962b 100644
--- a/kgpgfirstassistant.cpp
+++ b/kgpgfirstassistant.cpp
@@ -26,9 +26,9 @@
#include <KComboBox>
#include <KLocale>
#include <KMessageBox>
-#include <KStandardDirs>
#include <KUrl>
#include <KUrlRequester>
+
#include <QCheckBox>
#include <QGridLayout>
#include <QHBoxLayout>
@@ -36,6 +36,7 @@
#include <QSpacerItem>
#include <QTextStream>
#include <QWidget>
+#include <QStandardPaths>
using namespace KgpgCore;
@@ -109,9 +110,9 @@ KGpgFirstAssistant::KGpgFirstAssistant(QWidget *parent)
binURL = new KUrlRequester(page);
binURL->setFilter(i18nc("search filter for gpg binary", "gpg|GnuPG binary\n*|All files"));
- QString gpgBin = KStandardDirs::findExe(QLatin1String("gpg2"));
+ QString gpgBin = QStandardPaths::findExecutable(QLatin1String("gpg2"));
if (gpgBin.isEmpty())
- gpgBin = KStandardDirs::findExe(QLatin1String("gpg"));
+ gpgBin = QStandardPaths::findExecutable(QLatin1String("gpg"));
if (gpgBin.isEmpty())
gpgBin = QLatin1String("gpg");
binURL->setUrl(KUrl::fromPath(gpgBin));
diff --git a/kgpgoptions.cpp b/kgpgoptions.cpp
index 48f1627..28dcfd6 100644
--- a/kgpgoptions.cpp
+++ b/kgpgoptions.cpp
@@ -23,6 +23,7 @@
#include "model/kgpgitemmodel.h"
#include <KConfig>
+#include <KDebug>
#include <KDesktopFile>
#include <KFileDialog>
#include <KFontChooser>
@@ -30,13 +31,13 @@
#include <KLocale>
#include <KMessageBox>
#include <KProcess>
-#include <KStandardDirs>
-#include <KDebug>
#include <KUrl>
+
#include <QCheckBox>
#include <QFile>
#include <QTextStream>
#include <QVBoxLayout>
+#include <QStandardPaths>
using namespace KgpgCore;
@@ -481,7 +482,7 @@ void kgpgOptions::listKeys()
void kgpgOptions::slotInstallDecrypt(const QString &mimetype)
{
- const QString path(KStandardDirs::locateLocal("data", QLatin1String( "konqueror/servicemenus/decryptfile.desktop" )));
+ const QString path(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/konqueror/servicemenus/decryptfile.desktop" ));
KDesktopFile configl2(path);
if (!configl2.isImmutable()) {
KConfigGroup gr(configl2.group("Desktop Entry"));
@@ -499,7 +500,7 @@ void kgpgOptions::slotInstallDecrypt(const QString &mimetype)
void kgpgOptions::slotInstallSign(const QString &mimetype)
{
- QString path(KStandardDirs::locateLocal("services", QLatin1String( "ServiceMenus/signfile.desktop" )));
+ QString path(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kde5/services/") + QLatin1String( "ServiceMenus/signfile.desktop" ));
KDesktopFile configl2(path);
if (!configl2.isImmutable()) {
KConfigGroup gr = configl2.group("Desktop Entry");
@@ -516,7 +517,7 @@ void kgpgOptions::slotInstallSign(const QString &mimetype)
void kgpgOptions::slotRemoveMenu(const QString &menu)
{
- QString path = KStandardDirs::locateLocal("services", QLatin1String( "ServiceMenus/" ) + menu);
+ QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kde5/services/") + QLatin1String( "ServiceMenus/" ) + menu;
QFile qfile(path);
if (qfile.exists())
qfile.remove();