From ff88a65ccd2d10e2f4b3f91fd9705d7e2bf9f310 Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Sat, 25 Feb 2012 16:00:29 +0800 Subject: [PATCH] Move some code into MainWindow and make it internal stuff That MainWindow uses ProfileList is an internal implementation detail. The Higher lever Application does not need to know about it. --- src/Application.cpp | 2 -- src/MainWindow.cpp | 2 ++ src/MainWindow.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index a7583915a..ccf33c3fc 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -37,7 +37,6 @@ #include // Konsole -#include "ProfileList.h" #include "SessionManager.h" #include "MainWindow.h" #include "Session.h" @@ -73,7 +72,6 @@ void Application::init() MainWindow* Application::newMainWindow() { MainWindow* window = new MainWindow(); - window->setProfileList(new ProfileList(true, window)); connect(window, SIGNAL(newSessionRequest(Profile::Ptr,QString,ViewManager*)), diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index efb08854d..f8370dbdf 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -116,6 +116,8 @@ MainWindow::MainWindow() // emulator (as they are reserved for use by terminal applications) correctShortcuts(); + setProfileList(new ProfileList(true, this)); + // this must come at the end applyKonsoleSettings(); connect(KonsoleSettings::self(), SIGNAL(configChanged()), this, SLOT(applyKonsoleSettings())); diff --git a/src/MainWindow.h b/src/MainWindow.h index 23ae0334e..3891ac5d5 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -79,9 +79,6 @@ public: */ IncrementalSearchBar* searchBar() const; - /** Sets the list of profiles to be displayed in the File menu */ - void setProfileList(ProfileList* list); - /** * Returns the bookmark handler associated with this window. */ @@ -167,6 +164,9 @@ private slots: void openUrls(const QList& urls); + // Sets the list of profiles to be displayed under the "New Tab" action + void setProfileList(ProfileList* list); + void applyKonsoleSettings(); private: