Commit 15e668ad authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Use Q_EMIT instead of emit

In C++20 there are new classes that have member functions named emit().
c.f.:
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
https://en.cppreference.com/w/cpp/io/basic_osyncstream/emit

GIT_SILENT
parent f0a1752d
......@@ -115,7 +115,7 @@ void BookmarkIteratorHolder::addAffectedBookmark(const QString & address)
void BookmarkIteratorHolder::doIteratorListChanged()
{
//qCDebug(KEDITBOOKMARKS_LOG) << count() << "iterators";
emit setCancelEnabled(count() > 0);
Q_EMIT setCancelEnabled(count() > 0);
if(count() == 0) {
//qCDebug(KEDITBOOKMARKS_LOG) << "Notifying managers" << m_affectedBookmark;
KBookmarkManager* mgr = m_model->bookmarkManager();
......
......@@ -50,7 +50,7 @@ void FavIconUpdater::downloadIcon(const KBookmark &bk)
m_bk.setIcon(favicon);
KEBApp::self()->notifyCommandExecuted();
// //qCDebug(KEDITBOOKMARKS_LOG) << "emit done(true)";
emit done(true, QString());
Q_EMIT done(true, QString());
} else {
//qCDebug(KEDITBOOKMARKS_LOG) << "no favicon found";
......@@ -77,7 +77,7 @@ void FavIconUpdater::downloadIconUsingWebBrowser(const KBookmark &bk, const QStr
KParts::ReadOnlyPart *part
= KMimeTypeTrader::createPartInstanceFromQuery<KParts::ReadOnlyPart>(QStringLiteral("text/html"), nullptr, this, QString(), QVariantList(), &partLoadingError);
if (!part) {
emit done(false, i18n("%1; no HTML component found (%2)", currentError, partLoadingError));
Q_EMIT done(false, i18n("%1; no HTML component found (%2)", currentError, partLoadingError));
return;
}
......@@ -124,12 +124,12 @@ void FavIconUpdater::slotResult(KJob *job)
} else {
qCDebug(KEDITBOOKMARKS_LOG) << "favicon job failed, emit done";
// already tried webupdater
emit done(false, job->errorString());
Q_EMIT done(false, job->errorString());
}
return;
}
m_bk.setIcon(requestJob->iconFile());
emit done(true, QString());
Q_EMIT done(true, QString());
}
/* -------------------------- */
......@@ -177,7 +177,7 @@ void FavIconWebGrabber::slotFinished(KJob *job)
{
if (job->error()) {
qCDebug(KEDITBOOKMARKS_LOG) << job->errorString();
emit done(false, job->errorString());
Q_EMIT done(false, job->errorString());
return;
}
// On success mimetype was emitted, so no need to do anything.
......@@ -186,13 +186,13 @@ void FavIconWebGrabber::slotFinished(KJob *job)
void FavIconWebGrabber::slotCompleted()
{
qCDebug(KEDITBOOKMARKS_LOG);
emit done(true, QString());
Q_EMIT done(true, QString());
}
void FavIconWebGrabber::slotCanceled(const QString& errorString)
{
//qCDebug(KEDITBOOKMARKS_LOG) << errorString;
emit done(false, errorString);
Q_EMIT done(false, errorString);
}
......@@ -101,7 +101,7 @@ void CommandHistory::commandExecuted(const QUndoCommand *k)
KBookmark bk = d->m_manager->findByAddress(cmd->affectedBookmarks());
Q_ASSERT(bk.isGroup());
emit notifyCommandExecuted(bk.toGroup());
Q_EMIT notifyCommandExecuted(bk.toGroup());
}
void CommandHistory::notifyDocSaved()
......@@ -121,7 +121,7 @@ void CommandHistory::clearHistory()
{
if (d->m_undoStack.count() > 0) {
d->m_undoStack.clear();
emit notifyCommandExecuted(d->m_manager->root()); // not really, but we still want to update the GUI
Q_EMIT notifyCommandExecuted(d->m_manager->root()); // not really, but we still want to update the GUI
}
}
......
......@@ -299,7 +299,7 @@ void KBookmarkModel::emitDataChanged(const KBookmark& bk)
{
QModelIndex idx = indexForBookmark(bk);
qCDebug(KEDITBOOKMARKS_LOG) << idx;
emit dataChanged(idx, idx.sibling(idx.row(), columnCount()-1));
Q_EMIT dataChanged(idx, idx.sibling(idx.row(), columnCount()-1));
}
static const char* s_mime_bookmark_addresses = "application/x-kde-bookmarkaddresses";
......
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