[developerteam getadooble] SF.net SVN: dooble:[2470] trunk/browser/Source/dooble.cc
Brought to you by:
textfield
From: <tex...@us...> - 2011-07-07 22:21:59
|
Revision: 2470 http://dooble.svn.sourceforge.net/dooble/?rev=2470&view=rev Author: textfield Date: 2011-07-07 22:21:53 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Support for multiple users is crucial. Display an initial tab. Modified Paths: -------------- trunk/browser/Source/dooble.cc Modified: trunk/browser/Source/dooble.cc =================================================================== --- trunk/browser/Source/dooble.cc 2011-07-07 22:20:34 UTC (rev 2469) +++ trunk/browser/Source/dooble.cc 2011-07-07 22:21:53 UTC (rev 2470) @@ -196,12 +196,11 @@ myappTranslator.load("dooble_" + QLocale::system().name(), "translations"); qapp.installTranslator(&myappTranslator); -#ifdef Q_WS_WIN - QDir homeDir(QDir::current()); -#else + QDir homeDir(QDir::home()); -#endif + homeDir.mkdir(".dooble"); + /* ** Disable Web page icons. */ @@ -217,11 +216,7 @@ QCoreApplication::setOrganizationDomain("dooble.sf.net"); QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, - #ifdef Q_WS_WIN - QDir::currentPath() + QDir::separator() + ".dooble"); - #else - QDir::homePath() + QDir::separator() + ".dooble"); - #endif + QDir::homePath() + QDir::separator() + ".dooble"); QSettings::setDefaultFormat(QSettings::IniFormat); /* @@ -266,15 +261,9 @@ << "downloads.db"; while(!containers.isEmpty()) -#ifdef Q_WS_WIN - QFile::remove(QDir::currentPath() + QDir::separator() + - ".dooble" + QDir::separator() + - containers.takeFirst()); -#else - QFile::remove(QDir::homePath() + QDir::separator() + - ".dooble" + QDir::separator() + - containers.takeFirst()); -#endif + QFile::remove(QDir::homePath() + QDir::separator() + + ".dooble" + QDir::separator() + + containers.takeFirst()); } QList<QString> list(settings.allKeys()); @@ -928,9 +917,12 @@ QMainWindow(), dest_url_(url.toString(QUrl::StripTrailingSlash)) { init(false); + + dview *p = newTab(QUrl("about blank")); + promptForPassphrase(); initializeHistoryMenu(); - newTab(url); + p->load(url); if(dooble::s_settings.value("settingsWindow/displayDesktopCheckBox", false).toBool()) @@ -963,6 +955,9 @@ dest_url_("") { init(false); + + dview *p = newTab(QUrl("about: blank")); + promptForPassphrase(); initializeHistoryMenu(); @@ -973,7 +968,7 @@ QUrl url(QUrl::fromUserInput(urls.takeFirst())); if(url.isValid()) - newTab(url); + p->load(url); } if(dooble::s_settings.value("settingsWindow/displayDesktopCheckBox", @@ -2243,11 +2238,7 @@ if(path.isEmpty() || !QFile::exists(path) || !QFileInfo(path).isReadable()) -#ifdef Q_WS_WIN - path = QDir::currentPath(); -#else - path = QDir::homePath(); -#endif + path = QDir::homePath(); } QWidget *parent = qobject_cast<QWidget *> (sender()); @@ -2679,15 +2670,9 @@ { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "history"); -#ifdef Q_WS_WIN - db.setDatabaseName(QDir::currentPath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#else db.setDatabaseName(QDir::homePath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#endif + ".dooble" + QDir::separator() + "history.db"); - if(db.open()) { QSqlQuery query(db); @@ -2700,14 +2685,8 @@ } QSqlDatabase::removeDatabase("history"); -#ifdef Q_WS_WIN - QFile::remove(QDir::currentPath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#else QFile::remove(QDir::homePath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#endif - + ".dooble" + QDir::separator() + "history.db"); } void dooble::slotShowSettingsWindow(void) @@ -2859,11 +2838,7 @@ fileDialog.setWindowModality(Qt::WindowModal); fileDialog.setWindowTitle(tr("Dooble Web Browser: Open Directory")); fileDialog.setFileMode(QFileDialog::Directory); -#ifdef Q_WS_WIN - fileDialog.setDirectory(QDir::currentPath()); -#else fileDialog.setDirectory(QDir::homePath()); -#endif fileDialog.setLabelText(QFileDialog::Accept, tr("&Open")); fileDialog.setAcceptMode(QFileDialog::AcceptOpen); @@ -2903,11 +2878,7 @@ (QDesktopServices::DesktopLocation); if(path.isEmpty() || !QFile::exists(path)) -#ifdef Q_WS_WIN - path = QDir::currentPath(); -#else - path = QDir::homePath(); -#endif + path = QDir::homePath(); } loadPage(QUrl::fromLocalFile(path)); @@ -2937,13 +2908,8 @@ { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "history"); -#ifdef Q_WS_WIN - db.setDatabaseName(QDir::currentPath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#else db.setDatabaseName(QDir::homePath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#endif + ".dooble" + QDir::separator() + "history.db"); if(db.open()) { @@ -3538,14 +3504,10 @@ { { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "history"); -#ifdef Q_WS_WIN - db.setDatabaseName(QDir::currentPath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#else - db.setDatabaseName(QDir::homePath() + QDir::separator() + - ".dooble" + QDir::separator() + "history.db"); -#endif + db.setDatabaseName(QDir::homePath() + QDir::separator() + + ".dooble" + QDir::separator() + "history.db"); + if(db.open()) { QSqlQuery query(db); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |