From c0e7b65db3dafcd6e50756133b39b31701903494 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 11 Jan 2013 09:03:02 +0100 Subject: Help: move global constants Global constants that are used only in one place could live just there. Change-Id: Ibee751b6ccc4fb0d35a8e708995730991becd749 Reviewed-by: Karsten Heimrich --- src/plugins/help/helpplugin.cpp | 4 ++-- src/plugins/help/helpviewer.cpp | 12 ------------ src/plugins/help/helpviewer.h | 5 ----- src/plugins/help/helpviewer_qtb.cpp | 10 ++++++++-- 4 files changed, 10 insertions(+), 21 deletions(-) (limited to 'src/plugins/help') diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 91a1644e5e..850f39c0b5 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -1168,8 +1168,8 @@ void HelpPlugin::handleHelpRequest(const QUrl &url) QString address = url.toString(); if (!Core::HelpManager::instance()->findFile(url).isValid()) { - if (address.startsWith(HelpViewer::NsNokia) - || address.startsWith(HelpViewer::NsTrolltech)) { + if (address.startsWith(QLatin1String("qthelp://com.nokia.")) + || address.startsWith(QLatin1String("qthelp://com.trolltech."))) { // local help not installed, resort to external web help QString urlPrefix = QLatin1String("http://doc.qt.digia.com/"); if (url.authority() == QLatin1String("com.nokia.qtcreator")) diff --git a/src/plugins/help/helpviewer.cpp b/src/plugins/help/helpviewer.cpp index 09f8e8fff8..959b4605c4 100644 --- a/src/plugins/help/helpviewer.cpp +++ b/src/plugins/help/helpviewer.cpp @@ -48,18 +48,6 @@ using namespace Help::Internal; -const QString HelpViewer::NsNokia = QLatin1String("qthelp://com.nokia."); -const QString HelpViewer::NsTrolltech = QLatin1String("qthelp://com.trolltech."); - -const QString HelpViewer::AboutBlankPage = - QCoreApplication::translate("HelpViewer", "about:blank"); - -const QString HelpViewer::PageNotFoundMessage = - QCoreApplication::translate("HelpViewer", "Error 404..." - "


The page could not be found

" - "

'%1'

"); - struct ExtensionMap { const char *extension; const char *mimeType; diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h index 0b71375241..0a0aac1a7f 100644 --- a/src/plugins/help/helpviewer.h +++ b/src/plugins/help/helpviewer.h @@ -85,11 +85,6 @@ public: bool findText(const QString &text, Find::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped = 0); - static const QString NsNokia; - static const QString NsTrolltech; - static const QString AboutBlankPage; - static const QString PageNotFoundMessage; - static bool isLocalUrl(const QUrl &url); static bool canOpenPage(const QString &url); static QString mimeFromUrl(const QUrl &url); diff --git a/src/plugins/help/helpviewer_qtb.cpp b/src/plugins/help/helpviewer_qtb.cpp index 65b56e1967..0c649662e5 100644 --- a/src/plugins/help/helpviewer_qtb.cpp +++ b/src/plugins/help/helpviewer_qtb.cpp @@ -168,8 +168,14 @@ void HelpViewer::setSource(const QUrl &url) } QTextBrowser::setSource(url); - setHtml(string == Help::Constants::AboutBlank ? AboutBlankPage - : PageNotFoundMessage.arg(url.toString())); + setHtml(string == Help::Constants::AboutBlank + ? HelpViewer::tr("about:blank") + : HelpViewer::tr("Error 404..." + "


The page could not be found

" + "

'%1'

") + .arg(url.toString())); + emit loadFinished(true); } -- cgit v1.2.1