diff options
-rwxr-xr-x | fileencryptiondialog.cpp | 3 | ||||
-rw-r--r-- | verifydetailsdialog.cpp | 16 | ||||
-rw-r--r-- | verifydetailsdialog.h | 5 | ||||
-rw-r--r-- | verifynotification.cpp | 6 |
4 files changed, 23 insertions, 7 deletions
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp index 2eb25ca..54a2b2b 100755 --- a/fileencryptiondialog.cpp +++ b/fileencryptiondialog.cpp @@ -209,7 +209,8 @@ void FileEncryptionDialog::executeAction() return; } QByteArray signBuffer = signfile.readAll(); - new VerifyDetailsDialog(this, mCtx, mKeyList, &inBuffer, &signBuffer); + // TODO + //new VerifyDetailsDialog(this, mCtx, mKeyList, &inBuffer, &signBuffer); return; } diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp index dfe301d..f34d27b 100644 --- a/verifydetailsdialog.cpp +++ b/verifydetailsdialog.cpp @@ -21,7 +21,7 @@ #include "verifydetailsdialog.h" -VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* keyList, QByteArray* inputData, QByteArray* inputSignature) : +VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* keyList, const QString &inputData, QByteArray* inputSignature) : QDialog(parent) { mCtx = ctx; @@ -64,6 +64,9 @@ void VerifyDetailsDialog::refresh() } else { //TODO kgpg //sign = mCtx->verify(mInputData); + KGpgVerify *verify = new KGpgVerify(this, mInputData); + connect(verify, SIGNAL(done(int)), SLOT(slotVerifyDone(int))); + verify->start(); } /*if(sign==0) { @@ -105,3 +108,14 @@ void VerifyDetailsDialog::refresh() mVboxLayout->addWidget(buttonBox); } + +void VerifyDetailsDialog::slotVerifyDone(int result) { + const KGpgVerify * const verify = qobject_cast<KGpgVerify *>(sender()); + sender()->deleteLater(); + Q_ASSERT(verify != NULL); + + const QStringList messages = verify->getMessages(); + foreach(QString mess, messages) { + qDebug() << "vm: " << mess; + } +} diff --git a/verifydetailsdialog.h b/verifydetailsdialog.h index 5ce7ff7..3bc0b40 100644 --- a/verifydetailsdialog.h +++ b/verifydetailsdialog.h @@ -30,17 +30,18 @@ class VerifyDetailsDialog : public QDialog { Q_OBJECT public: - explicit VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, QByteArray* inputData, QByteArray* inputSignature = 0); + explicit VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, const QString &inputData, QByteArray* inputSignature = 0); private slots: void refresh(); + void slotVerifyDone(int result); private: GpgME::GpgContext *mCtx; KeyList *mKeyList; QHBoxLayout *mainLayout; QWidget *mVbox; - QByteArray* mInputData; /** Data to be verified */ + QString mInputData; /** Data to be verified */ QByteArray* mInputSignature; /** Data to be verified */ QDialogButtonBox* buttonBox; }; diff --git a/verifynotification.cpp b/verifynotification.cpp index 9aa061f..e2df2ba 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -87,9 +87,9 @@ void VerifyNotification::showImportAction(bool visible) void VerifyNotification::showVerifyDetails() { - QByteArray text = mTextpage->toPlainText().toUtf8(); - mCtx->preventNoDataErr(&text); - new VerifyDetailsDialog(this, mCtx, mKeyList, &text); + //QByteArray text = mTextpage->toPlainText().toUtf8(); + //mCtx->preventNoDataErr(&text); + new VerifyDetailsDialog(this, mCtx, mKeyList, mTextpage->toPlainText()); } bool VerifyNotification::refresh() |