Commit 0556fe93 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

emit->Q_EMIT

parent 1edc4d88
......@@ -147,7 +147,7 @@ KGpgCaffPrivate::abortOperation(int result)
qCDebug(KGPG_LOG_GENERAL) << "transaction" << sender() << "failed, result" << result;
m_tempdir.reset();
emit q->aborted();
Q_EMIT q->aborted();
}
void
......@@ -194,7 +194,7 @@ KGpgCaffPrivate::checkNextLoop()
ids.join(QLatin1String("\n")));
}
emit q->done();
Q_EMIT q->done();
} else {
reexportKey(m_allids.first());
}
......
......@@ -365,5 +365,5 @@ KGpgKeyNode::expand()
if (!wasExpanded())
readChildren();
emit expanded();
Q_EMIT expanded();
}
......@@ -87,7 +87,7 @@ KGpgRootNode::addKeys(const QStringList &ids)
}
KGpgKeyNode *nd = new KGpgKeyNode(this, key);
emit newKeyNode(nd);
Q_EMIT newKeyNode(nd);
}
for (const KgpgCore::KgpgKey &key : qAsConst(secretlist))
......
......@@ -311,7 +311,7 @@ void KgpgTextEdit::slotSignUpdate(int result)
const QString content = signt->signedText().join(lf) + lf;
setPlainText(content);
emit resetEncoding(false);
Q_EMIT resetEncoding(false);
}
void KgpgTextEdit::slotVerifyDone(int result)
......@@ -320,7 +320,7 @@ void KgpgTextEdit::slotVerifyDone(int result)
sender()->deleteLater();
Q_ASSERT(verify != nullptr);
emit verifyFinished();
Q_EMIT verifyFinished();
if (result == KGpgVerify::TS_MISSING_KEY) {
verifyKeyNeeded(verify->missingId());
......
......@@ -69,7 +69,7 @@ FolderCompressJob::start()
{
Q_D(FolderCompressJob);
emit description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"), i18nc("Job is started up", "Startup")));
Q_EMIT description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"), i18nc("Job is started up", "Startup")));
QMetaObject::invokeMethod(this, "doWork", Qt::QueuedConnection);
}
......@@ -120,7 +120,7 @@ FolderCompressJob::doWork()
d->m_options << QLatin1String("--output") << QDir::toNativeSeparators(outPath.path() + QDir::separator()) + d->m_dest.fileName();
emit description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"),
Q_EMIT description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"),
i18nc("Status message 'Encrypting <filename>' (operation starts)", "Encrypting %1", d->m_dest.path())));
......@@ -139,9 +139,9 @@ FolderCompressJob::slotEncryptionDone(int result)
if ((result != KGpgTransaction::TS_OK) && (result != KGpgTransaction::TS_USER_ABORTED)) {
setError(KJob::UserDefinedError + 1);
setErrorText(i18n("The encryption failed with error code %1", result));
emit description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"), i18n("Encryption failed.")));
Q_EMIT description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"), i18n("Encryption failed.")));
} else {
emit description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"),
Q_EMIT description(this, d->m_description, qMakePair(i18nc("State of operation as in status", "State"),
i18nc("Status message 'Encrypted <filename>' (operation was completed)", "Encrypted %1", d->m_dest.path())));
}
......
......@@ -366,7 +366,7 @@ void KgpgKeyInfo::applyButtonClicked()
void KgpgKeyInfo::cancelButtonClicked()
{
if (m_keywaschanged && m_node)
emit keyNeedsRefresh(m_node);
Q_EMIT keyNeedsRefresh(m_node);
reject();
}
......@@ -376,7 +376,7 @@ void KgpgKeyInfo::slotApplied(int result)
KMessageBox::error(this, i18n("Changing key properties failed."), i18n("Key properties"));
} else {
m_keywaschanged = true;
emit keyNeedsRefresh(m_node);
Q_EMIT keyNeedsRefresh(m_node);
reloadNode();
}
setControlEnable(true);
......
......@@ -136,7 +136,7 @@ void KeyServer::slotDownloadKeysFinished(int resultcode)
t->deleteLater();
if (resultcode == KGpgTransaction::TS_USER_ABORTED) {
emit importFailed();
Q_EMIT importFailed();
return;
}
......@@ -144,7 +144,7 @@ void KeyServer::slotDownloadKeysFinished(int resultcode)
const QString resultmessage(KGpgImport::getImportMessage(log));
if (!keys.empty())
emit importFinished(keys);
Q_EMIT importFinished(keys);
(void) new KgpgDetailedInfo(this, resultmessage, log.join(QLatin1String("\n")),
KGpgImport::getDetailedImportMessage(log).split(QLatin1Char( '\n' )),
......
......@@ -1199,7 +1199,7 @@ void KeysManager::showOptions()
void KeysManager::readAllOptions()
{
readOptions();
emit readAgainOptions();
Q_EMIT readAgainOptions();
}
void KeysManager::slotSetDefKey()
......
......@@ -172,7 +172,7 @@ KeyTreeView::contentsDropEvent(QDropEvent *o)
KGuiItem(i18n("Do Not Import"))) != KMessageBox::Yes)
return;
emit importDrop(uriList);
Q_EMIT importDrop(uriList);
}
}
......@@ -219,7 +219,7 @@ KeyTreeView::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Return) {
if (!event->isAutoRepeat())
emit returnPressed();
Q_EMIT returnPressed();
return;
}
......
......@@ -58,7 +58,7 @@ void KGpgChangeKey::setOwTrust(const gpgme_validity_t trust)
bool KGpgChangeKey::apply()
{
if (!wasChanged()) {
emit done(0);
Q_EMIT done(0);
return true;
}
......@@ -144,10 +144,10 @@ void KGpgChangeKey::nextStep(int result)
m_failed |= 4;
}
m_step = 0;
emit done(m_failed);
Q_EMIT done(m_failed);
if (m_autodestroy) {
if (m_node)
emit keyNeedsRefresh(m_node);
Q_EMIT keyNeedsRefresh(m_node);
deleteLater();
}
}
......
......@@ -487,9 +487,9 @@ void KGpgExternalActions::slotSaveOptionsPath()
const QString defaultID(m_assistant->getDefaultKey());
KGpgSettings::self()->save();
emit updateDefault(defaultID);
Q_EMIT updateDefault(defaultID);
if (m_assistant->runKeyGenerate())
emit createNewKey();
Q_EMIT createNewKey();
m_assistant->deleteLater();
}
......
......@@ -359,7 +359,7 @@ void kgpgOptions::updateSettings()
const QString newConfigFile = m_page4->gpg_home_path->text() + m_page4->gpg_conf_path->text();
if (newConfigFile != gpgConfigPath) {
KGpgSettings::setGpgConfigPath(newConfigFile);
emit homeChanged();
Q_EMIT homeChanged();
gpgConfigPath = newConfigFile;
}
......@@ -382,7 +382,7 @@ void kgpgOptions::updateSettings()
KgpgInterface::setGpgSetting(QLatin1String( "encrypt-to" ), alwaysKeyID, KGpgSettings::gpgConfigPath());
emit changeFont(m_fontchooser->font());
Q_EMIT changeFont(m_fontchooser->font());
// install service menus
if (m_page7->kcfg_SignMenu->currentIndex() == KGpgSettings::EnumSignMenu::AllFiles)
......@@ -419,30 +419,30 @@ void kgpgOptions::updateSettings()
KGpgSettings::setKeyServers(serverList);
if (keyUltimate != m_page3->kcfg_ColorUltimate->color())
emit refreshTrust(TRUST_ULTIMATE, m_page3->kcfg_ColorUltimate->color());
Q_EMIT refreshTrust(TRUST_ULTIMATE, m_page3->kcfg_ColorUltimate->color());
if (keyGood != m_page3->kcfg_ColorGood->color())
emit refreshTrust(TRUST_FULL, m_page3->kcfg_ColorGood->color());
Q_EMIT refreshTrust(TRUST_FULL, m_page3->kcfg_ColorGood->color());
if (keyExpired != m_page3->kcfg_ColorExpired->color())
emit refreshTrust(TRUST_EXPIRED, m_page3->kcfg_ColorExpired->color());
Q_EMIT refreshTrust(TRUST_EXPIRED, m_page3->kcfg_ColorExpired->color());
if (keyMarginal != m_page3->kcfg_ColorMarginal->color())
emit refreshTrust(TRUST_MARGINAL, m_page3->kcfg_ColorMarginal->color());
Q_EMIT refreshTrust(TRUST_MARGINAL, m_page3->kcfg_ColorMarginal->color());
if (keyBad != m_page3->kcfg_ColorBad->color()) {
emit refreshTrust(TRUST_INVALID, m_page3->kcfg_ColorBad->color());
emit refreshTrust(TRUST_DISABLED, m_page3->kcfg_ColorBad->color());
Q_EMIT refreshTrust(TRUST_INVALID, m_page3->kcfg_ColorBad->color());
Q_EMIT refreshTrust(TRUST_DISABLED, m_page3->kcfg_ColorBad->color());
}
if (keyUnknown != m_page3->kcfg_ColorUnknown->color()) {
emit refreshTrust(TRUST_UNDEFINED, m_page3->kcfg_ColorUnknown->color());
emit refreshTrust(TRUST_NONE, m_page3->kcfg_ColorUnknown->color());
emit refreshTrust(TRUST_UNKNOWN, m_page3->kcfg_ColorUnknown->color());
Q_EMIT refreshTrust(TRUST_UNDEFINED, m_page3->kcfg_ColorUnknown->color());
Q_EMIT refreshTrust(TRUST_NONE, m_page3->kcfg_ColorUnknown->color());
Q_EMIT refreshTrust(TRUST_UNKNOWN, m_page3->kcfg_ColorUnknown->color());
}
if (keyRev != m_page3->kcfg_ColorRev->color())
emit refreshTrust(TRUST_REVOKED, m_page3->kcfg_ColorRev->color());
Q_EMIT refreshTrust(TRUST_REVOKED, m_page3->kcfg_ColorRev->color());
m_showsystray = m_page7->kcfg_ShowSystray->isChecked();
KGpgSettings::setShowSystray(m_showsystray);
......@@ -462,7 +462,7 @@ void kgpgOptions::updateSettings()
KGpgSettings::self()->save();
m_config->sync();
emit settingsUpdated();
Q_EMIT settingsUpdated();
}
void kgpgOptions::listKeys()
......
......@@ -101,5 +101,5 @@ KGpgTextInterface::slotSignFile()
void
KGpgTextInterface::slotSignFinished()
{
emit fileSignFinished();
Q_EMIT fileSignFinished();
}
......@@ -37,7 +37,7 @@ void KLineBufferedProcessPrivate::_k_receivedStdout()
m_newlineInStdout = ndata.indexOf(m_lineEnd);
if (m_newlineInStdout >= 0) {
m_newlineInStdout += oldBufferSize;
emit m_parent->lineReadyStandardOutput();
Q_EMIT m_parent->lineReadyStandardOutput();
}
}
}
......@@ -52,7 +52,7 @@ void KLineBufferedProcessPrivate::_k_receivedStderr()
m_newlineInStderr = ndata.indexOf(m_lineEnd);
if (m_newlineInStderr >= 0) {
m_newlineInStderr += oldBufferSize;
emit m_parent->lineReadyStandardError();
Q_EMIT m_parent->lineReadyStandardError();
}
}
}
......@@ -44,9 +44,9 @@ GpgServerModel::setDefault(const int row)
const int oldRow = m_defaultRow;
m_defaultRow = row;
if (oldRow >= 0)
emit dataChanged(index(oldRow, 0), index(oldRow, 0));
Q_EMIT dataChanged(index(oldRow, 0), index(oldRow, 0));
if (row >= 0)
emit dataChanged(index(row, 0), index(row, 0));
Q_EMIT dataChanged(index(row, 0), index(row, 0));
}
void
......
......@@ -501,9 +501,9 @@ KeyListProxyModel::setPreviewSize(const int pixel)
{
Q_D(KeyListProxyModel);
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
d->m_previewsize = pixel;
emit layoutChanged();
Q_EMIT layoutChanged();
}
QVariant
......
......@@ -414,12 +414,12 @@ KGpgItemModel::setDefaultKey(KGpgKeyNode *def)
int lastcol = columnCount(QModelIndex()) - 1;
if (odefrow >= 0) {
KGpgNode *nd = m_root->getChild(odefrow);
emit dataChanged(createIndex(odefrow, 0, nd), createIndex(odefrow, lastcol, nd));
Q_EMIT dataChanged(createIndex(odefrow, 0, nd), createIndex(odefrow, lastcol, nd));
}
if (def) {
m_default = def->getId();
emit dataChanged(createIndex(defrow, 0, def), createIndex(defrow, lastcol, def));
Q_EMIT dataChanged(createIndex(defrow, 0, def), createIndex(defrow, lastcol, def));
} else {
m_default.clear();
}
......@@ -554,7 +554,7 @@ KGpgItemModel::updateNodeTrustColor(KGpgExpandableNode *node, const KgpgCore::Kg
KGpgNode *child = node->getChild(i);
if (child->getTrust() == trust)
emit dataChanged(createIndex(i, KEYCOLUMN_TRUST, child), createIndex(i, KEYCOLUMN_TRUST, child));
Q_EMIT dataChanged(createIndex(i, KEYCOLUMN_TRUST, child), createIndex(i, KEYCOLUMN_TRUST, child));
if (!child->hasChildren())
continue;
......
......@@ -123,12 +123,12 @@ KGpgDecrypt::nextLine(const QString& line)
decryptSuccess = true;
} else if (!inputFiles.isEmpty()) {
if (line == QLatin1String("[GNUPG:] BEGIN_DECRYPTION")) {
emit statusMessage(i18nc("Status message 'Decrypting <filename>' (operation starts)", "Decrypting %1", inputFiles.at(m_fileIndex).fileName()));
emit infoProgress(2 * m_fileIndex + 1, inputFiles.count() * 2);
Q_EMIT statusMessage(i18nc("Status message 'Decrypting <filename>' (operation starts)", "Decrypting %1", inputFiles.at(m_fileIndex).fileName()));
Q_EMIT infoProgress(2 * m_fileIndex + 1, inputFiles.count() * 2);
} else if (line == QLatin1String("[GNUPG:] END_DECRYPTION")) {
emit statusMessage(i18nc("Status message 'Decrypted <filename>' (operation was completed)", "Decrypted %1", inputFiles.at(m_fileIndex).fileName()));
Q_EMIT statusMessage(i18nc("Status message 'Decrypted <filename>' (operation was completed)", "Decrypted %1", inputFiles.at(m_fileIndex).fileName()));
m_fileIndex++;
emit infoProgress(2 * m_fileIndex, inputFiles.count() * 2);
Q_EMIT infoProgress(2 * m_fileIndex, inputFiles.count() * 2);
}
} else {
if (line.startsWith(QLatin1String("[GNUPG:] PLAINTEXT_LENGTH "))) {
......
......@@ -122,7 +122,7 @@ KGpgDelUid::setUid(const KGpgKeyNode *keynode, const int uid, const RemoveMode r
Q_ASSERT(keynode->wasExpanded());
int idx = 0;
forever {
while(1) {
idx++;
if (idx == -uid)
continue;
......
......@@ -101,12 +101,12 @@ KGpgEncrypt::nextLine(const QString &line)
if (line.startsWith(encStart)) {
m_currentFile = line.mid(encStart.length());
emit statusMessage(i18nc("Status message 'Encrypting <filename>' (operation starts)", "Encrypting %1", m_currentFile));
emit infoProgress(2 * m_fileIndex + 1, inputFiles.count() * 2);
Q_EMIT statusMessage(i18nc("Status message 'Encrypting <filename>' (operation starts)", "Encrypting %1", m_currentFile));
Q_EMIT infoProgress(2 * m_fileIndex + 1, inputFiles.count() * 2);
} else if (line == encDone) {
emit statusMessage(i18nc("Status message 'Encrypted <filename>' (operation was completed)", "Encrypted %1", m_currentFile));
Q_EMIT statusMessage(i18nc("Status message 'Encrypted <filename>' (operation was completed)", "Encrypted %1", m_currentFile));
m_fileIndex++;
emit infoProgress(2 * m_fileIndex, inputFiles.count() * 2);
Q_EMIT infoProgress(2 * m_fileIndex, inputFiles.count() * 2);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment