Commit 2dbd4dd5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_EMIT

parent 50c6b52a
......@@ -55,5 +55,5 @@ void BookmarkOwner::openBookmark( const KBookmark& bm, Qt::MouseButtons /*mb*/,
return;
}
emit openUrl( bm.url() );
Q_EMIT openUrl( bm.url() );
}
......@@ -274,7 +274,7 @@ void Glossary::treeItemSelected( QTreeWidgetItem *item )
return;
if ( EntryItem *i = dynamic_cast<EntryItem *>( item ) )
emit entrySelected( entry( i->id() ) );
Q_EMIT entrySelected( entry( i->id() ) );
item->setExpanded( !item->isExpanded() );
}
......
......@@ -231,12 +231,12 @@ void History::goHistory( int steps )
if ( current->url.scheme() == QLatin1String("khelpcenter") ) {
qCDebug(KHC_LOG) << "History::goHistory(): internal";
emit goInternalUrl( current->url );
Q_EMIT goInternalUrl( current->url );
return;
}
emit goUrl( current->url );
Q_EMIT goUrl( current->url );
Entry h( *current );
h.buffer.detach();
......
......@@ -100,7 +100,7 @@ class LogDialog : public QDialog
}
private:
QTextEdit *mTextView;
QTextEdit *mTextView = nullptr;
};
......
......@@ -385,7 +385,7 @@ void Navigator::slotItemSelected( QTreeWidgetItem *currentItem )
showOverview( item, url );
} else {
emit itemSelected( url.url() );
Q_EMIT itemSelected( url.url() );
}
}
......@@ -528,7 +528,7 @@ void Navigator::slotShowSearchResult( const QString &url )
QString u = url;
u.replace( QStringLiteral("%k"), mSearchEdit->text() );
emit itemSelected( u );
Q_EMIT itemSelected( u );
}
void Navigator::slotSearchFinished()
......@@ -611,7 +611,7 @@ void Navigator::slotDelayedIndexingStart()
return;
}
emit setStatusBarText( i18n( "Updating search index..." ) );
Q_EMIT setStatusBarText( i18n( "Updating search index..." ) );
mIndexingTimer.start();
......@@ -622,7 +622,7 @@ void Navigator::slotDoIndexWork()
{
if ( mIndexingQueue.isEmpty() ) {
mIndexingTimer.stop();
emit setStatusBarText( i18n( "Updating search index... done." ) );
Q_EMIT setStatusBarText( i18n( "Updating search index... done." ) );
mIndexingBar->hide();
mSearchWidget->searchIndexUpdated();
return;
......
......@@ -318,7 +318,7 @@ void SearchEngine::finishSearch()
mRootTraverser = nullptr;
mSearchRunning = false;
emit searchFinished();
Q_EMIT searchFinished();
}
QString SearchEngine::errorLog() const
......
......@@ -50,7 +50,7 @@ bool SearchJob::startLocal(const QString &cmdString)
mProcess->start();
if (!mProcess->waitForStarted()) {
QString txt = i18n("Error executing search command '%1'.", cmdString );
emit searchError( this, mEntry, txt );
Q_EMIT searchError( this, mEntry, txt );
return false;
}
return true;
......@@ -76,11 +76,11 @@ void SearchJob::searchExited( int exitCode, QProcess::ExitStatus exitStatus )
{
if ( exitStatus == QProcess::NormalExit && exitCode == 0 ) {
mResult = QString::fromUtf8(mProcess->readAllStandardOutput());
emit searchFinished( this, mEntry, mResult );
Q_EMIT searchFinished( this, mEntry, mResult );
} else {
mError = QString::fromUtf8(mProcess->readAllStandardError());
QString error = QLatin1String("<em>") + mCmd + QLatin1String("</em>\n") + mError;
emit searchError( this, mEntry, error );
Q_EMIT searchError( this, mEntry, error );
}
}
......@@ -90,9 +90,9 @@ void SearchJob::slotJobResult( KJob *job )
//DocEntry *entry = 0;
if ( job->error() ) {
emit searchError( this, mEntry, i18n("Error: %1", job->errorString() ) );
Q_EMIT searchError( this, mEntry, i18n("Error: %1", job->errorString() ) );
} else {
emit searchFinished( this, mEntry, mResult );
Q_EMIT searchFinished( this, mEntry, mResult );
}
}
......@@ -213,19 +213,19 @@ void ExternalProcessSearchHandler::search( DocEntry *entry, const QStringList &w
} else {
const QString txt = i18n("No search command or URL specified.");
emit searchFinished( this, entry, txt );
Q_EMIT searchFinished( this, entry, txt );
}
}
void ExternalProcessSearchHandler::slotSearchFinished( SearchJob *job, DocEntry *entry, const QString &result )
{
emit searchFinished( this, entry, result);
Q_EMIT searchFinished( this, entry, result);
job->deleteLater();
}
void ExternalProcessSearchHandler::slotSearchError( SearchJob *job, DocEntry *entry, const QString &error )
{
emit searchError(this, entry, error);
Q_EMIT searchError(this, entry, error);
job->deleteLater();
}
......
......@@ -321,7 +321,7 @@ void SearchWidget::scopeDoubleClicked( QTreeWidgetItem* item )
qCDebug(KHC_LOG) << "DoubleClick: " << searchUrl;
emit searchResult( searchUrl );
Q_EMIT searchResult( searchUrl );
}
void SearchWidget::scopeClicked( QTreeWidgetItem* )
......@@ -363,7 +363,7 @@ void SearchWidget::checkScope()
++it;
}
emit scopeCountChanged( mScopeCount );
Q_EMIT scopeCountChanged( mScopeCount );
}
int SearchWidget::scopeCount() const
......
......@@ -259,7 +259,7 @@ void TOC::slotItemSelected( QTreeWidgetItem *item )
{
TOCItem *tocItem;
if ( ( tocItem = dynamic_cast<TOCItem *>( item ) ) )
emit itemSelected( tocItem->entry()->url() );
Q_EMIT itemSelected( tocItem->entry()->url() );
item->setExpanded( !item->isExpanded() );
}
......
......@@ -177,7 +177,7 @@ void View::writeSearchResult( const QString &str )
void View::endSearchResult()
{
end();
if ( !mSearchResult.isEmpty() ) emit searchResultCacheAvailable();
if ( !mSearchResult.isEmpty() ) Q_EMIT searchResultCacheAvailable();
}
void View::beginInternal( const QUrl &url )
......@@ -275,7 +275,7 @@ bool View::prevPage(bool checkOnly)
return false;
if (!checkOnly)
emit browserExtension()->openUrlRequest(prevURL);
Q_EMIT browserExtension()->openUrlRequest(prevURL);
return true;
}
......@@ -289,7 +289,7 @@ bool View::nextPage(bool checkOnly)
return false;
if (!checkOnly)
emit browserExtension()->openUrlRequest(nextURL);
Q_EMIT browserExtension()->openUrlRequest(nextURL);
return true;
}
......
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