diff options
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/src/application.cpp b/src/application.cpp index 6fd5e3c5..6ef0b0c3 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -269,8 +269,24 @@ int Application::newInstance() if (isFirstLoad) { - // give me some time to do the other things.. - QTimer::singleShot(100, this, SLOT(postLaunch())); + // updating rekonq configuration + updateConfiguration(); + + setWindowIcon(KIcon("rekonq")); + + historyManager(); + + // bookmarks loading + connect(bookmarkProvider(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), + instance(), SLOT(loadUrl(const KUrl&, const Rekonq::OpenType&))); + + // crash recovering + if (ReKonfig::recoverOnCrash()) + { + mainWindow()->currentTab()->showMessageBar(); + } + ReKonfig::setRecoverOnCrash(ReKonfig::recoverOnCrash() + 1); + saveConfiguration(); } return exitValue; @@ -283,29 +299,6 @@ Application *Application::instance() } -void Application::postLaunch() -{ - // updating rekonq configuration - updateConfiguration(); - - setWindowIcon(KIcon("rekonq")); - - historyManager(); - - // bookmarks loading - connect(bookmarkProvider(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), - instance(), SLOT(loadUrl(const KUrl&, const Rekonq::OpenType&))); - - // crash recovering - if (ReKonfig::recoverOnCrash()) - { - mainWindow()->currentTab()->showMessageBar(); - } - ReKonfig::setRecoverOnCrash(ReKonfig::recoverOnCrash() + 1); - saveConfiguration(); -} - - void Application::saveConfiguration() const { ReKonfig::self()->writeConfig(); @@ -442,7 +435,6 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) barForTab->setQUrl(url); WebView *view = tab->view(); - if (view) { FilterUrlJob *job = new FilterUrlJob(view, url.pathOrUrl(), this); @@ -474,8 +466,8 @@ void Application::removeMainWindow(MainWindow *window) // QApplication should quit as soon we have no mainwindow // But QtWebkit seems to create windows without Qt::WA_QuitOnClose attribute, // making rekonq keep running after last window is closed - if ( m_mainWindows.length() == 0 ) - QCoreApplication::quit (); + if (m_mainWindows.length() == 0) + QCoreApplication::quit(); } @@ -649,7 +641,7 @@ void Application::updateConfiguration() case 3: // nothing for (int i = 0; i < mainWindow()->mainView()->tabBar()->count(); i++) { - mainWindow()->mainView()->tabBar()->setTabToolTip(i, ""); + mainWindow()->mainView()->tabBar()->setTabToolTip(i, QL1S("")); } break; @@ -791,8 +783,9 @@ void Application::createWebAppShortcut() QWidget widget; wAppWidget.setupUi(&widget); + const QString title = mainWindow()->currentTab()->view()->title().remove("&"); wAppWidget.iconLabel->setPixmap(iconManager()->iconForUrl(u).pixmap(32)); - wAppWidget.titleLabel->setText(h); + wAppWidget.titleLabel->setText(title); wAppWidget.kcfg_createDesktopAppShortcut->setChecked(ReKonfig::createDesktopAppShortcut()); wAppWidget.kcfg_createMenuAppShortcut->setChecked(ReKonfig::createMenuAppShortcut()); @@ -819,7 +812,7 @@ void Application::createWebAppShortcut() if (ReKonfig::createDesktopAppShortcut()) { QString desktop = KGlobalSettings::desktopPath(); - QFile wAppFile(desktop + QL1C('/') + h + QL1S(".desktop")); + QFile wAppFile(desktop + QL1C('/') + title + QL1S(".desktop")); if (!wAppFile.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -837,7 +830,7 @@ void Application::createWebAppShortcut() if (ReKonfig::createMenuAppShortcut()) { QString appMenuDir = KStandardDirs::locateLocal("xdgdata-apps", QString()); - QFile wAppFile(appMenuDir + QL1C('/') + h + QL1S(".desktop")); + QFile wAppFile(appMenuDir + QL1C('/') + title + QL1S(".desktop")); if (!wAppFile.open(QIODevice::WriteOnly | QIODevice::Text)) { |