Commit 19cf2777 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Remove some QString(QLatin1String/QString) wrappings

parent c8c9b5a9
......@@ -214,7 +214,7 @@ void MediaFrame::watch(const QString &path)
//qDebug() << "watching" << localPath << "for changes";
m_watcher.addPath(localPath);
m_watchFile = QString(localPath);
m_watchFile = localPath;
}
else
{
......
......@@ -33,7 +33,7 @@ static QString identifierToPath(const QString &identifier)
{
const QString dataDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/plasma_engine_comic/");
return QString(dataDir + QString::fromLatin1(QUrl::toPercentEncoding(identifier)));
return dataDir + QString::fromLatin1(QUrl::toPercentEncoding(identifier));
}
......
......@@ -756,16 +756,16 @@ void ComicProviderWrapper::redirected(int id, const QUrl &newUrl)
void ComicProviderWrapper::finished() const
{
qDebug() << QString(QLatin1String("Author")).leftJustified(22, QLatin1Char('.')) << comicAuthor();
qDebug() << QString(QLatin1String("Website URL")).leftJustified(22, QLatin1Char('.')) << mWebsiteUrl;
qDebug() << QString(QLatin1String("Shop URL")).leftJustified(22, QLatin1Char('.')) << mShopUrl;
qDebug() << QString(QLatin1String("Title")).leftJustified(22, QLatin1Char('.')) << mTitle;
qDebug() << QString(QLatin1String("Additional Text")).leftJustified(22, QLatin1Char('.')) << mAdditionalText;
qDebug() << QString(QLatin1String("Identifier")).leftJustified(22, QLatin1Char('.')) << mIdentifier;
qDebug() << QString(QLatin1String("First Identifier")).leftJustified(22, QLatin1Char('.')) << mFirstIdentifier;
qDebug() << QString(QLatin1String("Last Identifier")).leftJustified(22, QLatin1Char('.')) << mLastIdentifier;
qDebug() << QString(QLatin1String("Next Identifier")).leftJustified(22, QLatin1Char('.')) << mNextIdentifier;
qDebug() << QString(QLatin1String("Previous Identifier")).leftJustified(22, QLatin1Char('.')) << mPreviousIdentifier;
qDebug() << QString::fromLatin1("Author").leftJustified(22, QLatin1Char('.')) << comicAuthor();
qDebug() << QString::fromLatin1("Website URL").leftJustified(22, QLatin1Char('.')) << mWebsiteUrl;
qDebug() << QString::fromLatin1("Shop URL").leftJustified(22, QLatin1Char('.')) << mShopUrl;
qDebug() << QString::fromLatin1("Title").leftJustified(22, QLatin1Char('.')) << mTitle;
qDebug() << QString::fromLatin1("Additional Text").leftJustified(22, QLatin1Char('.')) << mAdditionalText;
qDebug() << QString::fromLatin1("Identifier").leftJustified(22, QLatin1Char('.')) << mIdentifier;
qDebug() << QString::fromLatin1("First Identifier").leftJustified(22, QLatin1Char('.')) << mFirstIdentifier;
qDebug() << QString::fromLatin1("Last Identifier").leftJustified(22, QLatin1Char('.')) << mLastIdentifier;
qDebug() << QString::fromLatin1("Next Identifier").leftJustified(22, QLatin1Char('.')) << mNextIdentifier;
qDebug() << QString::fromLatin1("Previous Identifier").leftJustified(22, QLatin1Char('.')) << mPreviousIdentifier;
emit mProvider->finished(mProvider);
}
......
......@@ -52,12 +52,12 @@ void ApodProvider::Private::pageRequestFinished( KJob *_job )
const QString data = QString::fromUtf8( job->data() );
const QString pattern( QLatin1String( "<a href=\"(image/.*)\"" ) );
const QString pattern = QStringLiteral("<a href=\"(image/.*)\"" );
QRegExp exp( pattern );
exp.setMinimal( true );
if ( exp.indexIn( data ) != -1 ) {
const QString sub = exp.cap(1);
QUrl url( QString( QLatin1String( "http://antwrp.gsfc.nasa.gov/apod/%1" ) ).arg( sub ) );
const QUrl url(QLatin1String("http://antwrp.gsfc.nasa.gov/apod/") + sub);
KIO::StoredTransferJob *imageJob = KIO::storedGet( url, KIO::NoReload, KIO::HideProgressInfo );
mParent->connect( imageJob, SIGNAL(finished(KJob*)), SLOT(imageRequestFinished(KJob*)) );
} else {
......
......@@ -59,7 +59,7 @@ QString CachedProvider::identifierToPath( const QString &identifier )
const QString dataDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/plasma_engine_potd/");
QDir d;
d.mkpath(dataDir);
return QString( dataDir + identifier );
return dataDir + identifier;
}
......
......@@ -52,13 +52,13 @@ void EpodProvider::Private::pageRequestFinished(KJob *_job)
const QString data = QString::fromUtf8( job->data() );
const QString pattern( QLatin1String( "http://epod.usra.edu/.a/*-pi" ) );
const QString pattern = QStringLiteral("http://epod.usra.edu/.a/*-pi");
QRegExp exp( pattern );
exp.setPatternSyntax(QRegExp::Wildcard);
int pos = exp.indexIn( data ) + pattern.length();
const QString sub = data.mid( pos-4, pattern.length()+6);
QUrl url( QString(QLatin1String( "http://epod.usra.edu/.a/%1-pi" )) .arg(sub) );
const QUrl url(QStringLiteral("http://epod.usra.edu/.a/%1-pi").arg(sub));
KIO::StoredTransferJob *imageJob = KIO::storedGet( url, KIO::NoReload, KIO::HideProgressInfo );
QObject::connect(imageJob, SIGNAL(finished(KJob*)), mParent, SLOT(imageRequestFinished(KJob*)) );
}
......
......@@ -63,7 +63,7 @@ bool PotdProvider::isFixedDate() const
QString PotdProvider::identifier() const
{
if (isFixedDate()) {
return QString( QLatin1String( "%1:%2" ) ).arg( d->name, d->date.toString( Qt::ISODate ));
return d->name + QLatin1Char(':') + d->date.toString(Qt::ISODate);
}
return d->name;
......
......@@ -78,7 +78,7 @@ public:
if (ch.isNumber()) {
return true;
}
if (QString(QLatin1String( ".,-+" )).contains( ch )) {
if (QStringLiteral(".,-+").contains(ch)) {
return true;
}
return false;
......
......@@ -69,7 +69,7 @@ void DictionaryRunner::match(Plasma::RunnerContext &context)
if (!partOfSpeech.cap(1).isEmpty())
lastPartOfSpeech = partOfSpeech.cap(1);
Plasma::QueryMatch match(this);
match.setText(QString(QLatin1String("%1: %2")).arg(query, lastPartOfSpeech));
match.setText(query + QLatin1String(": ") + lastPartOfSpeech);
match.setRelevance(1 - (static_cast<double>(++item) / static_cast<double>(lines.length())));
match.setType(Plasma::QueryMatch::InformationalMatch);
match.setIconName(QStringLiteral("accessories-dictionary"));
......
Supports Markdown
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