summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-26 17:00:39 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-26 17:00:39 (GMT)
commit32aa5911623222455e2d1fd4e8a20b41537a4c17 (patch)
tree06ea3f698d14f5bbcbf2282ace858bad5683dbed
parent34082236e764b7f7cca34d84a2b91ef7bd79a5cb (diff)
Port to new qt5 slot signal syntax.
-rw-r--r--adduid.ui6
-rw-r--r--caff.cpp10
-rw-r--r--caff_p.h3
-rw-r--r--conf_encryption.cpp6
-rw-r--r--conf_encryption.h3
-rw-r--r--core/KGpgRefNode.cpp4
-rw-r--r--detailedconsole.cpp7
-rw-r--r--editor/kgpgeditor.cpp32
-rw-r--r--editor/kgpgeditor.h2
-rw-r--r--editor/kgpgmd5widget.cpp6
-rw-r--r--editor/kgpgtextedit.cpp12
-rw-r--r--foldercompressjob.cpp2
-rw-r--r--gpgproc.cpp10
-rw-r--r--gpgproc.h4
-rw-r--r--groupedit.cpp10
-rw-r--r--groupedit.h4
-rw-r--r--keyexport.cpp7
-rw-r--r--keyexport.ui34
-rw-r--r--keyinfodialog.cpp20
-rw-r--r--keyserver.ui2
-rw-r--r--keyservers.cpp62
-rw-r--r--keysmanager.cpp124
-rw-r--r--kgpg.cpp6
-rw-r--r--kgpgchangekey.cpp6
-rw-r--r--kgpgexternalactions.cpp38
-rw-r--r--kgpgexternalactions.h3
-rw-r--r--kgpgfirstassistant.cpp2
-rw-r--r--kgpgkeygenerate.cpp14
-rw-r--r--kgpgoptions.cpp18
-rw-r--r--kgpgoptions.h2
-rw-r--r--kgpgrevokewidget.cpp6
-rw-r--r--kgpgtextinterface.cpp6
-rw-r--r--klinebufferedprocess.cpp6
-rw-r--r--klinebufferedprocess.h5
-rw-r--r--klinebufferedprocessprivate.h3
-rw-r--r--model/gpgservermodel.cpp2
-rw-r--r--model/kgpgitemmodel.cpp6
-rw-r--r--model/kgpgitemmodel.h3
-rw-r--r--newkey.cpp2
-rw-r--r--searchres.ui4
-rw-r--r--selectexpirydate.cpp10
-rw-r--r--selectpublickeydialog.cpp16
-rw-r--r--selectsecretkey.cpp8
-rw-r--r--selectsecretkey.h4
-rw-r--r--sourceselect.cpp4
-rw-r--r--transactions/kgpgkeyservertransaction.cpp2
-rw-r--r--transactions/kgpgtransaction.cpp282
-rw-r--r--transactions/kgpgtransaction.h8
-rw-r--r--transactions/kgpgtransactionjob.cpp6
-rw-r--r--transactions/kgpgtransactionprivate.cpp267
-rw-r--r--transactions/kgpgtransactionprivate.h3
51 files changed, 535 insertions, 577 deletions
diff --git a/adduid.ui b/adduid.ui
index 10099cc..458d25b 100644
--- a/adduid.ui
+++ b/adduid.ui
@@ -22,7 +22,7 @@
</widget>
</item>
<item>
- <widget class="QLineEdit" name="kLineEdit1"/>
+ <widget class="QLineEdit" name="qLineEdit1"/>
</item>
<item>
<widget class="QLabel" name="textLabel2">
@@ -35,7 +35,7 @@
</widget>
</item>
<item>
- <widget class="QLineEdit" name="kLineEdit2"/>
+ <widget class="QLineEdit" name="qLineEdit2"/>
</item>
<item>
<widget class="QLabel" name="textLabel3">
@@ -48,7 +48,7 @@
</widget>
</item>
<item>
- <widget class="QLineEdit" name="kLineEdit3"/>
+ <widget class="QLineEdit" name="qLineEdit3"/>
</item>
<item>
<spacer>
diff --git a/caff.cpp b/caff.cpp
index 047989d..51d27a5 100644
--- a/caff.cpp
+++ b/caff.cpp
@@ -111,7 +111,7 @@ KGpgCaffPrivate::reexportKey(const KGpgSignableNode *key)
imp->setGnuPGHome(m_tempdir->path());
- connect(imp, SIGNAL(done(int)), SLOT(slotReimportDone(int)));
+ connect(imp, &KGpgImport::done, this, &KGpgCaffPrivate::slotReimportDone);
imp->start();
}
@@ -130,7 +130,7 @@ KGpgCaffPrivate::slotReimportDone(int result)
signuid->setGnuPGHome(m_tempdir->path());
if (m_gpgVersion < 0x20100)
signuid->setSecringFile(m_secringfile);
- connect(signuid, SIGNAL(done(int)), SLOT(slotSigningFinished(int)));
+ connect(signuid, &KGpgSignUid::done, this, &KGpgCaffPrivate::slotSigningFinished);
signuid->start();
}
@@ -271,7 +271,7 @@ KGpgCaffPrivate::slotSigningFinished(int result)
deluid->setGnuPGHome(m_tempdir->path());
- connect(deluid, SIGNAL(done(int)), SLOT(slotDelUidFinished(int)));
+ connect(deluid, &KGpgDelUid::done, this, &KGpgCaffPrivate::slotDelUidFinished);
deluid->start();
}
@@ -299,7 +299,7 @@ KGpgCaffPrivate::slotDelUidFinished(int result)
exp->setGnuPGHome(m_tempdir->path());
- connect(exp, SIGNAL(done(int)), SLOT(slotExportFinished(int)));
+ connect(exp, &KGpgExport::done, this, &KGpgCaffPrivate::slotExportFinished);
exp->start();
}
@@ -332,7 +332,7 @@ KGpgCaffPrivate::slotExportFinished(int result)
// as well as the "always encrypt to" setting are not honored.
enc->setGnuPGHome(m_tempdir->path());
- connect(enc, SIGNAL(done(int)), SLOT(slotTextEncrypted(int)));
+ connect(enc, &KGpgEncrypt::done, this, &KGpgCaffPrivate::slotTextEncrypted);
enc->start();
}
diff --git a/caff_p.h b/caff_p.h
index da388e1..ab3605f 100644
--- a/caff_p.h
+++ b/caff_p.h
@@ -26,7 +26,6 @@
class QTemporaryDir;
class KGpgCaffPrivate : public QObject {
- Q_OBJECT
KGpgCaff * const q_ptr;
Q_DECLARE_PUBLIC(KGpgCaff)
@@ -52,7 +51,7 @@ public:
KGpgSignableNode::const_List m_noEncIds; ///< keys without encryption capability that were skipped
KGpgSignableNode::const_List m_alreadyIds; ///< ids already signed
-private slots:
+private:
void slotSigningFinished(int result);
void slotDelUidFinished(int result);
void slotExportFinished(int result);
diff --git a/conf_encryption.cpp b/conf_encryption.cpp
index 9fc569e..af63337 100644
--- a/conf_encryption.cpp
+++ b/conf_encryption.cpp
@@ -20,9 +20,9 @@ Encryption::Encryption( QWidget* parent )
: QWidget( parent ), Ui_Encryption()
{
setupUi( this );
- connect(kcfg_EncryptFilesTo, SIGNAL(toggled(bool)), this,SLOT(encrypt_files_to_toggled(bool)));
- connect(kcfg_AllowCustomEncryptionOptions, SIGNAL(toggled(bool)), this, SLOT(allow_custom_option_toggled(bool)));
- connect(encrypt_to_always, SIGNAL(toggled(bool)), this, SLOT(encrypt_to_always_toggled(bool)));
+ connect(kcfg_EncryptFilesTo, &QCheckBox::toggled, this, &Encryption::encrypt_files_to_toggled);
+ connect(kcfg_AllowCustomEncryptionOptions, &QCheckBox::toggled, this, &Encryption::allow_custom_option_toggled);
+ connect(encrypt_to_always, &QCheckBox::toggled, this, &Encryption::encrypt_to_always_toggled);
}
void Encryption::encrypt_to_always_toggled(bool isOn)
diff --git a/conf_encryption.h b/conf_encryption.h
index 6412081..a444831 100644
--- a/conf_encryption.h
+++ b/conf_encryption.h
@@ -22,12 +22,11 @@
class Encryption : public QWidget, public Ui_Encryption
{
- Q_OBJECT
public:
explicit Encryption(QWidget* parent = Q_NULLPTR);
-public slots:
+public:
virtual void encrypt_to_always_toggled( bool );
virtual void encrypt_files_to_toggled( bool );
virtual void allow_custom_option_toggled( bool );
diff --git a/core/KGpgRefNode.cpp b/core/KGpgRefNode.cpp
index bee794d..329dcf1 100644
--- a/core/KGpgRefNode.cpp
+++ b/core/KGpgRefNode.cpp
@@ -50,7 +50,7 @@ KGpgRefNode::KGpgRefNode(KGpgExpandableNode *parent, const QString &keyid)
if (m_keynode != Q_NULLPTR) {
m_keynode->addRef(this);
} else {
- connect(root, SIGNAL(newKeyNode(KGpgKeyNode*)), this, SLOT(keyUpdated(KGpgKeyNode*)));
+ connect(root, &KGpgRootNode::newKeyNode, this, &KGpgRefNode::keyUpdated);
}
}
@@ -106,7 +106,7 @@ void
KGpgRefNode::unRef(KGpgRootNode *root)
{
if (root != Q_NULLPTR)
- connect(root, SIGNAL(newKeyNode(KGpgKeyNode*)), this, SLOT(keyUpdated(KGpgKeyNode*)));
+ connect(root, &KGpgRootNode::newKeyNode, this, &KGpgRefNode::keyUpdated);
m_keynode = Q_NULLPTR;
}
diff --git a/detailedconsole.cpp b/detailedconsole.cpp
index 3ea5144..8369ba3 100644
--- a/detailedconsole.cpp
+++ b/detailedconsole.cpp
@@ -40,11 +40,10 @@ KgpgDetailedInfo::KgpgDetailedInfo(QWidget *parent, const QString &boxLabel, con
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &KgpgDetailedInfo::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &KgpgDetailedInfo::reject);
mainLayout->addWidget(buttonBox);
okButton->setDefault(true);
setModal(true);
-// KMessageBox::createKMessageBox(this, QMessageBox::Information, // krazy:exclude=qtclasses
-// boxLabel, keysList, QString(), Q_NULLPTR, 0, errormessage); FIXME: KF5
+ KMessageBox::createKMessageBox(this, buttonBox, QMessageBox::Information, boxLabel, keysList, QString(), Q_NULLPTR, 0, errormessage);
}
diff --git a/editor/kgpgeditor.cpp b/editor/kgpgeditor.cpp
index d057dfe..96d5392 100644
--- a/editor/kgpgeditor.cpp
+++ b/editor/kgpgeditor.cpp
@@ -88,7 +88,7 @@ KgpgEditor::KgpgEditor(KeysManager *parent, KGpgItemModel *model, Qt::WFlags f)
// call inits to invoke all other construction parts
initActions();
- connect(m_editor, SIGNAL(resetEncoding(bool)), SLOT(slotResetEncoding(bool)));
+ connect(m_editor, &KgpgTextEdit::resetEncoding, this, &KgpgEditor::slotResetEncoding);
KgpgView *kb = new KgpgView(this, m_editor, toolBar(QLatin1String( "gpgToolBar" )));
setCentralWidget(kb);
setCaption(i18n("Untitled"), false);
@@ -102,11 +102,11 @@ KgpgEditor::KgpgEditor(KeysManager *parent, KGpgItemModel *model, Qt::WFlags f)
setupGUI((ToolBar | Keys | StatusBar | Save | Create), QLatin1String( "kgpgeditor.rc" ));
setAutoSaveSettings(QLatin1String( "Editor" ), true);
- connect(m_editor, SIGNAL(textChanged()), SLOT(modified()));
- connect(m_editor, SIGNAL(newText()), SLOT(newText()));
- connect(m_editor, SIGNAL(undoAvailable(bool)), SLOT(slotUndoAvailable(bool)));
- connect(m_editor, SIGNAL(redoAvailable(bool)), SLOT(slotRedoAvailable(bool)));
- connect(m_editor, SIGNAL(copyAvailable(bool)), SLOT(slotCopyAvailable(bool)));
+ connect(m_editor, &KgpgTextEdit::textChanged, this, &KgpgEditor::modified);
+ connect(m_editor, &KgpgTextEdit::newText, this, &KgpgEditor::newText);
+ connect(m_editor, &KgpgTextEdit::undoAvailable, this, &KgpgEditor::slotUndoAvailable);
+ connect(m_editor, &KgpgTextEdit::redoAvailable, this, &KgpgEditor::slotRedoAvailable);
+ connect(m_editor, &KgpgTextEdit::copyAvailable, this, &KgpgEditor::slotCopyAvailable);
}
KgpgEditor::~KgpgEditor()
@@ -408,8 +408,8 @@ void KgpgEditor::slotFind()
m_find->setData(m_editor->toPlainText(), m_editor->textCursor().selectionStart());
else
m_find->setData(m_editor->toPlainText());
- connect(m_find, SIGNAL(highlight(QString,int,int)), m_editor, SLOT(slotHighlightText(QString,int,int)));
- connect(m_find, SIGNAL(findNext()), this, SLOT(slotFindText()));
+ connect(m_find, static_cast<void(KFind::*)(const QString&,int, int)>(&KFind::highlight), m_editor, &KgpgTextEdit::slotHighlightText);
+ connect(m_find, &KFind::findNext, this, &KgpgEditor::slotFindText);
} else {
m_find->setPattern(fd->pattern());
m_find->setOptions(fd->options());
@@ -511,8 +511,8 @@ void KgpgEditor::slotFilePreDec()
popn->resize(popn->minimumSize());
page->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(page->buttonBox, SIGNAL(accepted()), popn, SLOT(accept()));
- connect(page->buttonBox, SIGNAL(rejected()), popn, SLOT(reject()));
+ connect(page->buttonBox, &QDialogButtonBox::accepted, popn.data(), &QDialog::accept);
+ connect(page->buttonBox, &QDialogButtonBox::rejected, popn.data(), &QDialog::reject);
if (popn->exec() == QDialog::Accepted)
{
@@ -541,7 +541,7 @@ void KgpgEditor::slotFilePreDec()
}
KGpgDecrypt *decr = new KGpgDecrypt(this, url, QUrl(newname));
- connect(decr, SIGNAL(done(int)), SLOT(slotLibraryDone()));
+ connect(decr, &KGpgDecrypt::done, this, &KgpgEditor::slotLibraryDone);
decr->start();
}
else
@@ -647,12 +647,12 @@ void KgpgEditor::slotSignFile(const QUrl &url)
sopts |= KGpgSignText::AsciiArmored;
KGpgSignText *signt = new KGpgSignText(this, signKeyID, QList<QUrl>({url}), sopts);
- connect(signt, SIGNAL(done(int)), SLOT(slotSignFileFin()));
+ connect(signt, &KGpgSignText::done, this, &KgpgEditor::slotSignFileFin);
signt->start();
}
}
-void KgpgEditor::slotSignFileFin()
+void KgpgEditor::slotSignFileFin(int)
{
sender()->deleteLater();
}
@@ -689,7 +689,7 @@ void KgpgEditor::slotVerifyFile(const QUrl &url)
chkfiles << QUrl::fromLocalFile(sigfile);
KGpgVerify *verify = new KGpgVerify(this, chkfiles);
- connect(verify, SIGNAL(done(int)), m_editor, SLOT(slotVerifyDone(int)));
+ connect(verify, &KGpgVerify::done, m_editor, &KgpgTextEdit::slotVerifyDone);
verify->start();
}
}
@@ -716,8 +716,8 @@ void KgpgEditor::importSignatureKey(const QString &id, const QString &fileName)
KeyServer *ks = new KeyServer(this);
- connect(ks, SIGNAL(importFinished(QStringList)), SLOT(slotDownloadKeysFinished(QStringList)));
- connect(ks, SIGNAL(importFailed()), ks, SLOT(deleteLater()));
+ connect(ks, &KeyServer::importFinished, this, &KgpgEditor::slotDownloadKeysFinished);
+ connect(ks, &KeyServer::importFailed, ks, &KeyServer::deleteLater);
ks->startImport(QStringList(id), QString(),QLatin1String( qgetenv("http_proxy") ));
}
diff --git a/editor/kgpgeditor.h b/editor/kgpgeditor.h
index 97cd4ac..bdb5a47 100644
--- a/editor/kgpgeditor.h
+++ b/editor/kgpgeditor.h
@@ -94,7 +94,7 @@ private slots:
// Signing menu
void slotPreSignFile();
void slotSignFile(const QUrl &url);
- void slotSignFileFin();
+ void slotSignFileFin(int);
void slotPreVerifyFile();
void slotVerifyFile(const QUrl &url);
void slotCheckMd5();
diff --git a/editor/kgpgmd5widget.cpp b/editor/kgpgmd5widget.cpp
index 348821d..48dbfe3 100644
--- a/editor/kgpgmd5widget.cpp
+++ b/editor/kgpgmd5widget.cpp
@@ -35,8 +35,8 @@ Md5Widget::Md5Widget(QWidget *parent, const QUrl &url)
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &Md5Widget::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &Md5Widget::reject);
buttonBox->button(QDialogButtonBox::Close)->setDefault(true);
buttonBox->button(QDialogButtonBox::Apply)->setText(i18n("Compare MD5 with Clipboard"));
@@ -81,7 +81,7 @@ Md5Widget::Md5Widget(QWidget *parent, const QUrl &url)
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
- connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotApply()));
+ connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &Md5Widget::slotApply);
}
void Md5Widget::slotApply()
diff --git a/editor/kgpgtextedit.cpp b/editor/kgpgtextedit.cpp
index f5e2f36..1737383 100644
--- a/editor/kgpgtextedit.cpp
+++ b/editor/kgpgtextedit.cpp
@@ -116,7 +116,7 @@ void KgpgTextEdit::openDroppedFile(const QUrl &url, const bool probe)
if (!probe || KGpgDecrypt::isEncryptedText(result, &m_posstart, &m_posend)) {
// if pgp data found, decode it
KGpgDecrypt *decr = new KGpgDecrypt(this, QList<QUrl>({url}));
- connect(decr, SIGNAL(done(int)), SLOT(slotDecryptDone(int)));
+ connect(decr, &KGpgDecrypt::done, this, &KgpgTextEdit::slotDecryptDone);
decr->start();
return;
}
@@ -140,7 +140,7 @@ void KgpgTextEdit::openDroppedFile(const QUrl &url, const bool probe)
setPlainText(result);
} else {
KGpgImport *imp = new KGpgImport(this, result);
- connect(imp, SIGNAL(done(int)), m_keysmanager, SLOT(slotImportDone(int)));
+ connect(imp, &KGpgImport::done, m_keysmanager, &KeysManager::slotImportDone);
imp->start();
}
} else {
@@ -188,7 +188,7 @@ void KgpgTextEdit::slotEncode()
KGpgEncrypt *encr = new KGpgEncrypt(this, listkeys, toPlainText(), opts, options);
encr->start();
- connect(encr, SIGNAL(done(int)), SLOT(slotEncodeUpdate(int)));
+ connect(encr, &KGpgEncrypt::done, this, &KgpgTextEdit::slotEncodeUpdate);
}
delete dialog;
}
@@ -201,7 +201,7 @@ void KgpgTextEdit::slotDecode()
return;
KGpgDecrypt *decr = new KGpgDecrypt(this, fullcontent.mid(m_posstart, m_posend - m_posstart));
- connect(decr, SIGNAL(done(int)), SLOT(slotDecryptDone(int)));
+ connect(decr, &KGpgDecrypt::done, this, &KgpgTextEdit::slotDecryptDone);
decr->start();
}
@@ -221,7 +221,7 @@ void KgpgTextEdit::slotSign(const QString &message)
delete opts;
KGpgSignText *signt = new KGpgSignText(this, signkeyid, message);
- connect(signt, SIGNAL(done(int)), SLOT(slotSignUpdate(int)));
+ connect(signt, &KGpgSignText::done, this, &KgpgTextEdit::slotSignUpdate);
signt->start();
}
@@ -240,7 +240,7 @@ void KgpgTextEdit::slotVerify(const QString &message)
posend += endmsg.length();
KGpgVerify *verify = new KGpgVerify(this, message.mid(posstart, posend - posstart));
- connect(verify, SIGNAL(done(int)), SLOT(slotVerifyDone(int)));
+ connect(verify, &KGpgVerify::done, this, &KgpgTextEdit::slotVerifyDone);
verify->start();
}
diff --git a/foldercompressjob.cpp b/foldercompressjob.cpp
index d501cb5..ad0f2ed 100644
--- a/foldercompressjob.cpp
+++ b/foldercompressjob.cpp
@@ -125,7 +125,7 @@ FolderCompressJob::doWork()
KGpgEncrypt *enc = new KGpgEncrypt(this, d->m_keys, QList<QUrl>({QUrl::fromLocalFile(d->m_tempfile->fileName())}), d->m_encOptions, d->m_options);
- connect(enc, SIGNAL(done(int)), SLOT(slotEncryptionDone(int)));
+ connect(enc, &KGpgEncrypt::done, this, &FolderCompressJob::slotEncryptionDone);
enc->start();
}
diff --git a/gpgproc.cpp b/gpgproc.cpp
index e5c2c23..99e0b6c 100644
--- a/gpgproc.cpp
+++ b/gpgproc.cpp
@@ -191,15 +191,15 @@ GPGProc::resetProcess(const QString &binary)
setOutputChannelMode(OnlyStdoutChannel);
- disconnect(SIGNAL(finished(int,QProcess::ExitStatus)));
- disconnect(SIGNAL(lineReadyStandardOutput()));
+ disconnect(this, static_cast<void(GPGProc::*)(int, QProcess::ExitStatus)>(&GPGProc::finished), this, &GPGProc::processFinished);
+ disconnect(this, &GPGProc::lineReadyStandardOutput, this, &GPGProc::received);
}
void GPGProc::start()
{
// make sure there is exactly one connection from us to that signal
- connect(this, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished()), Qt::UniqueConnection);
- connect(this, SIGNAL(lineReadyStandardOutput()), this, SLOT(received()), Qt::UniqueConnection);
+ connect(this, static_cast<void(GPGProc::*)(int, QProcess::ExitStatus)>(&GPGProc::finished), this, &GPGProc::processFinished, Qt::UniqueConnection);
+ connect(this, &GPGProc::lineReadyStandardOutput, this, &GPGProc::received, Qt::UniqueConnection);
KProcess::start();
}
@@ -208,7 +208,7 @@ void GPGProc::received()
emit readReady();
}
-void GPGProc::finished()
+void GPGProc::processFinished()
{
emit processExited();
}
diff --git a/gpgproc.h b/gpgproc.h
index 723c7ff..c4ec9bc 100644
--- a/gpgproc.h
+++ b/gpgproc.h
@@ -159,18 +159,16 @@ signals:
/**
* Emitted when the process is ready for reading.
* The signal is only emitted if at least one complete line of data is ready.
- * @param p the process that emitted the signal
*/
void readReady();
/**
* Emitted when the process has finished
- * @param p the process that emitted the signal
*/
void processExited();
protected slots:
- void finished();
+ void processFinished();
void received();
private:
diff --git a/groupedit.cpp b/groupedit.cpp
index 36a0c48..b615697 100644
--- a/groupedit.cpp
+++ b/groupedit.cpp
@@ -50,7 +50,7 @@ groupEdit::groupEdit(QWidget *parent, QList<KGpgNode *> *ids, KGpgItemModel *md)
m_outFilter->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_outFilter->setFilterKeyColumn(-1);
- connect(filterEdit, SIGNAL(textChanged(QString)), m_outFilter, SLOT(setFilterFixedString(QString)));
+ connect(filterEdit, &QLineEdit::textChanged, m_outFilter, &QSortFilterProxyModel::setFilterFixedString);
availableKeys->setModel(m_outFilter);
groupKeys->setModel(m_in);
@@ -69,10 +69,10 @@ groupEdit::groupEdit(QWidget *parent, QList<KGpgNode *> *ids, KGpgItemModel *md)
setMinimumSize(sizeHint());
- connect(buttonAdd, SIGNAL(clicked()), this, SLOT(groupAdd()));
- connect(buttonRemove, SIGNAL(clicked()), this, SLOT(groupRemove()));
- connect(availableKeys, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(groupAdd(QModelIndex)));
- connect(groupKeys, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(groupRemove(QModelIndex)));
+ connect(buttonAdd, &QPushButton::clicked, this, static_cast<void(groupEdit::*)()>(&groupEdit::groupAdd));
+ connect(buttonRemove, &QPushButton::clicked, this, static_cast<void(groupEdit::*)()>(&groupEdit::groupRemove));
+ connect(availableKeys, &QTableView::doubleClicked, this, static_cast<void(groupEdit::*)(const QModelIndex&)>(&groupEdit::groupAdd));
+ connect(groupKeys, &QTableView::doubleClicked, this, static_cast<void(groupEdit::*)(const QModelIndex&)>(&groupEdit::groupRemove));
}
groupEdit::~groupEdit()
diff --git a/groupedit.h b/groupedit.h
index a359284..62f31f0 100644
--- a/groupedit.h
+++ b/groupedit.h
@@ -28,8 +28,6 @@ class QSortFilterProxyModel;
*/
class groupEdit : public QWidget, public Ui::groupEdit
{
- Q_OBJECT
-
private:
GroupEditProxyModel *m_in;
GroupEditProxyModel *m_out;
@@ -50,7 +48,7 @@ public:
*/
~groupEdit();
-private Q_SLOTS:
+private:
/**
* @brief called when the add button is clicked
*/
diff --git a/keyexport.cpp b/keyexport.cpp
index 20ed498..6eb7fd6 100644
--- a/keyexport.cpp
+++ b/keyexport.cpp
@@ -23,8 +23,8 @@ KeyExport::KeyExport(QWidget *parent, const QStringList &keyservers)
setupUi(this);
buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &KeyExport::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &KeyExport::reject);
newFilename->setWindowTitle(i18n("Save File"));
newFilename->setMode(KFile::File);
@@ -33,6 +33,9 @@ KeyExport::KeyExport(QWidget *parent, const QStringList &keyservers)
checkServer->setToolTip(QString());
destServer->addItems(keyservers);
}
+
+ connect(checkServer, &QRadioButton::toggled, destServer, &QComboBox::setEnabled);
+ connect(checkFile, &QRadioButton::toggled, newFilename, &KUrlRequester::setEnabled);
}
void KeyExport::accept()
diff --git a/keyexport.ui b/keyexport.ui
index be2cdb23..4594445 100644
--- a/keyexport.ui
+++ b/keyexport.ui
@@ -158,38 +158,4 @@
</customwidget>
</customwidgets>
<resources/>
- <connections>
- <connection>
- <sender>checkServer</sender>
- <signal>toggled(bool)</signal>
- <receiver>destServer</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>72</x>
- <y>69</y>
- </hint>
- <hint type="destinationlabel">
- <x>95</x>
- <y>106</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>checkFile</sender>
- <signal>toggled(bool)</signal>
- <receiver>newFilename</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>39</x>
- <y>133</y>
- </hint>
- <hint type="destinationlabel">
- <x>48</x>
- <y>159</y>
- </hint>
- </hints>
- </connection>
- </connections>
</ui>
diff --git a/keyinfodialog.cpp b/keyinfodialog.cpp
index bbafc42..1841717 100644
--- a/keyinfodialog.cpp
+++ b/keyinfodialog.cpp
@@ -122,7 +122,7 @@ KgpgKeyInfo::KgpgKeyInfo(KGpgKeyNode *node, KGpgItemModel *model, QWidget *paren
connect(buttonBox, &QDialogButtonBox::accepted, this, &KgpgKeyInfo::okButtonClicked);
connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &KgpgKeyInfo::applyButtonClicked);
connect(buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &KgpgKeyInfo::cancelButtonClicked);
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &KgpgKeyInfo::reject);
okButton->setDefault(true);
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
@@ -141,13 +141,13 @@ KgpgKeyInfo::KgpgKeyInfo(KGpgKeyNode *node, KGpgItemModel *model, QWidget *paren
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
- connect(m_owtrust, SIGNAL(activated(int)), this, SLOT(slotChangeTrust(int)));
- connect(m_photoid, SIGNAL(activated(QString)), this, SLOT(slotLoadPhoto(QString)));
- connect(m_email, SIGNAL(leftClickedUrl(QString)), this, SLOT(slotOpenUrl(QString)));
- connect(keychange, SIGNAL(done(int)), SLOT(slotApplied(int)));
- connect(m_disable, SIGNAL(toggled(bool)), this, SLOT(slotDisableKey(bool)));
- connect(m_expirationbtn, SIGNAL(clicked()), this, SLOT(slotChangeDate()));
- connect(m_password, SIGNAL(clicked()), this, SLOT(slotChangePass()));
+ connect(m_owtrust, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &KgpgKeyInfo::slotChangeTrust);
+ connect(m_photoid, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated), this, &KgpgKeyInfo::slotLoadPhoto);
+ connect(m_email, static_cast<void (KUrlLabel::*)(const QString &)>(&KUrlLabel::leftClickedUrl), this, &KgpgKeyInfo::slotOpenUrl);
+ connect(keychange, &KGpgChangeKey::done, this, &KgpgKeyInfo::slotApplied);
+ connect(m_disable, &QCheckBox::toggled, this, &KgpgKeyInfo::slotDisableKey);
+ connect(m_expirationbtn, &QPushButton::clicked, this, &KgpgKeyInfo::slotChangeDate);
+ connect(m_password, &QPushButton::clicked, this, &KgpgKeyInfo::slotChangePass);
displayKey();
adjustSize();
@@ -253,7 +253,7 @@ void KgpgKeyInfo::displayKey()
if (!key->valid())
m_disable->setChecked(true);
- connect(m_node, SIGNAL(expanded()), SLOT(slotKeyExpanded()));
+ connect(m_node, &KGpgKeyNode::expanded, this, &KgpgKeyInfo::slotKeyExpanded);
m_node->expand();
m_photoid->clear();
}
@@ -292,7 +292,7 @@ void KgpgKeyInfo::slotChangePass()
{
KGpgChangePass *cp = new KGpgChangePass(this, m_node->getId());
- connect(cp, SIGNAL(done(int)), SLOT(slotInfoPasswordChanged(int)));
+ connect(cp, &KGpgChangePass::done, this, &KgpgKeyInfo::slotInfoPasswordChanged);
cp->start();
QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
diff --git a/keyserver.ui b/keyserver.ui
index b45a4a4..69e6ebc 100644
--- a/keyserver.ui
+++ b/keyserver.ui
@@ -75,7 +75,7 @@ Allows the user to select the Key Server which will be used to import PGP/GnuPG
</widget>
</item>
<item>
- <widget class="QLineEdit" name="kLEimportid">
+ <widget class="QLineEdit" name="qLEimportid">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
diff --git a/keyservers.cpp b/keyservers.cpp
index 0d6bf01..5f5cb01 100644
--- a/keyservers.cpp
+++ b/keyservers.cpp
@@ -53,17 +53,17 @@ KeyServer::KeyServer(QWidget *parent, KGpgItemModel *model, const bool autoclose
const QStringList serverlist(getServerList());
page->kCBexportks->addItems(serverlist);
page->kCBimportks->addItems(serverlist);
- page->kLEimportid->setFocus();
-
- connect(page->buttonBox, SIGNAL(rejected()), this, SLOT(accept()));
- connect(page->Buttonimport, SIGNAL(clicked()), SLOT(slotImport()));
- connect(page->Buttonsearch, SIGNAL(clicked()), SLOT(slotSearch()));
- connect(page->Buttonexport, SIGNAL(clicked()), SLOT(slotPreExport()));
- connect(page->kLEimportid, SIGNAL(returnPressed()), SLOT(slotSearch()));
- connect(page->buttonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
- connect(page->cBproxyI, SIGNAL(toggled(bool)), SLOT(slotEnableProxyI(bool)));
- connect(page->cBproxyE, SIGNAL(toggled(bool)), SLOT(slotEnableProxyE(bool)));
- connect(page->kLEimportid, SIGNAL(textChanged(QString)), SLOT(slotTextChanged(QString)));
+ page->qLEimportid->setFocus();
+
+ connect(page->buttonBox, &QDialogButtonBox::rejected, this, &KeyServer::accept);
+ connect(page->Buttonimport, &QPushButton::clicked, this, &KeyServer::slotImport);
+ connect(page->Buttonsearch, &QPushButton::clicked, this, &KeyServer::slotSearch);
+ connect(page->Buttonexport, &QPushButton::clicked, this, &KeyServer::slotPreExport);
+ connect(page->buttonBox, &QDialogButtonBox::accepted, this, &KeyServer::slotOk);
+ connect(page->cBproxyI, &QCheckBox::toggled, this, &KeyServer::slotEnableProxyI);
+ connect(page->cBproxyE, &QCheckBox::toggled, this, &KeyServer::slotEnableProxyE);
+ connect(page->qLEimportid, &QLineEdit::returnPressed, this, &KeyServer::slotSearch);
+ connect(page->qLEimportid, &QLineEdit::textChanged, this, &KeyServer::slotTextChanged);
page->cBproxyI->setChecked(KGpgSettings::useProxy());
page->cBproxyE->setChecked(KGpgSettings::useProxy());
@@ -76,8 +76,8 @@ KeyServer::KeyServer(QWidget *parent, KGpgItemModel *model, const bool autoclose
page->kLEproxyE->setText(httpproxy);
}
- page->Buttonimport->setEnabled(!page->kLEimportid->text().isEmpty());
- page->Buttonsearch->setEnabled(!page->kLEimportid->text().isEmpty());
+ page->Buttonimport->setEnabled(!page->qLEimportid->text().isEmpty());
+ page->Buttonsearch->setEnabled(!page->qLEimportid->text().isEmpty());
setMinimumSize(sizeHint());
m_itemmodel->setKeyModel(model);
@@ -95,12 +95,12 @@ void KeyServer::slotImport()
if (page->kCBimportks->currentText().isEmpty())
return;
- if (page->kLEimportid->text().isEmpty()) {
+ if (page->qLEimportid->text().isEmpty()) {
KMessageBox::sorry(this, i18n("You must enter a search string."));
return;
}
- startImport(page->kLEimportid->text().simplified().split(QLatin1Char( ' ' )), page->kCBimportks->currentText(), page->kLEproxyI->text());
+ startImport(page->qLEimportid->text().simplified().split(QLatin1Char( ' ' )), page->kCBimportks->currentText(), page->kLEproxyI->text());
}
void KeyServer::startImport(const QStringList &keys, QString server, const QString &proxy)
@@ -119,7 +119,7 @@ void KeyServer::startImport(const QStringList &keys, QString server, const QStri
QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
KGpgReceiveKeys *proc = new KGpgReceiveKeys(this, server, keys, true, proxy);
- connect(proc, SIGNAL(done(int)), SLOT(slotDownloadKeysFinished(int)));
+ connect(proc, &KGpgReceiveKeys::done, this, &KeyServer::slotDownloadKeysFinished);
proc->start();
}
@@ -157,7 +157,7 @@ void KeyServer::slotExport(const QStringList &keyIds)
QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
KGpgSendKeys *nk = new KGpgSendKeys(this, page->kCBimportks->currentText(), keyIds, expattr, true, page->kLEproxyI->text());
- connect(nk, SIGNAL(done(int)), SLOT(slotUploadKeysFinished(int)));
+ connect(nk, &KGpgSendKeys::done, this, &KeyServer::slotUploadKeysFinished);
nk->start();
}
@@ -185,7 +185,7 @@ void KeyServer::slotSearch()
if (page->kCBimportks->currentText().isEmpty())
return;
- if (page->kLEimportid->text().isEmpty()) {
+ if (page->qLEimportid->text().isEmpty()) {
KMessageBox::sorry(this, i18n("You must enter a search string."));
return;
}
@@ -213,12 +213,12 @@ void KeyServer::slotSearch()
m_listpop->kLVsearch->setColumnWidth(0, 180);
m_listpop->statusText->setText(i18n("Connecting to the server..."));
- connect(m_listpop->filterEdit, SIGNAL(textChanged(QString)), SLOT(slotSetFilterString(QString)));
- connect(m_listpop->kLVsearch->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(transferKeyID()));
- connect(m_listpop->buttonBox, SIGNAL(accepted()), this, SLOT(slotPreImport()));
- connect(m_listpop->kLVsearch, SIGNAL(activated(QModelIndex)), m_dialogserver, SIGNAL(okClicked()));
- connect(m_listpop->buttonBox, SIGNAL(rejected()), this, SLOT(handleQuit()));
- connect(m_listpop->kLEID, SIGNAL(clearButtonClicked()), m_listpop->kLVsearch->selectionModel(), SLOT(clearSelection()));
+ connect(m_listpop->filterEdit, &QLineEdit::textChanged, this, &KeyServer::slotSetFilterString);
+ connect(m_listpop->kLVsearch->selectionModel(), &QItemSelectionModel::selectionChanged, this, &KeyServer::transferKeyID);
+ connect(m_listpop->buttonBox, &QDialogButtonBox::accepted, this, &KeyServer::slotPreImport);
+ connect(m_listpop->kLVsearch, &QTreeView::activated, m_dialogserver, &QDialog::accepted);
+ connect(m_listpop->buttonBox, &QDialogButtonBox::rejected, this, &KeyServer::handleQuit);
+ connect(m_listpop->qLEID, SIGNAL(clearButtonClicked()), m_listpop->kLVsearch->selectionModel(), SLOT(clearSelection()));
m_listpop->kLVsearch->setSelectionMode(QAbstractItemView::ExtendedSelection);
@@ -231,10 +231,10 @@ void KeyServer::slotSearch()
if (useproxy)
proxy = page->kLEproxyI->text();
- m_searchproc = new KGpgKeyserverSearchTransaction(this, keyserv, page->kLEimportid->text().simplified(),
+ m_searchproc = new KGpgKeyserverSearchTransaction(this, keyserv, page->qLEimportid->text().simplified(),
true, proxy);
- connect(m_searchproc, SIGNAL(done(int)), SLOT(slotSearchResult(int)));
- connect(m_searchproc, SIGNAL(newKey(QStringList)), m_resultmodel, SLOT(slotAddKey(QStringList)));
+ connect(m_searchproc, &KGpgKeyserverSearchTransaction::done, this, &KeyServer::slotSearchResult);
+ connect(m_searchproc, &KGpgKeyserverSearchTransaction::newKey, m_resultmodel, &KGpgSearchResultModel::slotAddKey);
m_searchproc->start();
QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
@@ -272,7 +272,7 @@ void KeyServer::slotSearchResult(int result)
void KeyServer::slotSetText(const QString &text)
{
- page->kLEimportid->setText(text);
+ page->qLEimportid->setText(text);
}
void KeyServer::slotTextChanged(const QString &text)
@@ -307,17 +307,17 @@ void KeyServer::transferKeyID()
ids << m_resultmodel->idForIndex(m_filtermodel.mapToSource(index));
const QStringList idlist(ids.toList());
- m_listpop->kLEID->setText(idlist.join( QLatin1String( " " )));
+ m_listpop->qLEID->setText(idlist.join( QLatin1String( " " )));
}
void KeyServer::slotPreImport()
{
transferKeyID();
- if (m_listpop->kLEID->text().isEmpty()) {
+ if (m_listpop->qLEID->text().isEmpty()) {
KMessageBox::sorry(this, i18n("You must choose a key."));
return;
}
- const QStringList keys = m_listpop->kLEID->text().simplified().split(QLatin1Char(' '));
+ const QStringList keys = m_listpop->qLEID->text().simplified().split(QLatin1Char(' '));
m_dialogserver->close();
startImport(keys, page->kCBimportks->currentText(), page->kLEproxyI->text());
}
diff --git a/keysmanager.cpp b/keysmanager.cpp
index 2b96c76..48e2c7d 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -320,21 +320,21 @@ KeysManager::KeysManager(QWidget *parent)
iproxy = new KeyListProxyModel(this);
iproxy->setKeyModel(imodel);
- connect(this, SIGNAL(readAgainOptions()), iproxy, SLOT(settingsChanged()));
+ connect(this, &KeysManager::readAgainOptions, iproxy, &KeyListProxyModel::settingsChanged);
iview = new KeyTreeView(this, iproxy);
- connect(iview, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(defaultAction(QModelIndex)));
- connect(iview, SIGNAL(importDrop(QList<QUrl>)), SLOT(slotImport(QList<QUrl>)));
+ connect(iview, &KeyTreeView::doubleClicked, this, static_cast<void(KeysManager::*)(const QModelIndex &)>(&KeysManager::defaultAction));
+ connect(iview, &KeyTreeView::importDrop, this, static_cast<void(KeysManager::*)(const QList<QUrl> &)>(&KeysManager::slotImport));
iview->setSelectionMode(QAbstractItemView::ExtendedSelection);
setCentralWidget(iview);
iview->resizeColumnsToContents();
iview->setAlternatingRowColors(true);
iview->setSortingEnabled(true);
- connect(iview, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotMenu(QPoint)));
+ connect(iview, &KeyTreeView::customContextMenuRequested, this, &KeysManager::slotMenu);
iview->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(iview->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(checkList()));
+ connect(iview->selectionModel(), &QItemSelectionModel::selectionChanged, this, &KeysManager::checkList);
- connect (iview, SIGNAL(returnPressed()), SLOT(slotDefaultAction()));
+ connect(iview, &KeyTreeView::returnPressed, this, &KeysManager::slotDefaultAction);
hPublic = actionCollection()->add<KToggleAction>(QLatin1String("show_secret"), iproxy, SLOT(setOnlySecret(bool)));
hPublic->setIcon(QIcon::fromTheme( QLatin1String( "view-key-secret" )));
@@ -418,8 +418,8 @@ KeysManager::KeysManager(QWidget *parent)
KConfigGroup cg = KConfigGroup(KSharedConfig::openConfig().data(), "KeyView");
iview->restoreLayout(cg);
- connect(photoProps, SIGNAL(triggered(int)), this, SLOT(slotSetPhotoSize(int)));
- connect(trustProps, SIGNAL(triggered(int)), this, SLOT(slotSetTrustFilter(int)));
+ connect(photoProps, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &KeysManager::slotSetPhotoSize);
+ connect(trustProps, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &KeysManager::slotSetTrustFilter);
QLabel *searchLabel = new QLabel(i18n("Search:"), this);
m_listviewsearch = new QLineEdit(this);
@@ -440,7 +440,7 @@ KeysManager::KeysManager(QWidget *parent)
action = actionCollection()->addAction(QLatin1String("search_focus"), m_listviewsearch, SLOT(setFocus()));
action->setText(i18nc("Name of the action that gives the focus to the search line", "Focus Search Line"));
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::Key_F6));
- connect(m_listviewsearch, SIGNAL(textChanged(QString)), iproxy, SLOT(setFilterFixedString(QString)));
+ connect(m_listviewsearch, &QLineEdit::textChanged, iproxy, &KeyListProxyModel::setFilterFixedString);
setActionDescriptions(1);
@@ -464,7 +464,7 @@ KeysManager::KeysManager(QWidget *parent)
setAutoSaveSettings(cg, true);
applyMainWindowSettings(cg);
- connect(this, SIGNAL(fontChanged(QFont)), s_kgpgEditor, SLOT(slotSetFont(QFont)));
+ connect(this, &KeysManager::fontChanged, s_kgpgEditor, &KgpgEditor::slotSetFont);
QNetworkConfigurationManager *netmgr = new QNetworkConfigurationManager(this);
connect(netmgr, &QNetworkConfigurationManager::onlineStateChanged, this, &KeysManager::toggleNetworkActions);
@@ -498,7 +498,7 @@ void KeysManager::slotGenerateKey()
kg->caps());
m_genkey = new KGpgTransactionJob(genkey);
- connect(m_genkey, SIGNAL(result(KJob*)), SLOT(slotGenerateKeyDone(KJob*)));
+ connect(m_genkey, &KGpgTransactionJob::result, this, &KeysManager::slotGenerateKeyDone);
KIO::getJobTracker()->registerJob(m_genkey);
m_genkey->start();
@@ -537,7 +537,7 @@ void KeysManager::slotOpenEditor()
{
KgpgEditor *kgpgtxtedit = new KgpgEditor(this, imodel, Qt::Window);
- connect(this, SIGNAL(fontChanged(QFont)), kgpgtxtedit, SLOT(slotSetFont(QFont)));
+ connect(this, &KeysManager::fontChanged, kgpgtxtedit, &KgpgEditor::slotSetFont);
kgpgtxtedit->show();
}
@@ -613,7 +613,7 @@ void KeysManager::slotGenerateKeyDone(KJob *job)
page->show();
mainLayout->addWidget(page);
page->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(page->buttonBox, SIGNAL(accepted()), keyCreated, SLOT(accept()));
+ connect(page->buttonBox, &QDialogButtonBox::accepted, keyCreated.data(), &QDialog::accept);
keyCreated->exec();
if (keyCreated.isNull())
@@ -634,10 +634,10 @@ void KeysManager::slotGenerateKeyDone(KJob *job)
KGpgGenerateRevoke *genRev = new KGpgGenerateRevoke(this, fingerprint, revurl,
0, i18n("backup copy"));
- connect(genRev, SIGNAL(done(int)), SLOT(slotRevokeGenerated(int)));
+ connect(genRev, &KGpgGenerateRevoke::done, this, &KeysManager::slotRevokeGenerated);
if (page->CBprint->isChecked())
- connect(genRev, SIGNAL(revokeCertificate(QString)), SLOT(doPrint(QString)));
+ connect(genRev, &KGpgGenerateRevoke::revokeCertificate, this, &KeysManager::doPrint);
genRev->start();
}
@@ -760,7 +760,7 @@ void KeysManager::refreshKeyFromServer()
proxy = QLatin1String( qgetenv("http_proxy") );
KGpgRefreshKeys *t = new KGpgRefreshKeys(this, KGpgSettings::keyServers().first(), keyIDS, true, proxy);
- connect(t, SIGNAL(done(int)), SLOT(slotKeyRefreshDone(int)));
+ connect(t, &KGpgRefreshKeys::done, this, &KeysManager::slotKeyRefreshDone);
QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
t->start();
}
@@ -796,7 +796,7 @@ void KeysManager::slotDelUid()
KGpgDelUid *deluid = new KGpgDelUid(this, nd);
- connect(deluid, SIGNAL(done(int)), SLOT(slotDelUidDone(int)));
+ connect(deluid, &KGpgDelUid::done, this, &KeysManager::slotDelUidDone);
deluid->start();
}
@@ -815,7 +815,7 @@ void KeysManager::slotPrimUid()
{
KGpgPrimaryUid *puid = new KGpgPrimaryUid(this, iview->selectedNode()->toUidNode());
- connect(puid, SIGNAL(done(int)), SLOT(slotPrimUidDone(int)));
+ connect(puid, &KGpgPrimaryUid::done, this, &KeysManager::slotPrimUidDone);
puid->start();
}
@@ -888,19 +888,19 @@ void KeysManager::slotAddUid()
keyUid->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
keyUid->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(keyUid->buttonBox, SIGNAL(accepted()), addUidWidget, SLOT(accept()));
- connect(keyUid->buttonBox, SIGNAL(rejected()), addUidWidget, SLOT(reject()));
+ connect(keyUid->buttonBox, &QDialogButtonBox::accepted, addUidWidget, &QDialog::accept);
+ connect(keyUid->buttonBox, &QDialogButtonBox::rejected, addUidWidget, &QDialog::reject);
//keyUid->setMinimumSize(keyUid->sizeHint());
keyUid->setMinimumWidth(300);
- connect(keyUid->kLineEdit1, SIGNAL(textChanged(QString)), this, SLOT(slotAddUidEnable(QString)));
+ connect(keyUid->qLineEdit1, &QLineEdit::textChanged, this, &KeysManager::slotAddUidEnable);
if (addUidWidget->exec() != QDialog::Accepted)
return;
- m_adduid = new KGpgAddUid(this, iview->selectedNode()->getId(), keyUid->kLineEdit1->text(),
- keyUid->kLineEdit2->text(), keyUid->kLineEdit3->text());
- connect(m_adduid, SIGNAL(done(int)), SLOT(slotAddUidFin(int)));
+ m_adduid = new KGpgAddUid(this, iview->selectedNode()->getId(), keyUid->qLineEdit1->text(),
+ keyUid->qLineEdit2->text(), keyUid->qLineEdit3->text());
+ connect(m_adduid, &KGpgAddUid::done, this, &KeysManager::slotAddUidFin);
m_adduid->start();
}
@@ -932,7 +932,7 @@ void KeysManager::slotAddPhoto()
return;
KGpgAddPhoto *addphoto = new KGpgAddPhoto(this, iview->selectedNode()->getId(), imagepath);
- connect(addphoto, SIGNAL(done(int)), SLOT(slotAddPhotoFinished(int)));
+ connect(addphoto, &KGpgAddPhoto::done, this, &KeysManager::slotAddPhotoFinished);
addphoto->start();
}
@@ -956,7 +956,7 @@ void KeysManager::slotDeletePhoto()
und->getId(), parent->getName(), parent->getEmail());
KGpgDelUid *deluid = new KGpgDelUid(this, und);
- connect(deluid, SIGNAL(done(int)), SLOT(slotDelPhotoFinished(int)));
+ connect(deluid, &KGpgDelUid::done, this, &KeysManager::slotDelPhotoFinished);
deluid->start();
}
@@ -1006,7 +1006,7 @@ void KeysManager::addToKAB()
Akonadi::ContactSearchJob * const job = new Akonadi::ContactSearchJob();
job->setLimit(1);
job->setQuery(Akonadi::ContactSearchJob::Email, nd->getEmail());
- connect(job, SIGNAL(result(KJob*)), this, SLOT(slotAddressbookSearchResult(KJob*)));
+ connect(job, &Akonadi::ContactSearchJob::result, this, &KeysManager::slotAddressbookSearchResult);
m_addIds[job] = nd;
}
@@ -1037,7 +1037,7 @@ void KeysManager::slotAddressbookSearchResult(KJob *job)
dlg->editor()->setContactTemplate(addressee);
}
- connect(dlg, SIGNAL(finished()), dlg, SLOT(deleteLater()));
+ connect(dlg, &Akonadi::ContactEditorDialog::finished, dlg, &Akonadi::ContactEditorDialog::deleteLater);
dlg->show();
}
@@ -1055,7 +1055,7 @@ void KeysManager::slotTip()
void KeysManager::showKeyServer()
{
QPointer<KeyServer> ks = new KeyServer(this, imodel);
- connect(ks, SIGNAL(importFinished(QStringList)), imodel, SLOT(refreshKeys(QStringList)));
+ connect(ks, &KeyServer::importFinished, imodel, static_cast<void(KGpgItemModel::*)(const QStringList &)>(&KGpgItemModel::refreshKeys));
ks->exec();
delete ks;
@@ -1173,11 +1173,11 @@ void KeysManager::showOptions()
return;
QPointer<kgpgOptions> optionsDialog = new kgpgOptions(this, imodel);
- connect(optionsDialog, SIGNAL(settingsUpdated()), SLOT(readAllOptions()));
- connect(optionsDialog, SIGNAL(homeChanged()), imodel, SLOT(refreshKeys()));
- connect(optionsDialog, SIGNAL(homeChanged()), imodel, SLOT(refreshGroups()));
- connect(optionsDialog, SIGNAL(refreshTrust(KgpgCore::KgpgKeyTrust,QColor)), imodel, SLOT(refreshTrust(KgpgCore::KgpgKeyTrust,QColor)));
- connect(optionsDialog, SIGNAL(changeFont(QFont)), SIGNAL(fontChanged(QFont)));
+ connect(optionsDialog, &kgpgOptions::settingsUpdated, this, &KeysManager::readAllOptions);
+ connect(optionsDialog, &kgpgOptions::homeChanged, imodel, static_cast<void(KGpgItemModel::*)()>(&KGpgItemModel::refreshKeys));
+ connect(optionsDialog.data(), &kgpgOptions::homeChanged, imodel, &KGpgItemModel::refreshGroups);
+ connect(optionsDialog.data(), &kgpgOptions::refreshTrust, imodel, &KGpgItemModel::refreshTrust);
+ connect(optionsDialog, &kgpgOptions::changeFont, this, &KeysManager::fontChanged);
optionsDialog->exec();
delete optionsDialog;
@@ -1318,7 +1318,7 @@ void KeysManager::revokeWidget()
KGpgNode *nd = iview->selectedNode();
QDialog *keyRevokeDialog = new KGpgRevokeDialog(this, nd->toKeyNode());
- connect(keyRevokeDialog, SIGNAL(finished(int)), SLOT(slotRevokeDialogFinished(int)));
+ connect(keyRevokeDialog, &QDialog::finished, this, &KeysManager::slotRevokeDialogFinished);
keyRevokeDialog->open();
}
@@ -1335,12 +1335,12 @@ void KeysManager::slotRevokeDialogFinished(int result)
KGpgGenerateRevoke *genRev = new KGpgGenerateRevoke(this, keyRevokeDialog->getId(), keyRevokeDialog->saveUrl(),
keyRevokeDialog->getReason(), keyRevokeDialog->getDescription());
- connect(genRev, SIGNAL(done(int)), SLOT(slotRevokeGenerated(int)));
+ connect(genRev, &KGpgGenerateRevoke::done, this, &KeysManager::slotRevokeGenerated);
if (keyRevokeDialog->printChecked())
- connect(genRev, SIGNAL(revokeCertificate(QString)), SLOT(doPrint(QString)));
+ connect(genRev, &KGpgGenerateRevoke::revokeCertificate, this, &KeysManager::doPrint);
if (keyRevokeDialog->importChecked())
- connect(genRev, SIGNAL(revokeCertificate(QString)), SLOT(slotImportRevokeTxt(QString)));
+ connect(genRev, &KGpgGenerateRevoke::revokeCertificate, this, &KeysManager::slotImportRevokeTxt);
genRev->start();
}
@@ -1364,7 +1364,7 @@ void KeysManager::slotRevokeGenerated(int result)
void KeysManager::slotImportRevokeTxt(const QString &revokeText)
{
KGpgImport *import = new KGpgImport(this, revokeText);
- connect(import, SIGNAL(done(int)), SLOT(slotImportDone(int)));
+ connect(import, &KGpgImport::done, this, &KeysManager::slotImportDone);
import->start();
}
@@ -1388,7 +1388,7 @@ void KeysManager::slotexportsec()
if(!url.isEmpty()) {
KGpgExport *exp = new KGpgExport(this, QStringList(nd->getId()), url.path(), QStringList(QLatin1String( "--armor" )), true);
- connect(exp, SIGNAL(done(int)), SLOT(slotExportSecFinished(int)));
+ connect(exp, &KGpgExport::done, this, &KeysManager::slotExportSecFinished);
exp->start();
}
@@ -1481,7 +1481,7 @@ void KeysManager::slotexport()
KGpgExport *exp = new KGpgExport(this, klist, expname, expopts);
- connect(exp, SIGNAL(done(int)), SLOT(slotExportFinished(int)));
+ connect(exp, &KGpgExport::done, this, &KeysManager::slotExportFinished);
exp->start();
}
@@ -1489,9 +1489,9 @@ void KeysManager::slotexport()
KGpgExport *exp = new KGpgExport(this, klist, expopts);
if (page->checkClipboard->isChecked())
- connect(exp, SIGNAL(done(int)), SLOT(slotProcessExportClip(int)));
+ connect(exp, &KGpgExport::done, this, &KeysManager::slotProcessExportClip);
else
- connect(exp, SIGNAL(done(int)), SLOT(slotProcessExportMail(int)));
+ connect(exp, &KGpgExport::done, this, &KeysManager::slotProcessExportMail);
exp->start();
}
@@ -1636,8 +1636,8 @@ KeysManager::showProperties(KGpgNode *n)
case ITYPE_PAIR: {
KGpgKeyNode *k = n->toKeyNode();
QPointer<KgpgKeyInfo> opts = new KgpgKeyInfo(k, imodel, this);
- connect(opts, SIGNAL(keyNeedsRefresh(KGpgKeyNode*)), imodel, SLOT(refreshKey(KGpgKeyNode*)));
- connect(opts->keychange, SIGNAL(keyNeedsRefresh(KGpgKeyNode*)), imodel, SLOT(refreshKey(KGpgKeyNode*)));
+ connect(opts, &KgpgKeyInfo::keyNeedsRefresh, imodel, static_cast<void(KGpgItemModel::*)(KGpgKeyNode *)>(&KGpgItemModel::refreshKey));
+ connect(opts->keychange, &KGpgChangeKey::keyNeedsRefresh, imodel, static_cast<void(KGpgItemModel::*)(KGpgKeyNode *)>(&KGpgItemModel::refreshKey));
opts->exec();
delete opts;
}
@@ -1679,7 +1679,7 @@ void KeysManager::keyproperties()
}
QPointer<KgpgKeyInfo> opts = new KgpgKeyInfo(kn, imodel, this);
- connect(opts, SIGNAL(keyNeedsRefresh(KGpgKeyNode*)), imodel, SLOT(refreshKey(KGpgKeyNode*)));
+ connect(opts, &KgpgKeyInfo::keyNeedsRefresh, imodel, static_cast<void(KGpgItemModel::*)(KGpgKeyNode *)>(&KGpgItemModel::refreshKey));
opts->exec();
delete opts;
}
@@ -1778,8 +1778,8 @@ void KeysManager::editGroup()
mainLayout->addWidget(gEdit);
gEdit->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(gEdit->buttonBox, SIGNAL(accepted()), dialogGroupEdit, SLOT(accept()));
- connect(gEdit->buttonBox, SIGNAL(rejected()), dialogGroupEdit, SLOT(reject()));
+ connect(gEdit->buttonBox, &QDialogButtonBox::accepted, dialogGroupEdit.data(), &QDialog::accept);
+ connect(gEdit->buttonBox, &QDialogButtonBox::rejected, dialogGroupEdit.data(), &QDialog::reject);
gEdit->show();
@@ -1970,7 +1970,7 @@ void KeysManager::signLoop(const bool localsign, const int checklevel)
sta = new KGpgSignKey(this, globalkeyID, nd->toKeyNode(), localsign, cc);
}
- connect(sta, SIGNAL(done(int)), SLOT(signatureResult(int)));
+ connect(sta, &KGpgTransaction::done, this, &KeysManager::signatureResult);
sta->start();
}
@@ -2053,8 +2053,8 @@ void KeysManager::caff()
KGpgCaff *ca = new KGpgCaff(this, slist, QStringList(opts->getKeyID()), opts->getSignTrust(), KGpgCaff::IgnoreAlreadySigned);
delete opts;
- connect(ca, SIGNAL(done()), SLOT(slotCaffDone()));
- connect(ca, SIGNAL(aborted()), SLOT(slotCaffDone()));
+ connect(ca, &KGpgCaff::done, this, &KeysManager::slotCaffDone);
+ connect(ca, &KGpgCaff::aborted, this, &KeysManager::slotCaffDone);
ca->run();
}
@@ -2155,7 +2155,7 @@ bool KeysManager::importRemoteKeys(const QStringList &keyIDs, const bool dialog)
return false;
KGpgReceiveKeys *proc = new KGpgReceiveKeys(this, kservers.first(), keyIDs, dialog, QLatin1String( qgetenv("http_proxy") ));
- connect(proc, SIGNAL(done(int)), SLOT(importRemoteFinished(int)));
+ connect(proc, &KGpgReceiveKeys::done, this, &KeysManager::importRemoteFinished);
proc->start();
@@ -2227,7 +2227,7 @@ void KeysManager::delsignkey()
return;
KGpgDelSign *delsig = new KGpgDelSign(this, nd->toSignNode());
- connect(delsig, SIGNAL(done(int)), SLOT(delsignatureResult(int)));
+ connect(delsig, &KGpgDelSign::done, this, &KeysManager::delsignatureResult);
delsig->start();
}
@@ -2287,7 +2287,7 @@ void KeysManager::slotedit()
terminalkey = nd->toKeyNode();
editKey->setEnabled(false);
- connect(kp, SIGNAL(finished(int)), SLOT(slotEditDone(int)));
+ connect(kp, static_cast<void (KProcess::*)(int)>(&KProcess::finished), this, &KeysManager::slotEditDone);
kp->start();
}
@@ -2383,7 +2383,7 @@ void KeysManager::deleteseckey()
removeFromGroups(nd);
m_delkey = new KGpgDelKey(this, nd);
- connect(m_delkey, SIGNAL(done(int)), SLOT(secretKeyDeleted(int)));
+ connect(m_delkey, &KGpgDelKey::done, this, &KeysManager::secretKeyDeleted);
m_delkey->start();
}
@@ -2512,7 +2512,7 @@ void KeysManager::confirmdeletekey()
removeFromGroups(nd->toKeyNode());
m_delkey = new KGpgDelKey(this, delkeys);
- connect(m_delkey, SIGNAL(done(int)), SLOT(slotDelKeyDone(int)));
+ connect(m_delkey, &KGpgDelKey::done, this, &KeysManager::slotDelKeyDone);
m_delkey->start();
}
@@ -2544,8 +2544,8 @@ void KeysManager::slotPreImportKey()
page->newFilename->setMode(KFile::File);
page->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(page->buttonBox, SIGNAL(accepted()), dial, SLOT(accept()));
- connect(page->buttonBox, SIGNAL(rejected()), dial, SLOT(reject()));
+ connect(page->buttonBox, &QDialogButtonBox::accepted, dial.data(), &QDialog::accept);
+ connect(page->buttonBox, &QDialogButtonBox::rejected, dial.data(), &QDialog::reject);
if (dial->exec() == QDialog::Accepted) {
if (page->checkFile->isChecked()) {
@@ -2596,7 +2596,7 @@ void KeysManager::slotImport(const QList<QUrl> &files)
void KeysManager::startImport(KGpgImport *import)
{
changeMessage(i18n("Importing..."), true);
- connect(import, SIGNAL(done(int)), SLOT(slotImportDone(int)));
+ connect(import, &KGpgImport::done, this, &KeysManager::slotImportDone);
import->start();
}
@@ -2748,7 +2748,7 @@ KeysManager::clipEncrypt()
options.append(QLatin1String( "--pgp6" ));
KGpgEncrypt *enc = new KGpgEncrypt(this, dialog->selectedKeys(), cliptext, encOptions, options);
- connect(enc, SIGNAL(done(int)), SLOT(slotSetClip(int)));
+ connect(enc, &KGpgEncrypt::done, this, &KeysManager::slotSetClip);
m_trayicon->setStatus(KStatusNotifierItem::Active);
enc->start();
@@ -2828,7 +2828,7 @@ KeysManager::clipDecrypt()
KgpgEditor *kgpgtxtedit = new KgpgEditor(this, imodel, 0);
kgpgtxtedit->setAttribute(Qt::WA_DeleteOnClose);
- connect(this, SIGNAL(fontChanged(QFont)), kgpgtxtedit, SLOT(slotSetFont(QFont)));
+ connect(this, &KeysManager::fontChanged, kgpgtxtedit, &KgpgEditor::slotSetFont);
kgpgtxtedit->m_editor->setPlainText(cliptext);
kgpgtxtedit->m_editor->slotDecode();
kgpgtxtedit->show();
@@ -2846,7 +2846,7 @@ KeysManager::clipSign()
KgpgEditor *kgpgtxtedit = new KgpgEditor(this, imodel, 0);
kgpgtxtedit->setAttribute(Qt::WA_DeleteOnClose);
- connect(kgpgtxtedit->m_editor, SIGNAL(verifyFinished()), kgpgtxtedit, SLOT(closeWindow()));
+ connect(kgpgtxtedit->m_editor, &KgpgTextEdit::verifyFinished, kgpgtxtedit, &KgpgEditor::closeWindow);
kgpgtxtedit->m_editor->signVerifyText(cliptext);
kgpgtxtedit->show();
diff --git a/kgpg.cpp b/kgpg.cpp
index 11da910..6e63607 100644
--- a/kgpg.cpp
+++ b/kgpg.cpp
@@ -80,9 +80,9 @@ int KGpgApp::newInstance()
w = new KGpgExternalActions(s_keyManager, s_keyManager->getModel());
- connect(s_keyManager, SIGNAL(readAgainOptions()), w, SLOT(readOptions()));
- connect(w, SIGNAL(updateDefault(QString)), SLOT(assistantOver(QString)));
- connect(w, SIGNAL(createNewKey()), s_keyManager, SLOT(slotGenerateKey()));
+ connect(s_keyManager, &KeysManager::readAgainOptions, w, &KGpgExternalActions::readOptions);
+ connect(w, &KGpgExternalActions::updateDefault, this, &KGpgApp::assistantOver);
+ connect(w, &KGpgExternalActions::createNewKey, s_keyManager, &KeysManager::slotGenerateKey);
const QString gpgPath = KGpgSettings::gpgConfigPath();
diff --git a/kgpgchangekey.cpp b/kgpgchangekey.cpp
index 414b271..c2f7080 100644
--- a/kgpgchangekey.cpp
+++ b/kgpgchangekey.cpp
@@ -92,7 +92,7 @@ void KGpgChangeKey::nextStep(int result)
if (m_expiration != m_key.expirationDate()) {
m_current = new KGpgChangeExpire(m_parentWidget, m_key.fingerprint(), m_expiration);
- connect(m_current, SIGNAL(done(int)), SLOT(nextStep(int)));
+ connect(m_current, &KGpgTransaction::done, this, &KGpgChangeKey::nextStep);
m_current->start();
break;
@@ -109,7 +109,7 @@ void KGpgChangeKey::nextStep(int result)
if (m_owtrust != m_key.ownerTrust()) {
m_current = new KGpgChangeTrust(m_parentWidget, m_key.fingerprint(), m_owtrust);
- connect(m_current, SIGNAL(done(int)), SLOT(nextStep(int)));
+ connect(m_current, &KGpgTransaction::done, this, &KGpgChangeKey::nextStep);
m_current->start();
break;
@@ -126,7 +126,7 @@ void KGpgChangeKey::nextStep(int result)
if (m_key.valid() == m_disable) {
m_current = new KGpgChangeDisable(m_parentWidget, m_key.fingerprint(), m_disable);
- connect(m_current, SIGNAL(done(int)), SLOT(nextStep(int)));
+ connect(m_current, &KGpgTransaction::done, this, &KGpgChangeKey::nextStep);
m_current->start();
break;
diff --git a/kgpgexternalactions.cpp b/kgpgexternalactions.cpp
index fbfd90e..f0e7a54 100644
--- a/kgpgexternalactions.cpp
+++ b/kgpgexternalactions.cpp
@@ -70,9 +70,9 @@ void KGpgExternalActions::encryptFiles(KeysManager *parent, const QList<QUrl> &u
KGpgExternalActions *encActions = new KGpgExternalActions(parent, parent->getModel());
KgpgSelectPublicKeyDlg *dialog = new KgpgSelectPublicKeyDlg(parent, parent->getModel(), encActions->goDefaultKey(), false, urls);
- connect(dialog, SIGNAL(accepted()), encActions, SLOT(slotEncryptionKeySelected()));
- connect(dialog, SIGNAL(rejected()), dialog, SLOT(deleteLater()));
- connect(dialog, SIGNAL(rejected()), encActions, SLOT(deleteLater()));
+ connect(dialog, &KgpgSelectPublicKeyDlg::accepted, encActions, &KGpgExternalActions::slotEncryptionKeySelected);
+ connect(dialog, &KgpgSelectPublicKeyDlg::rejected, dialog, &KgpgSelectPublicKeyDlg::deleteLater);
+ connect(dialog, &KgpgSelectPublicKeyDlg::rejected, encActions, &KGpgExternalActions::deleteLater);
dialog->show();
}
@@ -158,10 +158,10 @@ void KGpgExternalActions::encryptFolders(KeysManager *parent, const QList<QUrl>
bGroupHBoxLayout->addWidget(optionbx);
optionbx->setModel(new QStringListModel(FolderCompressJob::archiveNames(), bGroup));
- connect(optionbx, SIGNAL(activated(int)), encActions, SLOT(slotSetCompression(int)));
- connect(dialog, SIGNAL(accepted()), encActions, SLOT(startFolderEncode()));
- connect(dialog, SIGNAL(rejected()), encActions, SLOT(deleteLater()));
- connect(dialog, SIGNAL(rejected()), dialog, SLOT(deleteLater()));
+ connect(optionbx, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), encActions, &KGpgExternalActions::slotSetCompression);
+ connect(dialog, &KgpgSelectPublicKeyDlg::accepted, encActions, &KGpgExternalActions::startFolderEncode);
+ connect(dialog, &KgpgSelectPublicKeyDlg::rejected, encActions, &KGpgExternalActions::deleteLater);
+ connect(dialog, &KgpgSelectPublicKeyDlg::rejected, dialog, &KgpgSelectPublicKeyDlg::deleteLater);
dialog->show();
}
@@ -222,7 +222,7 @@ void KGpgExternalActions::startFolderEncode()
FolderCompressJob *trayinfo = new FolderCompressJob(m_keysmanager, urls, encryptedFile, m_kgpgfoldertmp,
selec, encryptOptions, encOptions, compressionScheme);
- connect(trayinfo, SIGNAL(result(KJob*)), SLOT(slotFolderFinished(KJob*)));
+ connect(trayinfo, &FolderCompressJob::result, this, &KGpgExternalActions::slotFolderFinished);
KIO::getJobTracker()->registerJob(trayinfo);
trayinfo->start();
}
@@ -262,7 +262,7 @@ void KGpgExternalActions::verifyFile(QUrl url)
}
KGpgVerify *kgpv = new KGpgVerify(parent(), QList<QUrl>({QUrl(sigfile)}));
- connect(kgpv, SIGNAL(done(int)), SLOT(slotVerificationDone(int)));
+ connect(kgpv, &KGpgVerify::done, this, &KGpgExternalActions::slotVerificationDone);
kgpv->start();
}
@@ -301,9 +301,9 @@ void KGpgExternalActions::signFiles(KeysManager* parent, const QList<QUrl>& urls
signActions->droppedUrls = urls;
KgpgSelectSecretKey *keydlg = new KgpgSelectSecretKey(parent, parent->getModel(), false);
- connect(keydlg, SIGNAL(accepted()), signActions, SLOT(slotSignFiles()));
- connect(keydlg, SIGNAL(rejected()), keydlg, SLOT(deleteLater()));
- connect(keydlg, SIGNAL(rejected()), signActions, SLOT(deleteLater()));
+ connect(keydlg, &KgpgSelectSecretKey::accepted, signActions, &KGpgExternalActions::slotSignFiles);
+ connect(keydlg, &KgpgSelectSecretKey::rejected, keydlg, &KgpgSelectSecretKey::deleteLater);
+ connect(keydlg, &KgpgSelectSecretKey::rejected, signActions, &KGpgExternalActions::deleteLater);
keydlg->show();
}
@@ -326,11 +326,11 @@ void KGpgExternalActions::slotSignFiles()
if (droppedUrls.count() > 1) {
KGpgTextInterface *signFileProcess = new KGpgTextInterface(parent(), signKeyID, Options);
- connect(signFileProcess, SIGNAL(fileSignFinished()), signFileProcess, SLOT(deleteLater()));
+ connect(signFileProcess, &KGpgTextInterface::fileSignFinished, signFileProcess, &KGpgTextInterface::deleteLater);
signFileProcess->signFiles(droppedUrls);
} else {
KGpgSignText *signt = new KGpgSignText(parent(), signKeyID, droppedUrls, sopts);
- connect(signt, SIGNAL(done(int)), signt, SLOT(deleteLater()));
+ connect(signt, &KGpgSignText::done, signt, &KGpgSignText::deleteLater);
signt->start();
}
@@ -385,7 +385,7 @@ void KGpgExternalActions::decryptFile(QList<QUrl> urls)
droppedUrls = urls;
KGpgDecrypt *decr = new KGpgDecrypt(this, droppedUrls.first(), swapname);
- connect(decr, SIGNAL(done(int)), SLOT(slotDecryptionDone(int)));
+ connect(decr, &KGpgDecrypt::done, this, &KGpgExternalActions::slotDecryptionDone);
decr->start();
}
@@ -420,7 +420,7 @@ void KGpgExternalActions::slotDecryptionDone(int status)
void KGpgExternalActions::showDroppedFile(const QUrl &file)
{
KgpgEditor *kgpgtxtedit = new KgpgEditor(m_keysmanager, m_model, 0);
- connect(m_keysmanager, SIGNAL(fontChanged(QFont)), kgpgtxtedit, SLOT(slotSetFont(QFont)));
+ connect(m_keysmanager, &KeysManager::fontChanged, kgpgtxtedit, &KgpgEditor::slotSetFont);
kgpgtxtedit->m_editor->openDroppedFile(file, false);
@@ -459,9 +459,9 @@ void KGpgExternalActions::startAssistant()
if (m_assistant.isNull()) {
m_assistant = new KGpgFirstAssistant(m_keysmanager);
- connect(m_assistant, SIGNAL(accepted()), SLOT(slotSaveOptionsPath()));
- connect(m_assistant, SIGNAL(rejected()), m_assistant, SLOT(deleteLater()));
- connect(m_assistant, SIGNAL(helpClicked()), SLOT(help()));
+ connect(m_assistant, &KGpgFirstAssistant::accepted, this, &KGpgExternalActions::slotSaveOptionsPath);
+ connect(m_assistant.data(), &KGpgFirstAssistant::rejected, m_assistant.data(), &KGpgFirstAssistant::deleteLater);
+ connect(m_assistant->button(QDialogButtonBox::Help), &QPushButton::clicked, this, &KGpgExternalActions::help);
}
m_assistant->show();
diff --git a/kgpgexternalactions.h b/kgpgexternalactions.h
index 615d02f..9f2f2e8 100644
--- a/kgpgexternalactions.h
+++ b/kgpgexternalactions.h
@@ -59,6 +59,8 @@ public:
* @brief create a new object, encrypt the given files, and destroy the object
*/
static void encryptFiles(KeysManager* parent, const QList<QUrl>& urls);
+
+ void readOptions();
signals:
void createNewKey();
void updateDefault(QString);
@@ -86,7 +88,6 @@ private slots:
void slotSaveOptionsPath();
void slotVerificationDone(int result);
void help();
- void readOptions();
void slotSetCompression(int cp);
void slotDecryptionDone(int status);
void slotFolderFinished(KJob *job);
diff --git a/kgpgfirstassistant.cpp b/kgpgfirstassistant.cpp
index 32fc0f1..0edd3dc 100644
--- a/kgpgfirstassistant.cpp
+++ b/kgpgfirstassistant.cpp
@@ -117,7 +117,7 @@ KGpgFirstAssistant::KGpgFirstAssistant(QWidget *parent)
gpgBin = QLatin1String("gpg");
binURL->setUrl(QUrl::fromLocalFile(gpgBin));
- connect(binURL, SIGNAL(textChanged(QString)), SLOT(slotBinaryChanged(QString)));
+ connect(binURL, &KUrlRequester::textChanged, this, &KGpgFirstAssistant::slotBinaryChanged);
slotBinaryChanged(gpgBin);
gridLayout->addWidget(binURL, 2, 1, 1, 1);
diff --git a/kgpgkeygenerate.cpp b/kgpgkeygenerate.cpp
index 75c6db2..e0ed353 100644
--- a/kgpgkeygenerate.cpp
+++ b/kgpgkeygenerate.cpp
@@ -51,14 +51,14 @@ KgpgKeyGenerate::KgpgKeyGenerate(QWidget *parent)
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
QPushButton *user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &KgpgKeyGenerate::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &KgpgKeyGenerate::reject);
user1Button->setText(i18n("&Expert Mode"));
user1Button->setToolTip(i18n("Go to Expert Mode"));
user1Button->setWhatsThis(i18n( "If you go to expert mode, you will use the command line to create your key." ));
- connect(m_kname, SIGNAL(textChanged(QString)), this, SLOT(slotEnableOk()));
+ connect(m_kname, &QLineEdit::textChanged, this, &KgpgKeyGenerate::slotEnableOk);
QWidget *hgroup = new QWidget(vgroup);
QHBoxLayout *hgroupHBoxLayout = new QHBoxLayout(hgroup);
@@ -78,7 +78,7 @@ KgpgKeyGenerate::KgpgKeyGenerate(QWidget *parent)
m_keyexp->addItem(i18n("Months"), 3);
m_keyexp->addItem(i18n("Years"), 4);
m_keyexp->setMinimumSize(m_keyexp->sizeHint());
- connect(m_keyexp, SIGNAL(activated(int)), this, SLOT(slotEnableDays(int)));
+ connect(m_keyexp, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &KgpgKeyGenerate::slotEnableDays);
qobject_cast<QVBoxLayout *>(vgroup->layout())->insertWidget(7, hgroup);
@@ -106,9 +106,9 @@ KgpgKeyGenerate::KgpgKeyGenerate(QWidget *parent)
updateGeometry();
show();
- connect(okButton, SIGNAL(clicked()), this, SLOT(slotOk()));
- connect(user1Button, SIGNAL(clicked()), this, SLOT(slotUser1()));
- connect(m_keykind, SIGNAL(activated(int)), SLOT(slotEnableCaps(int)));
+ connect(okButton, &QPushButton::clicked, this, &KgpgKeyGenerate::slotOk);
+ connect(user1Button, &QPushButton::clicked, this, &KgpgKeyGenerate::slotUser1);
+ connect(m_keykind, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &KgpgKeyGenerate::slotEnableCaps);
}
void KgpgKeyGenerate::slotOk()
diff --git a/kgpgoptions.cpp b/kgpgoptions.cpp
index 5b32d52..3ad8b9a 100644
--- a/kgpgoptions.cpp
+++ b/kgpgoptions.cpp
@@ -117,15 +117,15 @@ kgpgOptions::kgpgOptions(QWidget *parent, KGpgItemModel *model)
addPage(m_page7, i18n("Misc"), QLatin1String( "preferences-other" ));
// The following widgets are managed manually.
- connect(m_page1->encrypt_to_always, SIGNAL(toggled(bool)), this, SLOT(slotChangeEncryptTo()));
- connect(m_page4->changeHome, SIGNAL(clicked()), this, SLOT(slotChangeHome()));
- connect(m_page6->server_add, SIGNAL(clicked()), this, SLOT(slotAddKeyServer()));
- connect(m_page6->server_del, SIGNAL(clicked()), this, SLOT(slotDelKeyServer()));
- connect(m_page6->server_edit, SIGNAL(clicked()), this, SLOT(slotEditKeyServer()));
- connect(m_page6->server_default, SIGNAL(clicked()), this, SLOT(slotDefaultKeyServer()));
- connect(m_page6->ServerBox->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(slotChangeKeyServerButtonEnable()));
- connect(m_page6->ServerBox, SIGNAL(doubleClicked(QModelIndex)), SLOT(slotEditKeyServer(QModelIndex)));
- connect(m_page7->kcfg_ShowSystray, SIGNAL(clicked()), SLOT(slotSystrayEnable()));
+ connect(m_page1->encrypt_to_always, &QCheckBox::toggled, this, &kgpgOptions::slotChangeEncryptTo);
+ connect(m_page4->changeHome, &QPushButton::clicked, this, &kgpgOptions::slotChangeHome);
+ connect(m_page6->server_add, &QPushButton::clicked, this, &kgpgOptions::slotAddKeyServer);
+ connect(m_page6->server_del, &QPushButton::clicked, this, &kgpgOptions::slotDelKeyServer);
+ connect(m_page6->server_edit, &QPushButton::clicked, this, static_cast<void(kgpgOptions::*)()>(&kgpgOptions::slotEditKeyServer));
+ connect(m_page6->server_default, &QPushButton::clicked, this, &kgpgOptions::slotDefaultKeyServer);
+ connect(m_page6->ServerBox->selectionModel(), &QItemSelectionModel::selectionChanged, this, &kgpgOptions::slotChangeKeyServerButtonEnable);
+ connect(m_page6->ServerBox, &QListView::doubleClicked, this, static_cast<void(kgpgOptions::*)(const QModelIndex &)>(&kgpgOptions::slotEditKeyServer));
+ connect(m_page7->kcfg_ShowSystray, &QPushButton::clicked, this, &kgpgOptions::slotSystrayEnable);
keyUltimate = KGpgSettings::colorUltimate();
keyGood = KGpgSettings::colorGood();
diff --git a/kgpgoptions.h b/kgpgoptions.h
index 25e2112..10cc324 100644
--- a/kgpgoptions.h
+++ b/kgpgoptions.h
@@ -107,7 +107,7 @@ signals:
private slots:
void slotChangeHome();
void slotAddKeyServer();
- void slotChangeEncryptTo();
+ void slotChangeEncryptTo();
void slotDelKeyServer();
void slotEditKeyServer();
void slotEditKeyServer(const QModelIndex &index);
diff --git a/kgpgrevokewidget.cpp b/kgpgrevokewidget.cpp
index 4e1d86c..3266fb1 100644
--- a/kgpgrevokewidget.cpp
+++ b/kgpgrevokewidget.cpp
@@ -30,7 +30,7 @@ KgpgRevokeWidget::KgpgRevokeWidget(QWidget* parent)
Ui_KgpgRevokeWidget()
{
setupUi(this);
- connect(cbSave, SIGNAL(toggled(bool)), SLOT(cbSave_toggled(bool)));
+ connect(cbSave, &QCheckBox::toggled, this, &KgpgRevokeWidget::cbSave_toggled);
}
void KgpgRevokeWidget::cbSave_toggled(bool isOn)
@@ -52,8 +52,8 @@ KGpgRevokeDialog::KGpgRevokeDialog(QWidget* parent, const KGpgKeyNode *node)
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &KGpgRevokeDialog::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &KGpgRevokeDialog::reject);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
setModal(true);
diff --git a/kgpgtextinterface.cpp b/kgpgtextinterface.cpp
index e1e5151..c26fcf5 100644
--- a/kgpgtextinterface.cpp
+++ b/kgpgtextinterface.cpp
@@ -67,7 +67,7 @@ KGpgTextInterface::KGpgTextInterface(QObject *parent, const QString &keyID, cons
: QObject(parent),
d(new KGpgTextInterfacePrivate(parent, keyID, options))
{
- connect(d->m_process, SIGNAL(processExited()), SLOT(slotSignFile()));
+ connect(d->m_process, &GPGProc::processExited, this, &KGpgTextInterface::slotSignFile);
}
KGpgTextInterface::~KGpgTextInterface()
@@ -91,8 +91,8 @@ KGpgTextInterface::slotSignFile()
const QString fileName = d->m_files.takeFirst().path();
if (d->m_files.isEmpty()) {
- disconnect(d->m_process, SIGNAL(processExited()), this, SLOT(slotSignFile()));
- connect(d->m_process, SIGNAL(processExited()), SLOT(slotSignFinished()));
+ disconnect(d->m_process, &GPGProc::processExited, this, &KGpgTextInterface::slotSignFile);
+ connect(d->m_process, &GPGProc::processExited, this, &KGpgTextInterface::slotSignFinished);
}
d->signFile(fileName);
diff --git a/klinebufferedprocess.cpp b/klinebufferedprocess.cpp
index 2c0b627..159cbc4 100644
--- a/klinebufferedprocess.cpp
+++ b/klinebufferedprocess.cpp
@@ -17,8 +17,8 @@ KLineBufferedProcess::KLineBufferedProcess(QObject *parent)
: KProcess(parent),
d(new KLineBufferedProcessPrivate(this))
{
- connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(_k_receivedStdout()));
- connect(this, SIGNAL(readyReadStandardError()), this, SLOT(_k_receivedStderr()));
+ connect(this, &KLineBufferedProcess::readyReadStandardOutput, d, &KLineBufferedProcessPrivate::_k_receivedStdout);
+ connect(this, &KLineBufferedProcess::readyReadStandardError, d, &KLineBufferedProcessPrivate::_k_receivedStderr);
}
KLineBufferedProcess::~KLineBufferedProcess()
@@ -65,5 +65,3 @@ bool KLineBufferedProcess::hasLineStandardError() const
{
return d->m_newlineInStderr >= 0;
}
-
-#include "klinebufferedprocess.moc"
diff --git a/klinebufferedprocess.h b/klinebufferedprocess.h
index 2750d1f..665f254 100644
--- a/klinebufferedprocess.h
+++ b/klinebufferedprocess.h
@@ -33,7 +33,7 @@ class QByteArray;
* something like this:
*
* \code
- * connect(m_linebufprocess, SIGNAL(lineReadyStandardOutput()), SLOT(dataStdout()));
+ * connect(m_linebufprocess, &KLineBufferedProcess::lineReadyStandardOutput, this, &Class::dataStdout);
* ...
* void myobj::dataStdout()
* {
@@ -132,9 +132,6 @@ signals:
private:
KLineBufferedProcessPrivate* const d;
-
- Q_PRIVATE_SLOT(d, void _k_receivedStdout())
- Q_PRIVATE_SLOT(d, void _k_receivedStderr())
};
#endif // KLINEBUFFEREDPROCESS_H
diff --git a/klinebufferedprocessprivate.h b/klinebufferedprocessprivate.h
index 02bcbd6..22e2283 100644
--- a/klinebufferedprocessprivate.h
+++ b/klinebufferedprocessprivate.h
@@ -16,12 +16,11 @@
class KLineBufferedProcess;
-class KLineBufferedProcessPrivate
+class KLineBufferedProcessPrivate : public QObject
{
public:
KLineBufferedProcessPrivate(KLineBufferedProcess *parent);
-//private slot implementations
void _k_receivedStdout();
void _k_receivedStderr();
diff --git a/model/gpgservermodel.cpp b/model/gpgservermodel.cpp
index 3a136f3..28ae7e1 100644
--- a/model/gpgservermodel.cpp
+++ b/model/gpgservermodel.cpp
@@ -26,7 +26,7 @@ GpgServerModel::GpgServerModel(QObject *parent)
: QStringListModel(parent),
m_defaultRow(-1)
{
- connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), SLOT(slotRowsRemoved(QModelIndex,int,int)));
+ connect(this, &GpgServerModel::rowsRemoved, this, &GpgServerModel::slotRowsRemoved);
}
GpgServerModel::~GpgServerModel()
diff --git a/model/kgpgitemmodel.cpp b/model/kgpgitemmodel.cpp
index 3d531ec..159d955 100644
--- a/model/kgpgitemmodel.cpp
+++ b/model/kgpgitemmodel.cpp
@@ -441,6 +441,12 @@ KGpgItemModel::refreshKeys(KGpgKeyNode::List keys)
}
void
+KGpgItemModel::refreshKeys()
+{
+ refreshKeyIds(QStringList());
+}
+
+void
KGpgItemModel::refreshKeys(const QStringList &ids)
{
refreshKeyIds(ids);
diff --git a/model/kgpgitemmodel.h b/model/kgpgitemmodel.h
index f53dfeb..df5b2d1 100644
--- a/model/kgpgitemmodel.h
+++ b/model/kgpgitemmodel.h
@@ -83,7 +83,8 @@ public Q_SLOTS:
QModelIndex nodeIndex(KGpgNode *node, const int column = 0);
void refreshKey(const QString &id);
void refreshKey(KGpgKeyNode *nd);
- void refreshKeys(const QStringList &ids = QStringList());
+ void refreshKeys();
+ void refreshKeys(const QStringList &ids);
void refreshKeys(KGpgKeyNode::List keys);
void refreshGroups();
void invalidateIndexes(KGpgNode *nd);
diff --git a/newkey.cpp b/newkey.cpp
index a322cd7..2b00720 100644
--- a/newkey.cpp
+++ b/newkey.cpp
@@ -21,7 +21,7 @@ newKey::newKey(QWidget* parent)
: QWidget(parent), Ui_newKey()
{
setupUi(this);
- connect(CBsave, SIGNAL(toggled(bool)), this, SLOT(CBsave_toggled(bool)));
+ connect(CBsave, &QCheckBox::toggled, this, &newKey::CBsave_toggled);
}
void newKey::CBsave_toggled(bool isOn)
diff --git a/searchres.ui b/searchres.ui
index 345fb66..f1e2600 100644
--- a/searchres.ui
+++ b/searchres.ui
@@ -68,7 +68,7 @@
</widget>
</item>
<item>
- <widget class="QLineEdit" name="kLEID">
+ <widget class="QLineEdit" name="qLEID">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
@@ -87,7 +87,7 @@
</widget>
<tabstops>
<tabstop>kLVsearch</tabstop>
- <tabstop>kLEID</tabstop>
+ <tabstop>qLEID</tabstop>
</tabstops>
<resources/>
<connections/>
diff --git a/selectexpirydate.cpp b/selectexpirydate.cpp
index 7ae6f0c..74da76b 100644
--- a/selectexpirydate.cpp
+++ b/selectexpirydate.cpp
@@ -37,8 +37,8 @@ SelectExpiryDate::SelectExpiryDate(QWidget* parent, QDateTime date)
okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &SelectExpiryDate::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &SelectExpiryDate::reject);
okButton->setDefault(true);
QWidget *page = new QWidget(this);
@@ -59,9 +59,9 @@ SelectExpiryDate::SelectExpiryDate(QWidget* parent, QDateTime date)
layout->addWidget(m_datepicker);
layout->addWidget(m_unlimited);
- connect(m_unlimited, SIGNAL(toggled(bool)), this, SLOT(slotEnableDate(bool)));
- connect(m_datepicker, SIGNAL(dateChanged(QDate)), this, SLOT(slotCheckDate(QDate)));
- connect(m_datepicker, SIGNAL(dateEntered(QDate)), this, SLOT(slotCheckDate(QDate)));
+ connect(m_unlimited, &QCheckBox::toggled, this, &SelectExpiryDate::slotEnableDate);
+ connect(m_datepicker, &KDatePicker::dateChanged, this, &SelectExpiryDate::slotCheckDate);
+ connect(m_datepicker, &KDatePicker::dateEntered, this, &SelectExpiryDate::slotCheckDate);
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
diff --git a/selectpublickeydialog.cpp b/selectpublickeydialog.cpp
index efc632a..09e3c95 100644
--- a/selectpublickeydialog.cpp
+++ b/selectpublickeydialog.cpp
@@ -60,8 +60,8 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
m_detailsButton->setIcon(QIcon::fromTheme(QStringLiteral("help-about")).pixmap(IconSize(KIconLoader::Toolbar)));
connect(m_detailsButton, &QPushButton::clicked, this, &KgpgSelectPublicKeyDlg::toggleDetails);
buttonBox->addButton(m_detailsButton, QDialogButtonBox::ActionRole);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &KgpgSelectPublicKeyDlg::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &KgpgSelectPublicKeyDlg::reject);
m_okButton->setDefault(true);
int fcount = files.count();
@@ -101,7 +101,7 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
m_keyslist->setModel(iproxy);
m_keyslist->resizeColumnsToContents();
m_keyslist->setWhatsThis(i18n("<b>Public keys list</b>: select the key that will be used for encryption."));
- connect(m_searchlineedit, SIGNAL(textChanged(QString)), iproxy, SLOT(setFilterFixedString(QString)));
+ connect(m_searchlineedit, &QLineEdit::textChanged, iproxy, &SelectKeyProxyModel::setFilterFixedString);
optionsbox = new QWidget();
QVBoxLayout *optionsboxVBoxLayout = new QVBoxLayout(optionsbox);
@@ -127,7 +127,7 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
m_cbhideid = new QCheckBox(i18n("Hide user id"), optionsbox);
optionsboxVBoxLayout->addWidget(m_cbhideid);
- connect(m_cbuntrusted, SIGNAL(toggled(bool)), this, SLOT(slotUntrusted(bool)));
+ connect(m_cbuntrusted, &QCheckBox::toggled, this, &KgpgSelectPublicKeyDlg::slotUntrusted);
m_cbhideid->setChecked(KGpgSettings::hideUserID());
m_cbhideid->setWhatsThis(i18n("<b>Hide user ID</b>: Do not put the keyid into encrypted packets. This option hides the receiver "
"of the message and is a countermeasure against traffic analysis. It may slow down the decryption process because "
@@ -164,10 +164,10 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
action->setText(i18n("&Go to Default Key"));
actcol->setDefaultShortcut(action, goDefaultKey);
- connect(action, SIGNAL(triggered(bool)), SLOT(slotGotoDefaultKey()));
- connect(m_cbsymmetric, SIGNAL(toggled(bool)), this, SLOT(slotSymmetric(bool)));
- connect(m_keyslist->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSelectionChanged()));
- connect(m_keyslist, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotOk()));
+ connect(action, &QAction::triggered, this, &KgpgSelectPublicKeyDlg::slotGotoDefaultKey);
+ connect(m_cbsymmetric, &QCheckBox::toggled, this, &KgpgSelectPublicKeyDlg::slotSymmetric);
+ connect(m_keyslist->selectionModel(), &QItemSelectionModel::selectionChanged, this, &KgpgSelectPublicKeyDlg::slotSelectionChanged);
+ connect(m_keyslist, &QTableView::doubleClicked, this, &KgpgSelectPublicKeyDlg::slotOk);
setMinimumSize(550, 200);
updateGeometry();
diff --git a/selectsecretkey.cpp b/selectsecretkey.cpp
index 290045b..1183735 100644
--- a/selectsecretkey.cpp
+++ b/selectsecretkey.cpp
@@ -44,8 +44,8 @@ KgpgSelectSecretKey::KgpgSelectSecretKey(QWidget *parent, KGpgItemModel *model,
m_okButton = buttonBox->button(QDialogButtonBox::Ok);
m_okButton->setDefault(true);
m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &KgpgSelectSecretKey::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &KgpgSelectSecretKey::reject);
m_okButton->setDefault(true);
QWidget *page = new QWidget(this);
@@ -100,8 +100,8 @@ KgpgSelectSecretKey::KgpgSelectSecretKey(QWidget *parent, KGpgItemModel *model,
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
- connect(m_keyslist->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSelectionChanged()));
- connect(m_keyslist, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotOk()));
+ connect(m_keyslist->selectionModel(), &QItemSelectionModel::selectionChanged, this, &KgpgSelectSecretKey::slotSelectionChanged);
+ connect(m_keyslist, &QTableView::doubleClicked, this, &KgpgSelectSecretKey::slotOk);
}
KgpgSelectSecretKey::~KgpgSelectSecretKey()
diff --git a/selectsecretkey.h b/selectsecretkey.h
index 3e3217e..297966d 100644
--- a/selectsecretkey.h
+++ b/selectsecretkey.h
@@ -11,6 +11,7 @@
#define KGPGSELECTSECRETKEY_H
#include <QDialog>
+#include <QItemSelection>
class QCheckBox;
class QComboBox;
@@ -54,11 +55,10 @@ public:
*/
bool isTerminalSign() const;
-private slots:
+private:
void slotOk();
void slotSelectionChanged();
-private:
QCheckBox *m_localsign;
QCheckBox *m_terminalsign;
diff --git a/sourceselect.cpp b/sourceselect.cpp
index 90c3d7f..1c07cc7 100644
--- a/sourceselect.cpp
+++ b/sourceselect.cpp
@@ -21,8 +21,8 @@ SrcSelect::SrcSelect(QWidget *parent)
: QWidget(parent)
{
setupUi(this);
- connect(checkFile, SIGNAL(toggled(bool)), this, SLOT(checkFile_toggled(bool)));
- connect(checkServer, SIGNAL(toggled(bool)), this, SLOT(checkServer_toggled(bool)));
+ connect(checkFile, &QRadioButton::toggled, this, &SrcSelect::checkFile_toggled);
+ connect(checkServer, &QRadioButton::toggled, this, &SrcSelect::checkServer_toggled);
}
void SrcSelect::checkFile_toggled(bool isOn)
diff --git a/transactions/kgpgkeyservertransaction.cpp b/transactions/kgpgkeyservertransaction.cpp
index 0723f84..1b3e3c3 100644
--- a/transactions/kgpgkeyservertransaction.cpp
+++ b/transactions/kgpgkeyservertransaction.cpp
@@ -100,6 +100,6 @@ KGpgKeyserverTransaction::setProgressEnable(const bool b)
m_progress->setModal(true);
m_progress->setRange(0, 0);
- connect(m_progress, SIGNAL(canceled()), SLOT(slotAbort()));
+ connect(m_progress, &QProgressDialog::canceled, this, &KGpgKeyserverTransaction::slotAbort);
}
}
diff --git a/transactions/kgpgtransaction.cpp b/transactions/kgpgtransaction.cpp
index b34db94..02883ba 100644
--- a/transactions/kgpgtransaction.cpp
+++ b/transactions/kgpgtransaction.cpp
@@ -17,16 +17,12 @@
#include "kgpginterface.h"
#include <QByteArray>
-#include <QDialog>
-#include <QPointer>
#include <QStringList>
#include <QUrl>
-#include <QWeakPointer>
#include <QWidget>
#include <KConfigGroup>
#include <KDebug>
-#include <KIO/RenameDialog>
#include <KNewPasswordDialog>
#include <KLocalizedString>
#include <KPasswordDialog>
@@ -35,9 +31,6 @@ KGpgTransaction::KGpgTransaction(QObject *parent, const bool allowChaining)
: QObject(parent),
d(new KGpgTransactionPrivate(this, allowChaining))
{
- connect(d->m_process, SIGNAL(readReady()), SLOT(slotReadReady()));
- connect(d->m_process, SIGNAL(processExited()), SLOT(slotProcessExited()));
- connect(d->m_process, SIGNAL(started()), SLOT(slotProcessStarted()));
}
KGpgTransaction::~KGpgTransaction()
@@ -46,263 +39,6 @@ KGpgTransaction::~KGpgTransaction()
}
void
-KGpgTransactionPrivate::slotReadReady()
-{
- QString line;
- QWeakPointer<GPGProc> process(m_process);
- QWeakPointer<KGpgTransaction> par(m_parent);
-
- while (!process.isNull() && (m_process->readln(line, true) >= 0)) {
- if (m_quitTries)
- m_quitLines << line;
-#ifdef KGPG_DEBUG_TRANSACTIONS
- kDebug(2100) << m_parent << line;
-#endif /* KGPG_DEBUG_TRANSACTIONS */
-
- static const QString getBool = QLatin1String("[GNUPG:] GET_BOOL ");
-
- if (line.startsWith(QLatin1String("[GNUPG:] USERID_HINT "))) {
- m_parent->addIdHint(line);
- } else if (line.startsWith(QLatin1String("[GNUPG:] BAD_PASSPHRASE "))) {
- // the MISSING_PASSPHRASE line comes first, in that case ignore a
- // following BAD_PASSPHRASE
- if (m_success != KGpgTransaction::TS_USER_ABORTED)
- m_success = KGpgTransaction::TS_BAD_PASSPHRASE;
- } else if (line.startsWith(QLatin1String("[GNUPG:] GET_HIDDEN passphrase.enter"))) {
- const bool goOn = m_parent->passphraseRequested();
-
- // Check if the object was deleted while waiting for the result
- if (!goOn || par.isNull())
- return;
-
- } else if (line.startsWith(QLatin1String("[GNUPG:] GOOD_PASSPHRASE"))) {
- emit m_parent->statusMessage(i18n("Got Passphrase"));
-
- if (m_passwordDialog != Q_NULLPTR) {
- m_passwordDialog->close();
- m_passwordDialog->deleteLater();
- m_passwordDialog = Q_NULLPTR;
- }
-
- if (m_parent->passphraseReceived()) {
- // signal GnuPG that there will be no further input and it can
- // begin sending output.
- m_process->closeWriteChannel();
- }
-
- } else if (line.startsWith(getBool)) {
- static const QString overwrite = QLatin1String("openfile.overwrite.okay");
- const QString question = line.mid(getBool.length());
-
- KGpgTransaction::ts_boolanswer answer;
-
- if (question.startsWith(overwrite)) {
- m_overwriteUrl.clear();
- answer = m_parent->confirmOverwrite(m_overwriteUrl);
-
- if ((answer == KGpgTransaction::BA_UNKNOWN) && !m_overwriteUrl.isEmpty()) {
- QPointer<KIO::RenameDialog> over = new KIO::RenameDialog(qobject_cast<QWidget *>(m_parent->parent()),
- i18n("File Already Exists"), QUrl(),
- m_overwriteUrl, KIO::RenameDialog_Overwrite);
-
- m_overwriteUrl.clear();
-
- switch (over->exec()) {
- case KIO::R_OVERWRITE:
- answer = KGpgTransaction::BA_YES;
- break;
- case KIO::R_RENAME:
- answer = KGpgTransaction::BA_NO;
- m_overwriteUrl = over->newDestUrl();
- break;
- default:
- answer = KGpgTransaction::BA_UNKNOWN;
- m_parent->setSuccess(KGpgTransaction::TS_USER_ABORTED);
- // Close the pipes, otherwise GnuPG will try to answer
- // further questions about this file.
- m_process->closeWriteChannel();
- m_process->closeReadChannel(QProcess::StandardOutput);
- break;
- }
-
- delete over;
-
- if (answer == KGpgTransaction::BA_UNKNOWN)
- continue;
- }
- } else {
- answer = m_parent->boolQuestion(question);
- }
-
- switch (answer) {
- case KGpgTransaction::BA_YES:
- write("YES\n");
- break;
- case KGpgTransaction::BA_NO:
- write("NO\n");
- break;
- case KGpgTransaction::BA_UNKNOWN:
- m_parent->setSuccess(KGpgTransaction::TS_MSG_SEQUENCE);
- m_parent->unexpectedLine(line);
- sendQuit();
- }
- } else if (!m_overwriteUrl.isEmpty() && line.startsWith(QLatin1String("[GNUPG:] GET_LINE openfile.askoutname"))) {
- write(m_overwriteUrl.toLocalFile().toUtf8() + '\n');
- m_overwriteUrl.clear();
- } else if (line.startsWith(QLatin1String("[GNUPG:] MISSING_PASSPHRASE"))) {
- m_success = KGpgTransaction::TS_USER_ABORTED;
- } else if (line.startsWith(QLatin1String("[GNUPG:] CARDCTRL "))) {
- // just ignore them, pinentry should handle that
- } else {
- // all known hints
- int i = 0;
- bool matched = false;
- foreach (const QString &hintName, hintNames()) {
- const KGpgTransaction::ts_hintType h = static_cast<KGpgTransaction::ts_hintType>(i++);
- if (!line.startsWith(hintName))
- continue;
-
- matched = true;
-
- bool r;
- const int skip = hintName.length();
- if (line.length() == skip) {
- r = m_parent->hintLine(h, QString());
- } else {
- r = m_parent->hintLine(h, line.mid(skip + 1).trimmed());
- }
-
- if (!r) {
- m_parent->setSuccess(KGpgTransaction::TS_MSG_SEQUENCE);
- sendQuit();
- }
-
- break;
- }
-
- if (!matched) {
- if (m_parent->nextLine(line))
- sendQuit();
- }
- }
- }
-}
-
-void
-KGpgTransactionPrivate::slotProcessExited()
-{
- Q_ASSERT(m_parent->sender() == m_process);
- m_ownProcessFinished = true;
-
- if (m_inputProcessDone)
- processDone();
-}
-
-void
-KGpgTransactionPrivate::slotProcessStarted()
-{
- m_parent->postStart();
-}
-
-void
-KGpgTransactionPrivate::sendQuit(void)
-{
- write("quit\n");
-
-#ifdef KGPG_DEBUG_TRANSACTIONS
- if (m_quitTries == 0)
- kDebug(2100) << "sending quit";
-#endif /* KGPG_DEBUG_TRANSACTIONS */
-
- if (m_quitTries++ >= 3) {
- kDebug(2100) << "tried" << m_quitTries << "times to quit the GnuPG session";
- kDebug(2100) << "last input was" << m_quitLines;
- kDebug(2100) << "please file a bug report at https://bugs.kde.org";
- m_process->closeWriteChannel();
- m_success = KGpgTransaction::TS_MSG_SEQUENCE;
- }
-}
-
-void
-KGpgTransactionPrivate::slotInputTransactionDone(int result)
-{
- Q_ASSERT(m_parent->sender() == m_inputTransaction);
-
- m_inputProcessDone = true;
- m_inputProcessResult = result;
-
- if (m_ownProcessFinished)
- processDone();
-}
-
-void
-KGpgTransactionPrivate::slotPassphraseEntered(const QString &passphrase)
-{
- // not calling KGpgTransactionPrivate::write() here for obvious privacy reasons
- m_process->write(passphrase.toUtf8() + '\n');
- if (m_parent->sender() == m_newPasswordDialog) {
- m_newPasswordDialog->deleteLater();
- m_newPasswordDialog = Q_NULLPTR;
- m_parent->newPassphraseEntered();
- } else {
- Q_ASSERT(m_parent->sender() == m_passwordDialog);
- }
-}
-
-void
-KGpgTransactionPrivate::slotPassphraseAborted()
-{
- Q_ASSERT((m_parent->sender() == m_passwordDialog) ^ (m_parent->sender() == m_newPasswordDialog));
- m_parent->sender()->deleteLater();
- m_newPasswordDialog = Q_NULLPTR;
- m_passwordDialog = Q_NULLPTR;
- handlePassphraseAborted();
-}
-
-void
-KGpgTransactionPrivate::handlePassphraseAborted()
-{
- // sending "quit" here is useless as it would be interpreted as the passphrase
- m_process->closeWriteChannel();
- m_success = KGpgTransaction::TS_USER_ABORTED;
-}
-
-void
-KGpgTransactionPrivate::write(const QByteArray &a)
-{
- m_process->write(a);
-#ifdef KGPG_DEBUG_TRANSACTIONS
- kDebug(2100) << m_parent << a;
-#endif /* KGPG_DEBUG_TRANSACTIONS */
-}
-
-const QStringList &
-KGpgTransactionPrivate::hintNames (void)
-{
- static QStringList hints;
-
- if (hints.isEmpty()) {
- hints.insert(KGpgTransaction::HT_KEYEXPIRED, QLatin1String("[GNUPG:] KEYEXPIRED"));
- hints.insert(KGpgTransaction::HT_SIGEXPIRED, QLatin1String("[GNUPG:] SIGEXPIRED"));
- hints.insert(KGpgTransaction::HT_NOSECKEY, QLatin1String("[GNUPG:] NO_SECKEY"));
- hints.insert(KGpgTransaction::HT_ENCTO, QLatin1String("[GNUPG:] ENC_TO"));
- }
-
- return hints;
-}
-
-void
-KGpgTransactionPrivate::processDone()
-{
- m_parent->finish();
- emit m_parent->infoProgress(100, 100);
- emit m_parent->done(m_success);
-#ifdef KGPG_DEBUG_TRANSACTIONS
- kDebug(2100) << this << "result:" << m_success;
-#endif /* KGPG_DEBUG_TRANSACTIONS */
-}
-
-void
KGpgTransaction::start()
{
d->m_inputProcessResult = false;
@@ -348,9 +84,9 @@ KGpgTransaction::askNewPassphrase(const QString& text)
d->m_newPasswordDialog = new KNewPasswordDialog(qobject_cast<QWidget *>(parent()));
d->m_newPasswordDialog->setPrompt(text);
d->m_newPasswordDialog->setAllowEmptyPasswords(false);
- connect(d->m_newPasswordDialog, SIGNAL(newPassword(QString)), SLOT(slotPassphraseEntered(QString)));
- connect(d->m_newPasswordDialog, SIGNAL(rejected()), SLOT(slotPassphraseAborted()));
- connect(d->m_process, SIGNAL(processExited()), d->m_newPasswordDialog, SLOT(rejected()));
+ connect(d->m_newPasswordDialog, &KNewPasswordDialog::newPassword, d, &KGpgTransactionPrivate::slotPassphraseEntered);
+ connect(d->m_newPasswordDialog, &KNewPasswordDialog::rejected, d, &KGpgTransactionPrivate::slotPassphraseAborted);
+ connect(d->m_process, &GPGProc::processExited, d->m_newPasswordDialog, &KNewPasswordDialog::rejected);
d->m_newPasswordDialog->show();
}
@@ -558,9 +294,9 @@ KGpgTransaction::askPassphrase(const QString &message)
d->m_passwordDialog->setPrompt(passdlgmessage);
- connect(d->m_passwordDialog, SIGNAL(gotPassword(QString,bool)), SLOT(slotPassphraseEntered(QString)));
- connect(d->m_passwordDialog, SIGNAL(rejected()), SLOT(slotPassphraseAborted()));
- connect(d->m_process, SIGNAL(processExited()), d->m_passwordDialog, SLOT(rejected()));
+ connect(d->m_passwordDialog, &KPasswordDialog::gotPassword, d, &KGpgTransactionPrivate::slotPassphraseEntered);
+ connect(d->m_passwordDialog, &KPasswordDialog::rejected, d, &KGpgTransactionPrivate::slotPassphraseAborted);
+ connect(d->m_process, &GPGProc::processExited, d->m_passwordDialog, &KPasswordDialog::rejected);
} else {
// we already have a dialog, so this is a "bad passphrase" situation
--d->m_tries;
@@ -632,13 +368,13 @@ KGpgTransaction::setInputTransaction(KGpgTransaction *ta)
GPGProc *proc = ta->getProcess();
proc->setStandardOutputProcess(d->m_process);
- connect(ta, SIGNAL(done(int)), SLOT(slotInputTransactionDone(int)));
+ connect(ta, &KGpgTransaction::done, d, &KGpgTransactionPrivate::slotInputTransactionDone);
}
void
KGpgTransaction::clearInputTransaction()
{
- disconnect(d->m_inputTransaction, SIGNAL(done(int)), this, SLOT(slotInputTransactionDone(int)));
+ disconnect(d->m_inputTransaction, &KGpgTransaction::done, d, &KGpgTransactionPrivate::slotInputTransactionDone);
d->m_inputTransaction = Q_NULLPTR;
}
@@ -658,5 +394,3 @@ void
KGpgTransaction::newPassphraseEntered()
{
}
-
-#include "kgpgtransaction.moc"
diff --git a/transactions/kgpgtransaction.h b/transactions/kgpgtransaction.h
index 6e6c8e9..2dabf8e 100644
--- a/transactions/kgpgtransaction.h
+++ b/transactions/kgpgtransaction.h
@@ -129,7 +129,6 @@ public:
/**
* @brief connect the standard input of this transaction to another process
- * @param proc process to read data from
*
* Once the input process is connected this transaction will not emit
* the done signal until the input process sends the done signal.
@@ -317,13 +316,6 @@ protected:
private:
KGpgTransactionPrivate* const d;
- Q_PRIVATE_SLOT(d, void slotReadReady())
- Q_PRIVATE_SLOT(d, void slotProcessExited())
- Q_PRIVATE_SLOT(d, void slotProcessStarted())
- Q_PRIVATE_SLOT(d, void slotInputTransactionDone(int))
- Q_PRIVATE_SLOT(d, void slotPassphraseEntered(const QString &))
- Q_PRIVATE_SLOT(d, void slotPassphraseAborted())
-
protected:
/**
* @brief Ask user for passphrase and send it to gpg process.
diff --git a/transactions/kgpgtransactionjob.cpp b/transactions/kgpgtransactionjob.cpp
index 9ca2dec..caef3f5 100644
--- a/transactions/kgpgtransactionjob.cpp
+++ b/transactions/kgpgtransactionjob.cpp
@@ -33,9 +33,9 @@ KGpgTransactionJob::~KGpgTransactionJob()
void
KGpgTransactionJob::start()
{
- connect(m_transaction, SIGNAL(done(int)), SLOT(slotTransactionDone(int)));
- connect(m_transaction, SIGNAL(statusMessage(QString)), SLOT(slotStatusMessage(QString)));
- connect(m_transaction, SIGNAL(infoProgress(qulonglong,qulonglong)), SLOT(slotInfoProgress(qulonglong,qulonglong)));
+ connect(m_transaction, &KGpgTransaction::done, this, &KGpgTransactionJob::slotTransactionDone);
+ connect(m_transaction, &KGpgTransaction::statusMessage, this, &KGpgTransactionJob::slotStatusMessage);
+ connect(m_transaction, &KGpgTransaction::infoProgress, this, &KGpgTransactionJob::slotInfoProgress);
slotStatusMessage(i18nc("Job is started up", "Startup"));
m_transaction->start();
diff --git a/transactions/kgpgtransactionprivate.cpp b/transactions/kgpgtransactionprivate.cpp
index 485048b..56fdc73 100644
--- a/transactions/kgpgtransactionprivate.cpp
+++ b/transactions/kgpgtransactionprivate.cpp
@@ -11,6 +11,14 @@
* *
***************************************************************************/
+#include <QPointer>
+#include <QWeakPointer>
+#include <QWidget>
+
+#include <KDebug>
+#include <KLocalizedString>
+#include <KIO/RenameDialog>
+
#include "kgpgtransaction.h"
#include "kgpgtransactionprivate.h"
@@ -28,6 +36,9 @@ KGpgTransactionPrivate::KGpgTransactionPrivate(KGpgTransaction *parent, bool all
m_ownProcessFinished(false),
m_quitTries(0)
{
+ connect(m_process, &GPGProc::readReady, this, &KGpgTransactionPrivate::slotReadReady);
+ connect(m_process, &GPGProc::processExited, this, &KGpgTransactionPrivate::slotProcessExited);
+ connect(m_process, &GPGProc::started, this, &KGpgTransactionPrivate::slotProcessStarted);
}
KGpgTransactionPrivate::~KGpgTransactionPrivate()
@@ -43,3 +54,259 @@ KGpgTransactionPrivate::~KGpgTransactionPrivate()
delete m_inputTransaction;
delete m_process;
}
+
+void
+KGpgTransactionPrivate::slotReadReady()
+{
+ QString line;
+ QWeakPointer<GPGProc> process(m_process);
+ QWeakPointer<KGpgTransaction> par(m_parent);
+
+ while (!process.isNull() && (m_process->readln(line, true) >= 0)) {
+ if (m_quitTries)
+ m_quitLines << line;
+#ifdef KGPG_DEBUG_TRANSACTIONS
+ kDebug(2100) << m_parent << line;
+#endif /* KGPG_DEBUG_TRANSACTIONS */
+
+ static const QString getBool = QLatin1String("[GNUPG:] GET_BOOL ");
+
+ if (line.startsWith(QLatin1String("[GNUPG:] USERID_HINT "))) {
+ m_parent->addIdHint(line);
+ } else if (line.startsWith(QLatin1String("[GNUPG:] BAD_PASSPHRASE "))) {
+ // the MISSING_PASSPHRASE line comes first, in that case ignore a
+ // following BAD_PASSPHRASE
+ if (m_success != KGpgTransaction::TS_USER_ABORTED)
+ m_success = KGpgTransaction::TS_BAD_PASSPHRASE;
+ } else if (line.startsWith(QLatin1String("[GNUPG:] GET_HIDDEN passphrase.enter"))) {
+ const bool goOn = m_parent->passphraseRequested();
+
+ // Check if the object was deleted while waiting for the result
+ if (!goOn || par.isNull())
+ return;
+
+ } else if (line.startsWith(QLatin1String("[GNUPG:] GOOD_PASSPHRASE"))) {
+ emit m_parent->statusMessage(i18n("Got Passphrase"));
+
+ if (m_passwordDialog != Q_NULLPTR) {
+ m_passwordDialog->close();
+ m_passwordDialog->deleteLater();
+ m_passwordDialog = Q_NULLPTR;
+ }
+
+ if (m_parent->passphraseReceived()) {
+ // signal GnuPG that there will be no further input and it can
+ // begin sending output.
+ m_process->closeWriteChannel();
+ }
+
+ } else if (line.startsWith(getBool)) {
+ static const QString overwrite = QLatin1String("openfile.overwrite.okay");
+ const QString question = line.mid(getBool.length());
+
+ KGpgTransaction::ts_boolanswer answer;
+
+ if (question.startsWith(overwrite)) {
+ m_overwriteUrl.clear();
+ answer = m_parent->confirmOverwrite(m_overwriteUrl);
+
+ if ((answer == KGpgTransaction::BA_UNKNOWN) && !m_overwriteUrl.isEmpty()) {
+ QPointer<KIO::RenameDialog> over = new KIO::RenameDialog(qobject_cast<QWidget *>(m_parent->parent()),
+ i18n("File Already Exists"), QUrl(),
+ m_overwriteUrl, KIO::RenameDialog_Overwrite);
+
+ m_overwriteUrl.clear();
+
+ switch (over->exec()) {
+ case KIO::R_OVERWRITE:
+ answer = KGpgTransaction::BA_YES;
+ break;
+ case KIO::R_RENAME:
+ answer = KGpgTransaction::BA_NO;
+ m_overwriteUrl = over->newDestUrl();
+ break;
+ default:
+ answer = KGpgTransaction::BA_UNKNOWN;
+ m_parent->setSuccess(KGpgTransaction::TS_USER_ABORTED);
+ // Close the pipes, otherwise GnuPG will try to answer
+ // further questions about this file.
+ m_process->closeWriteChannel();
+ m_process->closeReadChannel(QProcess::StandardOutput);
+ break;
+ }
+
+ delete over;
+
+ if (answer == KGpgTransaction::BA_UNKNOWN)
+ continue;
+ }
+ } else {
+ answer = m_parent->boolQuestion(question);
+ }
+
+ switch (answer) {
+ case KGpgTransaction::BA_YES:
+ write("YES\n");
+ break;
+ case KGpgTransaction::BA_NO:
+ write("NO\n");
+ break;
+ case KGpgTransaction::BA_UNKNOWN:
+ m_parent->setSuccess(KGpgTransaction::TS_MSG_SEQUENCE);
+ m_parent->unexpectedLine(line);
+ sendQuit();
+ }
+ } else if (!m_overwriteUrl.isEmpty() && line.startsWith(QLatin1String("[GNUPG:] GET_LINE openfile.askoutname"))) {
+ write(m_overwriteUrl.toLocalFile().toUtf8() + '\n');
+ m_overwriteUrl.clear();
+ } else if (line.startsWith(QLatin1String("[GNUPG:] MISSING_PASSPHRASE"))) {
+ m_success = KGpgTransaction::TS_USER_ABORTED;
+ } else if (line.startsWith(QLatin1String("[GNUPG:] CARDCTRL "))) {
+ // just ignore them, pinentry should handle that
+ } else {
+ // all known hints
+ int i = 0;
+ bool matched = false;
+ foreach (const QString &hintName, hintNames()) {
+ const KGpgTransaction::ts_hintType h = static_cast<KGpgTransaction::ts_hintType>(i++);
+ if (!line.startsWith(hintName))
+ continue;
+
+ matched = true;
+
+ bool r;
+ const int skip = hintName.length();
+ if (line.length() == skip) {
+ r = m_parent->hintLine(h, QString());
+ } else {
+ r = m_parent->hintLine(h, line.mid(skip + 1).trimmed());
+ }
+
+ if (!r) {
+ m_parent->setSuccess(KGpgTransaction::TS_MSG_SEQUENCE);
+ sendQuit();
+ }
+
+ break;
+ }
+
+ if (!matched) {
+ if (m_parent->nextLine(line))
+ sendQuit();
+ }
+ }
+ }
+}
+
+void
+KGpgTransactionPrivate::slotProcessExited()
+{
+ m_ownProcessFinished = true;
+
+ if (m_inputProcessDone)
+ processDone();
+}
+
+void
+KGpgTransactionPrivate::slotProcessStarted()
+{
+ m_parent->postStart();
+}
+
+void
+KGpgTransactionPrivate::sendQuit(void)
+{
+ write("quit\n");
+
+#ifdef KGPG_DEBUG_TRANSACTIONS
+ if (m_quitTries == 0)
+ kDebug(2100) << "sending quit";
+#endif /* KGPG_DEBUG_TRANSACTIONS */
+
+ if (m_quitTries++ >= 3) {
+ kDebug(2100) << "tried" << m_quitTries << "times to quit the GnuPG session";
+ kDebug(2100) << "last input was" << m_quitLines;
+ kDebug(2100) << "please file a bug report at https://bugs.kde.org";
+ m_process->closeWriteChannel();
+ m_success = KGpgTransaction::TS_MSG_SEQUENCE;
+ }
+}
+
+void
+KGpgTransactionPrivate::slotInputTransactionDone(int result)
+{
+ Q_ASSERT(m_parent->sender() == m_inputTransaction);
+
+ m_inputProcessDone = true;
+ m_inputProcessResult = result;
+
+ if (m_ownProcessFinished)
+ processDone();
+}
+
+void
+KGpgTransactionPrivate::slotPassphraseEntered(const QString &passphrase)
+{
+ // not calling KGpgTransactionPrivate::write() here for obvious privacy reasons
+ m_process->write(passphrase.toUtf8() + '\n');
+ if (m_parent->sender() == m_newPasswordDialog) {
+ m_newPasswordDialog->deleteLater();
+ m_newPasswordDialog = Q_NULLPTR;
+ m_parent->newPassphraseEntered();
+ } else {
+ Q_ASSERT(m_parent->sender() == m_passwordDialog);
+ }
+}
+
+void
+KGpgTransactionPrivate::slotPassphraseAborted()
+{
+ Q_ASSERT((m_parent->sender() == m_passwordDialog) ^ (m_parent->sender() == m_newPasswordDialog));
+ m_parent->sender()->deleteLater();
+ m_newPasswordDialog = Q_NULLPTR;
+ m_passwordDialog = Q_NULLPTR;
+ handlePassphraseAborted();
+}
+
+void
+KGpgTransactionPrivate::handlePassphraseAborted()
+{
+ // sending "quit" here is useless as it would be interpreted as the passphrase
+ m_process->closeWriteChannel();
+ m_success = KGpgTransaction::TS_USER_ABORTED;
+}
+
+void
+KGpgTransactionPrivate::write(const QByteArray &a)
+{
+ m_process->write(a);
+#ifdef KGPG_DEBUG_TRANSACTIONS
+ kDebug(2100) << m_parent << a;
+#endif /* KGPG_DEBUG_TRANSACTIONS */
+}
+
+const QStringList &
+KGpgTransactionPrivate::hintNames (void)
+{
+ static QStringList hints;
+
+ if (hints.isEmpty()) {
+ hints.insert(KGpgTransaction::HT_KEYEXPIRED, QLatin1String("[GNUPG:] KEYEXPIRED"));
+ hints.insert(KGpgTransaction::HT_SIGEXPIRED, QLatin1String("[GNUPG:] SIGEXPIRED"));
+ hints.insert(KGpgTransaction::HT_NOSECKEY, QLatin1String("[GNUPG:] NO_SECKEY"));
+ hints.insert(KGpgTransaction::HT_ENCTO, QLatin1String("[GNUPG:] ENC_TO"));
+ }
+
+ return hints;
+}
+
+void
+KGpgTransactionPrivate::processDone()
+{
+ m_parent->finish();
+ emit m_parent->infoProgress(100, 100);
+ emit m_parent->done(m_success);
+#ifdef KGPG_DEBUG_TRANSACTIONS
+ kDebug(2100) << this << "result:" << m_success;
+#endif /* KGPG_DEBUG_TRANSACTIONS */
+}
diff --git a/transactions/kgpgtransactionprivate.h b/transactions/kgpgtransactionprivate.h
index 9282480..e6075c6 100644
--- a/transactions/kgpgtransactionprivate.h
+++ b/transactions/kgpgtransactionprivate.h
@@ -24,7 +24,7 @@
class KGpgTransaction;
class KGpgSignTransactionHelper;
-class KGpgTransactionPrivate {
+class KGpgTransactionPrivate : public QObject {
public:
KGpgTransactionPrivate(KGpgTransaction *parent, bool allowChaining);
~KGpgTransactionPrivate();
@@ -48,6 +48,7 @@ public:
void slotProcessStarted();
void slotInputTransactionDone(int result);
void slotPassphraseEntered(const QString &passphrase);
+
/**
* @brief a slot to handle the case that the passphrase entry was aborted by the user
*