From 175fe7ff47ccff39b0e77f80491a9701d025375e Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 17 Feb 2007 10:31:52 +0000 Subject: Cleanup of the URL navigator, so that the DolphinMainWindow and the DolphinView are not used anymore. This will make it easier for us later on when moving the URL navigator outside Dolphin to make it accessable for other parts. Currently the bookmarks are still accessed by DolphinSettings, but this will be cleaned up later... svn path=/trunk/KDE/kdebase/apps/; revision=634432 --- src/dolphinview.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/dolphinview.cpp') diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 58c33b250..86b864583 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -79,9 +79,18 @@ DolphinView::DolphinView(DolphinMainWindow* mainWindow, m_topLayout->setSpacing(0); m_topLayout->setMargin(0); + connect(m_mainWindow, SIGNAL(activeViewChanged()), + this, SLOT(updateActivationState())); + m_urlNavigator = new UrlNavigator(url, this); connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)), this, SLOT(loadDirectory(const KUrl&))); + connect(m_urlNavigator, SIGNAL(urlsDropped(const KUrl::List&, const KUrl&)), + this, SLOT(dropUrls(const KUrl::List&, const KUrl&))); + connect(m_urlNavigator, SIGNAL(activated()), + this, SLOT(requestActivation())); + connect(this, SIGNAL(contentsMoved(int, int)), + m_urlNavigator, SLOT(storeContentsPosition(int, int))); m_statusBar = new DolphinStatusBar(this); @@ -165,7 +174,7 @@ const KUrl& DolphinView::url() const bool DolphinView::isActive() const { - return (mainWindow()->activeView() == this); + return m_mainWindow->activeView() == this; } void DolphinView::setMode(Mode mode) @@ -554,11 +563,6 @@ void DolphinView::reload() startDirLister(m_urlNavigator->url(), true); } -void DolphinView::declareViewActive() -{ - mainWindow()->setActiveView( this ); -} - void DolphinView::mouseReleaseEvent(QMouseEvent* event) { QWidget::mouseReleaseEvent(event); @@ -886,9 +890,16 @@ void DolphinView::dropUrls(const KUrl::List& urls, const KUrl& destination = (directory == 0) ? url() : directory->url(); + dropUrls(urls, destination); +} + +void DolphinView::dropUrls(const KUrl::List& urls, + const KUrl& destination) +{ m_mainWindow->dropUrls(urls, destination); } + void DolphinView::updateSorting(DolphinView::Sorting sorting) { ViewProperties props(url()); @@ -914,6 +925,11 @@ void DolphinView::emitContentsMoved() emit contentsMoved(contentsX(), contentsY()); } +void DolphinView::updateActivationState() +{ + m_urlNavigator->setActive(isActive()); +} + void DolphinView::createView() { // delete current view -- cgit v1.3