mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 18:32:51 +00:00
kgpgp: set default mode before processing arguments
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9ee9de025a
commit
0140cb19a6
2 changed files with 4 additions and 5 deletions
|
@ -492,7 +492,7 @@ void KGPG::slotQuit()
|
|||
qApp->quit();
|
||||
}
|
||||
|
||||
void KGPG::updateKeys(const gpgme_keylist_mode_t gpgmode, const bool secret)
|
||||
void KGPG::updateKeys(const gpgme_keylist_mode_t gpgmode, const bool gpgsecret)
|
||||
{
|
||||
disconnect(m_ui.keysbox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotKeysBox(int)));
|
||||
|
||||
|
@ -506,7 +506,7 @@ void KGPG::updateKeys(const gpgme_keylist_mode_t gpgmode, const bool secret)
|
|||
}
|
||||
|
||||
// required by key query
|
||||
gpgresult = gpgme_op_keylist_start(m_gpgctx, NULL, secret);
|
||||
gpgresult = gpgme_op_keylist_start(m_gpgctx, NULL, gpgsecret);
|
||||
if (gpgresult != 0) {
|
||||
setError(gpgme_strerror(gpgresult));
|
||||
return;
|
||||
|
@ -562,6 +562,7 @@ int main(int argc, char **argv)
|
|||
KApplication app;
|
||||
|
||||
KGPG* kgpg = new KGPG();
|
||||
kgpg->setMode(KGPG::EncryptMode);
|
||||
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
for (int pos = 0; pos < args->count(); ++pos) {
|
||||
|
@ -583,8 +584,6 @@ int main(int argc, char **argv)
|
|||
kgpg->setMode(KGPG::SignMode);
|
||||
} else if (args->isSet("verify")) {
|
||||
kgpg->setMode(KGPG::VerifyMode);
|
||||
} else {
|
||||
kgpg->setMode(KGPG::EncryptMode);
|
||||
}
|
||||
|
||||
kgpg->show();
|
||||
|
|
|
@ -79,7 +79,7 @@ private Q_SLOTS:
|
|||
void slotQuit();
|
||||
|
||||
private:
|
||||
void updateKeys(const gpgme_keylist_mode_t gpgmode, const bool secret);
|
||||
void updateKeys(const gpgme_keylist_mode_t gpgmode, const bool gpgsecret);
|
||||
|
||||
Ui_KGPGWindow m_ui;
|
||||
KGPGMode m_mode;
|
||||
|
|
Loading…
Add table
Reference in a new issue