From 198619f0bdf515712181fb62782b16212945f9b3 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 2 Aug 2010 14:53:45 +0200 Subject: Faster startup --- src/mainwindow.cpp | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 245110ec..7c77ef13 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -149,27 +149,6 @@ MainWindow::MainWindow() // no more status bar.. setStatusBar(0); - KToolBar *mainBar = toolBar("mainToolBar"); - - QToolButton *bookmarksButton = qobject_cast(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); - if(bookmarksButton) - { - connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); - } - - QToolButton *toolsButton = qobject_cast(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); - if(toolsButton) - { - connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); - } - - // setting popup notification - m_popup->setAutoDelete(false); - connect(Application::instance(), SIGNAL(focusChanged(QWidget*, QWidget*)), m_popup, SLOT(hide())); - m_popup->setFrameShape(QFrame::NoFrame); - m_popup->setLineWidth(0); - connect(m_hidePopup, SIGNAL(timeout()), m_popup, SLOT(hide())); - QTimer::singleShot(0, this, SLOT(postLaunch())); kDebug() << "MainWindow ctor...DONE"; @@ -215,8 +194,7 @@ void MainWindow::setupToolbars() actionCollection()->addAction( QL1S("url_bar"), a); KToolBar *mainBar = toolBar("mainToolBar"); -// KToolBar *bookBar = toolBar("bookmarksToolBar"); -// + // bookmarks bar KAction *bookmarkBarAction = Application::bookmarkProvider()->bookmarkToolBarAction(m_bookmarksBar); a = actionCollection()->addAction( QL1S("bookmarks_bar"), bookmarkBarAction); @@ -231,6 +209,27 @@ void MainWindow::setupToolbars() void MainWindow::postLaunch() { + KToolBar *mainBar = toolBar("mainToolBar"); + + QToolButton *bookmarksButton = qobject_cast(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); + if(bookmarksButton) + { + connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); + } + + QToolButton *toolsButton = qobject_cast(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); + if(toolsButton) + { + connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); + } + + // setting popup notification + m_popup->setAutoDelete(false); + connect(Application::instance(), SIGNAL(focusChanged(QWidget*, QWidget*)), m_popup, SLOT(hide())); + m_popup->setFrameShape(QFrame::NoFrame); + m_popup->setLineWidth(0); + connect(m_hidePopup, SIGNAL(timeout()), m_popup, SLOT(hide())); + // notification system connect(m_view, SIGNAL(showStatusBarMessage(const QString&, Rekonq::Notify)), this, SLOT(notifyMessage(const QString&, Rekonq::Notify))); connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); -- cgit v1.2.1