From f31a541925033c2ef5e27b85c099d47791b50121 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Wed, 29 Nov 2006 00:02:19 +0000 Subject: Make it (almost) possible to have more than one Dolphin KMainWindow Create a DolphinApplication, holding DolphinMainWindows and update the code to use the DolphinView to get the MainWindow, or get a ptr to the MainWindow directly. Or if all windows are effected go through the DolphinApplication to update every mainwindow. The UndowManager and ProgressIndicator have a rather strange relationship and will need some more attention but as UndoManager will be killed anyway I have skipped this. More cleanup, debugging and thinking is needed. svn path=/trunk/playground/utils/dolphin/; revision=608945 --- src/bookmarkssidebarpage.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/bookmarkssidebarpage.cpp') diff --git a/src/bookmarkssidebarpage.cpp b/src/bookmarkssidebarpage.cpp index b3861aa2f..7eced5a01 100644 --- a/src/bookmarkssidebarpage.cpp +++ b/src/bookmarkssidebarpage.cpp @@ -36,12 +36,11 @@ #include #include "dolphinsettings.h" -#include "dolphin.h" -#include "dolphinview.h" +#include "dolphinmainwindow.h" #include "editbookmarkdialog.h" -BookmarksSidebarPage::BookmarksSidebarPage(QWidget* parent) : - SidebarPage(parent) +BookmarksSidebarPage::BookmarksSidebarPage(DolphinMainWindow* mainWindow, QWidget* parent) : + SidebarPage(mainWindow, parent) { Q3VBoxLayout* layout = new Q3VBoxLayout(this); m_bookmarksList = new BookmarksListBox(this); @@ -98,7 +97,7 @@ void BookmarksSidebarPage::slotMouseButtonClicked(int button, Q3ListBoxItem* ite const int index = m_bookmarksList->index(item); KBookmark bookmark = DolphinSettings::instance().bookmark(index); - Dolphin::mainWin().activeView()->setUrl(bookmark.url()); + mainWindow()->activeView()->setUrl(bookmark.url()); } void BookmarksSidebarPage::slotContextMenuRequested(Q3ListBoxItem* item, @@ -187,7 +186,7 @@ void BookmarksSidebarPage::slotContextMenuRequested(Q3ListBoxItem* item, delete popup; popup = 0; - DolphinView* view = Dolphin::mainWin().activeView(); + DolphinView* view = mainWindow()->activeView(); adjustSelection(view->url()); } @@ -241,7 +240,7 @@ void BookmarksSidebarPage::slotUrlChanged(const KUrl& url) void BookmarksSidebarPage::connectToActiveView() { - DolphinView* view = Dolphin::mainWin().activeView(); + DolphinView* view = mainWindow()->activeView(); adjustSelection(view->url()); connect(view, SIGNAL(signalUrlChanged(const KUrl&)), this, SLOT(slotUrlChanged(const KUrl&))); -- cgit v1.3