summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-03 21:57:09 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-03 21:57:09 (GMT)
commit2ce8b49df16809eab683bddf444483b40423d7b5 (patch)
tree2b47932bb63fa2c1846a3931bc65467910c9a462
parent1b212ef9c0a90638e380c99c10ca796f46c05f54 (diff)
Port away from KShortcut.
-rw-r--r--editor/kgpgeditor.cpp2
-rw-r--r--keysmanager.cpp9
-rw-r--r--keysmanager.h4
-rw-r--r--kgpg.h4
-rw-r--r--kgpgexternalactions.cpp4
-rw-r--r--kgpgexternalactions.h4
-rw-r--r--selectpublickeydialog.cpp2
-rw-r--r--selectpublickeydialog.h4
8 files changed, 16 insertions, 17 deletions
diff --git a/editor/kgpgeditor.cpp b/editor/kgpgeditor.cpp
index 9536fa8..a7c901b 100644
--- a/editor/kgpgeditor.cpp
+++ b/editor/kgpgeditor.cpp
@@ -38,7 +38,6 @@
#include <KLocale>
#include <KMessageBox>
#include <KRecentFilesAction>
-#include <KShortcut>
#include <KStandardAction>
#include <KTemporaryFile>
#include <KToggleAction>
@@ -46,6 +45,7 @@
#include <QAction>
#include <QMenuBar>
+#include <QKeySequence>
#include <QPainter>
#include <QTextCodec>
#include <QTextStream>
diff --git a/keysmanager.cpp b/keysmanager.cpp
index 1cdd04c..d0d4e5e 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -74,7 +74,6 @@
#include <KRun>
#include <KSelectAction>
#include <KService>
-#include <KShortcut>
#include <KStandardAction>
#include <KStandardGuiItem>
#include <KStandardShortcut>
@@ -86,6 +85,7 @@
#include <QApplication>
#include <QClipboard>
+#include <QDBusConnection>
#include <QDir>
#include <QEvent>
#include <QKeySequence>
@@ -99,7 +99,6 @@
#include <QProcess>
#include <QWidget>
#include <QWidgetAction>
-#include <QDBusConnection>
#include <kcontacts/addresseelist.h>
// #include <kcontacts/key.h> TODO
#include <kio/global.h>
@@ -2713,10 +2712,10 @@ KeysManager::showTrayMessage(const QString &message)
m_trayicon->showMessage(QString(), message, QLatin1String( "kgpg" ));
}
-KShortcut
+QKeySequence
KeysManager::goDefaultShortcut() const
{
- return KShortcut(goToDefaultKey->shortcut());
+ return QKeySequence(goToDefaultKey->shortcut());
}
void
@@ -2730,7 +2729,7 @@ KeysManager::clipEncrypt()
return;
}
- QPointer<KgpgSelectPublicKeyDlg> dialog = new KgpgSelectPublicKeyDlg(this, imodel, KShortcut(goToDefaultKey->shortcut()), true);
+ QPointer<KgpgSelectPublicKeyDlg> dialog = new KgpgSelectPublicKeyDlg(this, imodel, QKeySequence(goToDefaultKey->shortcut()), true);
if (dialog->exec() == KDialog::Accepted) {
KGpgEncrypt::EncryptOptions encOptions = KGpgEncrypt::AsciiArmored;
QStringList options;
diff --git a/keysmanager.h b/keysmanager.h
index a1df8eb..7b3691c 100644
--- a/keysmanager.h
+++ b/keysmanager.h
@@ -37,7 +37,7 @@ class QMenu;
class KLineEdit;
class QAction;
class KJob;
-class KShortcut;
+class QKeySequence;
class KeyServer;
class KgpgEditor;
@@ -80,7 +80,7 @@ public:
/**
* @brief returns the shortcut to go to the default key in a key selection
*/
- KShortcut goDefaultShortcut() const;
+ QKeySequence goDefaultShortcut() const;
private:
KToggleAction *sTrust;
diff --git a/kgpg.h b/kgpg.h
index 82d7330..9dfb8a1 100644
--- a/kgpg.h
+++ b/kgpg.h
@@ -19,7 +19,7 @@
#define KGPGAPPLET_H
#include <KUniqueApplication>
-#include <KShortcut>
+#include <QKeySequence>
#include <klocale.h>
class KeysManager;
@@ -47,7 +47,7 @@ public:
int newInstance ();
bool running;
- KShortcut goHome;
+ QKeySequence goHome;
private:
KGpgExternalActions *w;
diff --git a/kgpgexternalactions.cpp b/kgpgexternalactions.cpp
index ea7c169..56a3d38 100644
--- a/kgpgexternalactions.cpp
+++ b/kgpgexternalactions.cpp
@@ -485,7 +485,7 @@ void KGpgExternalActions::help()
KHelpClient::invokeHelp(QString(), QLatin1String( "kgpg" ));
}
-KShortcut KGpgExternalActions::goDefaultKey() const
+QKeySequence KGpgExternalActions::goDefaultKey() const
{
- return KShortcut(qobject_cast<QAction *>(m_keysmanager->actionCollection()->action(QLatin1String( "go_default_key" )))->shortcut());
+ return QKeySequence(qobject_cast<QAction *>(m_keysmanager->actionCollection()->action(QLatin1String( "go_default_key" )))->shortcut());
}
diff --git a/kgpgexternalactions.h b/kgpgexternalactions.h
index a7d75a6..7159f0c 100644
--- a/kgpgexternalactions.h
+++ b/kgpgexternalactions.h
@@ -26,7 +26,7 @@ class KeysManager;
class KGpgFirstAssistant;
class KGpgItemModel;
class KJob;
-class KShortcut;
+class QKeySequence;
class KTemporaryFile;
class QString;
@@ -78,7 +78,7 @@ private:
KeysManager *m_keysmanager;
KUrl::List droppedUrls;
- KShortcut goDefaultKey() const;
+ QKeySequence goDefaultKey() const;
void decryptFile(KUrl::List urls);
private slots:
diff --git a/selectpublickeydialog.cpp b/selectpublickeydialog.cpp
index 7711449..b23642d 100644
--- a/selectpublickeydialog.cpp
+++ b/selectpublickeydialog.cpp
@@ -34,7 +34,7 @@
using namespace KgpgCore;
-KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const KShortcut &goDefaultKey, const bool hideasciioption, const KUrl::List &files)
+KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const QKeySequence &goDefaultKey, const bool hideasciioption, const KUrl::List &files)
: KDialog(parent),
m_customoptions(Q_NULLPTR),
imodel(model),
diff --git a/selectpublickeydialog.h b/selectpublickeydialog.h
index 58bc3bd..33f0f07 100644
--- a/selectpublickeydialog.h
+++ b/selectpublickeydialog.h
@@ -19,7 +19,7 @@
#include "core/kgpgkey.h"
#include <KDialog>
-#include <KShortcut>
+#include <QKeySequence>
#include <KUrl>
#include <KVBox>
#include <QKeySequence>
@@ -44,7 +44,7 @@ public:
/* TODO: the goDefaultKey shortcut should be stored in a way it can be accessed from everywhere. So we don't have to pass it as an argument.
*/
- KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const KShortcut &goDefaultKey, const bool hideasciioption, const KUrl::List &files = KUrl::List());
+ KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const QKeySequence &goDefaultKey, const bool hideasciioption, const KUrl::List &files = KUrl::List());
QStringList selectedKeys() const;
QString getCustomOptions() const;