Implement home page settings and help startup options.

This commit is contained in:
kh
2009-06-26 16:50:50 +02:00
parent 319720f43a
commit a175a5f6ee
6 changed files with 131 additions and 40 deletions

View File

@@ -239,18 +239,20 @@ void CentralWidget::setLastShownPages()
QString()).toString();
const QStringList lastShownPageList = value.split(QLatin1Char('|'),
QString::SkipEmptyParts);
const int pageCount = lastShownPageList.count();
if (pageCount <= 0) {
QUrl url = helpEngine->findFile(QString::fromLatin1("qthelp://com."
"trolltech.qt.440/qdoc/index.html"));
if (!url.isValid()) {
url.setUrl(QString("qthelp://com.nokia.qtcreator.%1%2/doc/index.html").
arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR));
url.setUrl(QString::fromLatin1("qthelp://com.nokia.qtcreator.%1%2/"
"doc/index.html").arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR));
QString homePage = helpEngine->customValue(QLatin1String("DefaultHomePage"),
QLatin1String("about:blank")).toString();
int option = helpEngine->customValue(QLatin1String("StartOption"), 2).toInt();
if (option == 0 || option == 1 || pageCount <= 0) {
if (option == 0) {
homePage = helpEngine->customValue(QLatin1String("HomePage"),
homePage).toString();
} else if (option == 1) {
homePage = QLatin1String("about:blank");
}
setSource(url);
setSource(homePage);
return;
}