From: kh1 Date: Fri, 23 Nov 2012 16:26:13 +0000 (+0100) Subject: Fix inbuild help and message. Remove Trolltech references. X-Git-Tag: accepted/tizen/20131212.181521~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9d0c62882781e073e8c934b02516d87ae07ba25;p=platform%2Fupstream%2Fqttools.git Fix inbuild help and message. Remove Trolltech references. Change-Id: Ibe74e744d737c68854ca98dfe72af43287ff89c7 Reviewed-by: Jerome Pasion --- diff --git a/src/assistant/assistant/assistant.qch b/src/assistant/assistant/assistant.qch index e6d5299..b023d53 100644 Binary files a/src/assistant/assistant/assistant.qch and b/src/assistant/assistant/assistant.qch differ diff --git a/src/assistant/assistant/helpviewer.cpp b/src/assistant/assistant/helpviewer.cpp index f1f4681..314a765 100644 --- a/src/assistant/assistant/helpviewer.cpp +++ b/src/assistant/assistant/helpviewer.cpp @@ -62,7 +62,7 @@ const QString HelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "about:blank"); const QString HelpViewer::LocalHelpFile = QLatin1String("qthelp://" - "com.trolltech.com.assistantinternal-1.0.0/assistant/assistant.html"); + "org.qt-project.assistantinternal-1.0.0/assistant/assistant-quick-guide.html"); const QString HelpViewer::PageNotFoundMessage = QCoreApplication::translate("HelpViewer", "Error 404...
%1

%2

%3

%4

"; + +// some of the values we will replace %1...4 inside the former html +const QString g_percent1 = QCoreApplication::translate("HelpViewer", "Error 404..."); +const QString g_percent2 = QCoreApplication::translate("HelpViewer", "The page could not be found!"); +// percent3 will be the url of the page we got the error from +const QString g_percent4 = QCoreApplication::translate("HelpViewer", "Please make sure that you have all " + "documentation sets installed."); + + // -- HelpNetworkReply class HelpNetworkReply : public QNetworkReply @@ -148,8 +164,8 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, url = HelpViewer::fixupVirtualFolderForUrl(&engine, request.url(), &fileFound); const QString &mimeType = HelpViewer::mimeFromUrl(url); - const QByteArray &data = fileFound ? engine.fileData(url) - : HelpViewer::PageNotFoundMessage.arg(url).toUtf8(); + const QByteArray &data = fileFound ? engine.fileData(url) : QString::fromLatin1(g_htmlPage) + .arg(g_percent1, g_percent2, HelpViewer::tr("Error loading: %1").arg(url), g_percent4).toUtf8(); return new HelpNetworkReply(request, data, mimeType.isEmpty() ? QLatin1String("application/octet-stream") : mimeType); diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp index 4663a67..1c447af 100644 --- a/src/assistant/assistant/mainwindow.cpp +++ b/src/assistant/assistant/mainwindow.cpp @@ -223,6 +223,9 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) contentDock->raise(); const QRect screen = QApplication::desktop()->screenGeometry(); resize(4*screen.width()/5, 4*screen.height()/5); + + adjustSize(); // make sure we won't start outside of the screen + move(screen.center() - rect().center()); } if (!helpEngineWrapper.hasFontSettings()) { @@ -326,7 +329,7 @@ bool MainWindow::initHelpDB(bool registerInternalDoc) return true; } bool assistantInternalDocRegistered = false; - QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); + QString intern(QLatin1String("org.qt-project.assistantinternal-")); foreach (const QString &ns, helpEngineWrapper.registeredDocumentations()) { if (ns.startsWith(intern)) { intern = ns; @@ -1016,7 +1019,7 @@ QString MainWindow::collectionFileDirectory(bool createDir, const QString &cache { TRACE_OBJ QString collectionPath = - QStandardPaths::writableLocation(QStandardPaths::DataLocation); + QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); if (collectionPath.isEmpty()) { if (cacheDir.isEmpty()) collectionPath = QDir::homePath() + QDir::separator() @@ -1025,7 +1028,7 @@ QString MainWindow::collectionFileDirectory(bool createDir, const QString &cache collectionPath = QDir::homePath() + QLatin1String("/.") + cacheDir; } else { if (cacheDir.isEmpty()) - collectionPath = collectionPath + QLatin1String("/Trolltech/Assistant"); + collectionPath = collectionPath + QLatin1String("/QtProject/Assistant"); else collectionPath = collectionPath + QDir::separator() + cacheDir; }