From b71a1e3f03808450ad9b4474b2098e637e99e14e Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 28 Apr 2009 19:07:47 +0200 Subject: Faster Mainview load --- src/mainview.cpp | 24 ++++++++++++++++-------- src/mainview.h | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/mainview.cpp b/src/mainview.cpp index cbfd418b..e4958919 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -61,10 +61,13 @@ MainView::MainView(QWidget *parent) , m_urlBars(new StackedUrlBar(this)) , m_tabBar(new TabBar(this)) { + // setting tabbar setTabBar(m_tabBar); - + + // loading pixmap path m_loadingGitPath = KStandardDirs::locate("appdata" , "pics/loading.gif"); + // connecting tabbar signals connect(m_tabBar, SIGNAL(closeTab(int)), this, SLOT(slotCloseTab(int))); connect(m_tabBar, SIGNAL(cloneTab(int)), this, SLOT(slotCloneTab(int))); connect(m_tabBar, SIGNAL(closeOtherTabs(int)), this, SLOT(slotCloseOtherTabs(int))); @@ -72,19 +75,14 @@ MainView::MainView(QWidget *parent) connect(m_tabBar, SIGNAL(reloadAllTabs()), this, SLOT(slotReloadAllTabs())); connect(m_tabBar, SIGNAL(tabMoved(int,int)), this, SLOT(moveTab(int,int))); - // Recently Closed Tab Action - connect(m_recentlyClosedTabsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentTabsMenu())); - connect(m_recentlyClosedTabsMenu, SIGNAL(triggered(QAction *)), this, SLOT(aboutToShowRecentTriggeredAction(QAction *))); - m_recentlyClosedTabsAction = new KAction(i18n("Recently Closed Tabs"), this); - m_recentlyClosedTabsAction->setMenu(m_recentlyClosedTabsMenu); - m_recentlyClosedTabsAction->setEnabled(false); - // -- connect(this, SIGNAL(loadUrlPage(const KUrl &)), this, SLOT(loadUrlInCurrentTab(const KUrl &))); connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int))); setTabsClosable(true); connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotCloseTab(int))); + + QTimer::singleShot(0, this, SLOT(postLaunch())); } @@ -93,6 +91,16 @@ MainView::~MainView() } +void MainView::postLaunch() +{ + // Recently Closed Tab Action + connect(m_recentlyClosedTabsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentTabsMenu())); + connect(m_recentlyClosedTabsMenu, SIGNAL(triggered(QAction *)), this, SLOT(aboutToShowRecentTriggeredAction(QAction *))); + m_recentlyClosedTabsAction = new KAction(i18n("Recently Closed Tabs"), this); + m_recentlyClosedTabsAction->setMenu(m_recentlyClosedTabsMenu); + m_recentlyClosedTabsAction->setEnabled(false); +} + void MainView::showTabBar() { if ( ReKonfig::alwaysShowTabBar() ) diff --git a/src/mainview.h b/src/mainview.h index 5493d6ab..529b441d 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -158,6 +158,8 @@ private slots: */ void moveTab(int fromIndex, int toIndex); + void postLaunch(); + private: /** -- cgit v1.2.1