Commit bb1d66d9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove unused variable + const'ify

parent a17fafe8
......@@ -132,13 +132,13 @@ QString DocMetaInfo::languageName( const QString &langcode )
if ( langcode == QLatin1String("en") )
return i18nc("Describes documentation entries that are in English", "English");
QString cfgfile = QStandardPaths::locate( QStandardPaths::GenericDataLocation, QStringLiteral( "locale/%1/kf5_entry.desktop" ).arg( langcode ) );
const QString cfgfile = QStandardPaths::locate( QStandardPaths::GenericDataLocation, QStringLiteral( "locale/%1/kf5_entry.desktop" ).arg( langcode ) );
qCDebug(KHC_LOG) << "-- langcode: " << langcode << " cfgfile: " << cfgfile;
KConfig _cfg( cfgfile, KConfig::SimpleConfig );
KConfigGroup cfg(&_cfg, "KCM Locale" );
QString name = cfg.readEntry( "Name", langcode );
const QString name = cfg.readEntry( "Name", langcode );
return name;
}
......
......@@ -54,7 +54,7 @@ void ScrollKeeperTreeBuilder::buildOrHide( NavigatorItem *parent )
void ScrollKeeperTreeBuilder::build( NavigatorItem *parent )
{
QString lang = QLocale().bcp47Name();
const QString lang = QLocale().bcp47Name();
qCDebug(KHC_LOG) << "ScrollKeeper language: " << lang;
......
......@@ -241,7 +241,7 @@ bool SearchEngine::initSearchHandlers()
}
if ( mHandlers.isEmpty() ) {
QString txt = i18n("No valid search handler found.");
const QString txt = i18n("No valid search handler found.");
qCWarning(KHC_LOG) << txt;
// KMessageBox::sorry( mView->widget(), txt );
return false;
......@@ -271,7 +271,7 @@ bool SearchEngine::search( const QString & words, const QString & method, int ma
return false;
}
QString txt = i18n("Search Results for '%1':", words.toHtmlEscaped() );
const QString txt = i18n("Search Results for '%1':", words.toHtmlEscaped() );
mStderr = QStringLiteral("<b>") + txt + QStringLiteral("</b>\n");
......@@ -294,7 +294,7 @@ QString SearchEngine::substituteSearchQuery( const QString &query,
result.replace( QLatin1String("%i"), identifier );
result.replace( QLatin1String("%w"), words.join( QLatin1Char('+') ) );
result.replace( QLatin1String("%m"), QString::number( maxResults ) );
QString o = QLatin1String(operation == Or ? "or" : "and");
const QString o = QLatin1String(operation == Or ? "or" : "and");
result.replace( QLatin1String("%o"), o );
result.replace( QLatin1String("%d"), Prefs::indexDirectory() );
result.replace( QLatin1String("%l"), lang );
......
......@@ -86,9 +86,6 @@ void SearchJob::searchExited( int exitCode, QProcess::ExitStatus exitStatus )
void SearchJob::slotJobResult( KJob *job )
{
QString result;
//DocEntry *entry = 0;
if ( job->error() ) {
Q_EMIT searchError( this, mEntry, i18n("Error: %1", job->errorString() ) );
} else {
......@@ -190,7 +187,7 @@ void ExternalProcessSearchHandler::search( DocEntry *entry, const QStringList &w
qCDebug(KHC_LOG) << entry->identifier();
if ( !mSearchCommand.isEmpty() ) {
QString cmdString = SearchEngine::substituteSearchQuery( mSearchCommand,
const QString cmdString = SearchEngine::substituteSearchQuery( mSearchCommand,
entry->identifier(), words, maxResults, operation, mLang, mSearchBinary );
qCDebug(KHC_LOG) << "CMD:" << cmdString;
......@@ -201,7 +198,7 @@ void ExternalProcessSearchHandler::search( DocEntry *entry, const QStringList &w
searchJob->startLocal(cmdString);
} else if ( !mSearchUrl.isEmpty() ) {
QString urlString = SearchEngine::substituteSearchQuery( mSearchUrl,
const QString urlString = SearchEngine::substituteSearchQuery( mSearchUrl,
entry->identifier(), words, maxResults, operation, mLang, mSearchBinary );
qCDebug(KHC_LOG) << "URL:" << urlString;
......
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