summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-07-23 07:52:36 +0200
committerMontel Laurent <[email protected]>2017-07-23 07:52:36 +0200
commit5fad746a1889e18b9cd029b84d66e7bd8cc5de07 (patch)
treeff824088b96c5e7de50f157d77f0ad758aadd4ac
parent085c72be1e986a9967a31266d117c7b3bf739c02 (diff)
Fix some clazy warning
-rw-r--r--client/kfmclient.cpp14
-rw-r--r--plugins/babelfish/plugin_babelfish.cpp20
-rw-r--r--plugins/webarchiver/archivedialog.cpp2
-rw-r--r--plugins/webarchiver/archivedialog.h2
-rw-r--r--settings/konqhtml/generalopts.cpp2
-rw-r--r--settings/konqhtml/javaopts.cpp4
-rw-r--r--settings/konqhtml/javaopts.h4
-rw-r--r--src/konqhistoryview.cpp2
-rw-r--r--src/konqmainwindow.h2
-rw-r--r--src/konqviewmanager.cpp2
-rw-r--r--webenginepart/src/webenginepart_ext.cpp4
11 files changed, 29 insertions, 29 deletions
diff --git a/client/kfmclient.cpp b/client/kfmclient.cpp
index 415a307..f96597f 100644
--- a/client/kfmclient.cpp
+++ b/client/kfmclient.cpp
@@ -82,13 +82,13 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
//qDebug() << "kfmclient starting" << QTime::currentTime();
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("noninteractive"), i18n("Non interactive use: no message boxes")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("noninteractive"), i18n("Non interactive use: no message boxes")));
- parser.addOption(QCommandLineOption(QStringList() << QLatin1String("commands"), i18n("Show available commands")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("commands"), i18n("Show available commands")));
- parser.addPositionalArgument(QLatin1String("command"), i18n("Command (see --commands)"));
+ parser.addPositionalArgument(QStringLiteral("command"), i18n("Command (see --commands)"));
- parser.addPositionalArgument(QLatin1String("[URL(s)]"), i18n("Arguments for command"));
+ parser.addPositionalArgument(QStringLiteral("[URL(s)]"), i18n("Arguments for command"));
parser.addOption(QCommandLineOption(QStringList{"tempfile"}, i18n("The files/URLs opened by the application will be deleted after use")));
@@ -97,7 +97,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
const QStringList args = parser.positionalArguments();
- if (args.isEmpty() || parser.isSet("commands")) {
+ if (args.isEmpty() || parser.isSet(QStringLiteral("commands"))) {
puts(i18n("\nSyntax:\n").toLocal8Bit());
puts(i18n(" kfmclient openURL 'url' ['mimetype']\n"
" # Opens a window showing 'url'.\n"
@@ -237,14 +237,14 @@ bool ClientApp::doIt(const QCommandLineParser &parser)
int argc = args.count();
checkArgumentCount(argc, 1, 0);
- if (!parser.isSet("noninteractive")) {
+ if (!parser.isSet(QStringLiteral("noninteractive"))) {
m_interactive = false;
}
QString command = args.at(0);
if (command == QLatin1String("openURL") || command == QLatin1String("newTab")) {
checkArgumentCount(argc, 1, 3);
- const bool tempFile = parser.isSet("tempfile");
+ const bool tempFile = parser.isSet(QStringLiteral("tempfile"));
if (argc == 1) {
return createNewWindow(QUrl::fromLocalFile(QDir::homePath()), command == QLatin1String("newTab"), tempFile);
}
diff --git a/plugins/babelfish/plugin_babelfish.cpp b/plugins/babelfish/plugin_babelfish.cpp
index 3dca2e4..ee20373 100644
--- a/plugins/babelfish/plugin_babelfish.cpp
+++ b/plugins/babelfish/plugin_babelfish.cpp
@@ -221,7 +221,7 @@ void PluginBabelFish::slotEnableMenu()
if (part && textExt) {
const QString scheme = part->url().scheme(); // always lower case
- if ((scheme == "http") || (scheme == "https")) {
+ if ((scheme == QLatin1String("http")) || (scheme == QLatin1String("https"))) {
if (KParts::BrowserExtension::childObject(part)) {
m_menu->setEnabled(true);
return;
@@ -272,7 +272,7 @@ void PluginBabelFish::translateURL(QAction *action)
}
const QString urlForQuery = QLatin1String(QUrl::toPercentEncoding(url.url()));
- if (url.scheme() == "https") {
+ if (url.scheme() == QLatin1String("https")) {
if (KMessageBox::warningContinueCancel(part->widget(),
xi18nc("@info", "\
You are viewing this page over a secure connection.<nl/><nl/>\
@@ -281,7 +281,7 @@ which may fetch the insecure version of the page."),
i18nc("@title:window", "Security Warning"),
KStandardGuiItem::cont(),
KStandardGuiItem::cancel(),
- QLatin1String("insecureTranslate")) != KMessageBox::Continue) {
+ QStringLiteral("insecureTranslate")) != KMessageBox::Continue) {
return;
}
}
@@ -325,17 +325,17 @@ which may fetch the insecure version of the page."),
}
if (hasSelection) {
// ## does not work
- result = QUrl("http://ets.freetranslation.com");
+ result = QUrl(QStringLiteral("http://ets.freetranslation.com"));
query += QLatin1String("&mode=html&template=results_en-us.htm&srctext=");
query += textForQuery;
} else {
- result = QUrl("http://www.freetranslation.com/web.asp");
+ result = QUrl(QStringLiteral("http://www.freetranslation.com/web.asp"));
query += QLatin1String("&url=");
query += urlForQuery;
}
} else if (engine == QLatin1String("parsit")) {
// Does only English -> Thai
- result = QUrl("http://c3po.links.nectec.or.th/cgi-bin/Parsitcgi.exe");
+ result = QUrl(QStringLiteral("http://c3po.links.nectec.or.th/cgi-bin/Parsitcgi.exe"));
query = QStringLiteral("mode=test&inputtype=");
if (hasSelection) {
query += QLatin1String("text&TxtEng=");
@@ -345,7 +345,7 @@ which may fetch the insecure version of the page."),
query += urlForQuery;
}
} else if (engine == QLatin1String("reverso")) {
- result = QUrl("http://www.reverso.net/url/frame.asp");
+ result = QUrl(QStringLiteral("http://www.reverso.net/url/frame.asp"));
query = QStringLiteral("autotranslate=on&templates=0&x=0&y=0&directions=");
if (language == QStringLiteral("de_fr")) {
query += QLatin1String("524292");
@@ -369,7 +369,7 @@ which may fetch the insecure version of the page."),
query += QLatin1String("&url=");
query += urlForQuery;
} else if (engine == QLatin1String("tsail")) {
- result = QUrl("http://www.t-mail.com/cgi-bin/tsail");
+ result = QUrl(QStringLiteral("http://www.t-mail.com/cgi-bin/tsail"));
query = QStringLiteral("sail=full&lp=");
if (language == QStringLiteral("zhTW_en")) {
query += QLatin1String("tw-en");
@@ -381,7 +381,7 @@ which may fetch the insecure version of the page."),
}
query += urlForQuery;
} else if (engine == QLatin1String("voila")) {
- result = QUrl("http://tr.voila.fr/traduire-une-page-web-frame.php");
+ result = QUrl(QStringLiteral("http://tr.voila.fr/traduire-une-page-web-frame.php"));
const QStringList parts = language.split('_');
if (parts.count() == 2) {
// The translation direction is "first letter of source, first letter of dest"
@@ -408,7 +408,7 @@ which may fetch the insecure version of the page."),
query += "|" + textForQuery;
result = QUrl(query);
} else { //http://translate.google.com/translate?hl=en&sl=en&tl=de&u=http%3A%2F%2Fkde.org%2F%2F
- result = QUrl("http://translate.google.com/translate");
+ result = QUrl(QStringLiteral("http://translate.google.com/translate"));
query = QStringLiteral("ie=UTF-8");
if (parts.count() == 2) {
query += "&sl=" + parts[0] + "&tl=" + parts[1];
diff --git a/plugins/webarchiver/archivedialog.cpp b/plugins/webarchiver/archivedialog.cpp
index 2ba926c..c634448 100644
--- a/plugins/webarchiver/archivedialog.cpp
+++ b/plugins/webarchiver/archivedialog.cpp
@@ -1336,7 +1336,7 @@ bool ArchiveDialog::urlCheckFailed(KHTMLPart *part, const KUrl &fullURL)
return false;
}
-QString ArchiveDialog::escapeHTML(QString in)
+QString ArchiveDialog::escapeHTML(const QString &in)
{
return in.toHtmlEscaped().replace('"', QLatin1String("&quot;"));
}
diff --git a/plugins/webarchiver/archivedialog.h b/plugins/webarchiver/archivedialog.h
index 3875688..ec11aee 100644
--- a/plugins/webarchiver/archivedialog.h
+++ b/plugins/webarchiver/archivedialog.h
@@ -224,7 +224,7 @@ private:
/**
* Escapes HTML characters. Does not forget " as @ref Qt::escape() does.
*/
- QString escapeHTML(QString in);
+ QString escapeHTML(const QString &in);
/**
* Adds a suffix that hints at the mimetypes if such a suffix is not
diff --git a/settings/konqhtml/generalopts.cpp b/settings/konqhtml/generalopts.cpp
index 36cb143..7e6f9f0 100644
--- a/settings/konqhtml/generalopts.cpp
+++ b/settings/konqhtml/generalopts.cpp
@@ -239,7 +239,7 @@ void KKonqGeneralOptions::save()
const QString preferredWebEngine = m_webEngineCombo->itemData(m_webEngineCombo->currentIndex()).toString();
//qDebug() << "preferredWebEngine=" << preferredWebEngine;
- KSharedConfig::Ptr profile = KSharedConfig::openConfig("mimeapps.list", KConfig::NoGlobals, QStandardPaths::ConfigLocation);
+ KSharedConfig::Ptr profile = KSharedConfig::openConfig(QStringLiteral("mimeapps.list"), KConfig::NoGlobals, QStandardPaths::ConfigLocation);
KConfigGroup addedServices(profile, "Added KDE Service Associations");
Q_FOREACH (const QString &mimeType, QStringList() << "text/html" << "application/xhtml+xml" << "application/xml") {
QStringList services = addedServices.readXdgListEntry(mimeType);
diff --git a/settings/konqhtml/javaopts.cpp b/settings/konqhtml/javaopts.cpp
index c20d599..0b9444a 100644
--- a/settings/konqhtml/javaopts.cpp
+++ b/settings/konqhtml/javaopts.cpp
@@ -43,7 +43,7 @@
// == class JavaPolicies =====
-JavaPolicies::JavaPolicies(KSharedConfig::Ptr config, const QString &group, bool global,
+JavaPolicies::JavaPolicies(const KSharedConfig::Ptr &config, const QString &group, bool global,
const QString &domain) :
Policies(config, group, global, domain, QStringLiteral("java."), QStringLiteral("EnableJava"))
{
@@ -61,7 +61,7 @@ JavaPolicies::~JavaPolicies()
// == class KJavaOptions =====
-KJavaOptions::KJavaOptions(KSharedConfig::Ptr config, const QString &group,
+KJavaOptions::KJavaOptions(const KSharedConfig::Ptr &config, const QString &group,
QWidget *parent)
: KCModule(parent),
_removeJavaScriptDomainAdvice(false),
diff --git a/settings/konqhtml/javaopts.h b/settings/konqhtml/javaopts.h
index 2a6e110..0ebe1d8 100644
--- a/settings/konqhtml/javaopts.h
+++ b/settings/konqhtml/javaopts.h
@@ -40,7 +40,7 @@ public:
* @param domain name of the domain this instance is used to configure the
* policies for (case insensitive, ignored if global == true)
*/
- JavaPolicies(KSharedConfig::Ptr config, const QString &group, bool global,
+ JavaPolicies(const KSharedConfig::Ptr &config, const QString &group, bool global,
const QString &domain = QString());
/** empty constructur to make QMap happy
@@ -82,7 +82,7 @@ class KJavaOptions : public KCModule
Q_OBJECT
public:
- KJavaOptions(KSharedConfig::Ptr config, const QString &group, QWidget *parent);
+ KJavaOptions(const KSharedConfig::Ptr &config, const QString &group, QWidget *parent);
void load() Q_DECL_OVERRIDE;
void save() Q_DECL_OVERRIDE;
diff --git a/src/konqhistoryview.cpp b/src/konqhistoryview.cpp
index b501ca4..f9f30cf 100644
--- a/src/konqhistoryview.cpp
+++ b/src/konqhistoryview.cpp
@@ -241,7 +241,7 @@ QUrl KonqHistoryView::urlForIndex(const QModelIndex &index) const
return QUrl();
}
- return index.data(KonqHistory::UrlRole).value<QUrl>();
+ return index.data(KonqHistory::UrlRole).toUrl();
}
// Code taken from KHTMLPopupGUIClient::slotCopyLinkLocation
diff --git a/src/konqmainwindow.h b/src/konqmainwindow.h
index c5388fc..6933281 100644
--- a/src/konqmainwindow.h
+++ b/src/konqmainwindow.h
@@ -199,7 +199,7 @@ public:
void setCaption(const QString &caption, bool modified) Q_DECL_OVERRIDE
{
Q_UNUSED(modified);
- return setCaption(caption);
+ setCaption(caption);
}
/**
diff --git a/src/konqviewmanager.cpp b/src/konqviewmanager.cpp
index e3b7bd6..6cfabb9 100644
--- a/src/konqviewmanager.cpp
+++ b/src/konqviewmanager.cpp
@@ -1187,7 +1187,7 @@ void KonqViewManager::loadItem(const KConfigGroup &cfg, KonqFrameContainerBase *
if (cfg.hasKey(urlKey)) {
url = QUrl(cfg.readPathEntry(urlKey, QStringLiteral("about:blank")));
} else if (urlKey == QLatin1String("empty_URL")) { // old stuff, not in use anymore
- url = QUrl(QLatin1String("about:blank"));
+ url = QUrl(QStringLiteral("about:blank"));
} else {
url = defaultURL;
}
diff --git a/webenginepart/src/webenginepart_ext.cpp b/webenginepart/src/webenginepart_ext.cpp
index 94a4eb7..9ea3c78 100644
--- a/webenginepart/src/webenginepart_ext.cpp
+++ b/webenginepart/src/webenginepart_ext.cpp
@@ -716,8 +716,8 @@ void WebEngineBrowserExtension::slotSpellCheckSelection()
view()->page()->runJavaScript(QL1S("this.selectionStart + ' ' + this.selectionEnd"), [this, text](const QVariant &value) {
const QString values = value.toString();
const int pos = values.indexOf(' ');
- m_spellTextSelectionStart = qMax(0, values.left(pos).toInt());
- m_spellTextSelectionEnd = qMax(0, values.mid(pos + 1).toInt());
+ m_spellTextSelectionStart = qMax(0, values.leftRef(pos).toInt());
+ m_spellTextSelectionEnd = qMax(0, values.midRef(pos + 1).toInt());
// kDebug() << "selection start:" << m_spellTextSelectionStart << "end:" << m_spellTextSelectionEnd;
Sonnet::BackgroundChecker *backgroundSpellCheck = new Sonnet::BackgroundChecker;