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

Use Q_EMIT

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