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/urlnavigatorbutton.cpp | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'src/urlnavigatorbutton.cpp') diff --git a/src/urlnavigatorbutton.cpp b/src/urlnavigatorbutton.cpp index 9fe2186da..9616558a5 100644 --- a/src/urlnavigatorbutton.cpp +++ b/src/urlnavigatorbutton.cpp @@ -19,32 +19,26 @@ ***************************************************************************/ #include "urlnavigatorbutton.h" -#include -#include -#include -#include -#include -//Added by qt3to4: -#include -#include -#include -#include -#include + +#include + +#include "urlnavigator.h" #include #include +#include #include #include #include -#include -#include "urlnavigator.h" -#include "dolphinview.h" -#include "dolphinmainwindow.h" +#include +#include +#include UrlNavigatorButton::UrlNavigatorButton(int index, UrlNavigator* parent) : UrlButton(parent), m_index(-1), + m_popupDelay(0), m_listJob(0) { setAcceptDrops(true); @@ -117,10 +111,7 @@ void UrlNavigatorButton::paintEvent(QPaintEvent* event) } // dimm the colors if the parent view does not have the focus - const DolphinView* parentView = urlNavigator()->dolphinView(); - const DolphinMainWindow* dolphin = parentView->mainWindow(); - - const bool isActive = (dolphin->activeView() == parentView); + const bool isActive = urlNavigator()->isActive(); if (!isActive) { QColor dimmColor(palette().brush(QPalette::Background).color()); foregroundColor = mixColors(foregroundColor, dimmColor); @@ -218,8 +209,7 @@ void UrlNavigatorButton::dropEvent(QDropEvent* event) QString path(urlNavigator()->url().prettyUrl()); path = path.section('/', 0, m_index + 2); - DolphinMainWindow* win = urlNavigator()->dolphinView()->mainWindow(); - win->dropUrls(urls, KUrl(path)); + urlNavigator()->dropUrls(urls, KUrl(path)); setDisplayHintEnabled(DraggedHint, false); update(); @@ -251,9 +241,7 @@ void UrlNavigatorButton::updateNavigatorUrl() return; } - UrlNavigator* navigator = urlNavigator(); - assert(navigator != 0); - navigator->setUrl(navigator->url(m_index)); + urlNavigator()->setUrl(urlNavigator()->url(m_index)); } void UrlNavigatorButton::startPopupDelay() @@ -300,7 +288,7 @@ void UrlNavigatorButton::entriesList(KIO::Job* job, const KIO::UDSEntryList& ent KIO::UDSEntryList::const_iterator itEnd = entries.constEnd(); while (it != itEnd) { QString name; - bool isDir = false; + //bool isDir = false; KIO::UDSEntry entry = *it; /* KDE3 reference: -- cgit v1.3