┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/bookmarkselector.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-02-17 10:31:52 +0000
committerPeter Penz <[email protected]>2007-02-17 10:31:52 +0000
commit175fe7ff47ccff39b0e77f80491a9701d025375e (patch)
tree6c2cb040129fbd5050549c970d0219de96808314 /src/bookmarkselector.cpp
parent86110e2778d6ac5eb4454f58de532cabfcd75dbf (diff)
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
Diffstat (limited to 'src/bookmarkselector.cpp')
-rw-r--r--src/bookmarkselector.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/bookmarkselector.cpp b/src/bookmarkselector.cpp
index 59f30e30a..44b705594 100644
--- a/src/bookmarkselector.cpp
+++ b/src/bookmarkselector.cpp
@@ -1,6 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006 by Peter Penz *
+ * Copyright (C) 2006 by Peter Penz ([email protected]) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -18,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
+#include "bookmarkselector.h"
#include <assert.h>
#include <q3popupmenu.h>
@@ -28,15 +28,13 @@
#include <kglobalsettings.h>
#include <kbookmarkmanager.h>
-#include "bookmarkselector.h"
#include "dolphinsettings.h"
-#include "dolphinview.h"
-#include "dolphinmainwindow.h"
#include "urlnavigator.h"
BookmarkSelector::BookmarkSelector(UrlNavigator* parent) :
UrlButton(parent),
- m_selectedIndex(0)
+ m_selectedIndex(0),
+ m_urlNavigator(parent)
{
setFocusPolicy(Qt::NoFocus);
@@ -113,7 +111,7 @@ QSize BookmarkSelector::sizeHint() const
return QSize(height, height);
}
-void BookmarkSelector::paintEvent(QPaintEvent* event)
+void BookmarkSelector::paintEvent(QPaintEvent* /*event*/)
{
QPainter painter(this);
@@ -134,10 +132,7 @@ void BookmarkSelector::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 = m_urlNavigator->isActive();
if (!isActive) {
QColor dimmColor(palette().brush(QPalette::Background).color());
foregroundColor = mixColors(foregroundColor, dimmColor);
@@ -168,10 +163,9 @@ void BookmarkSelector::slotBookmarkActivated(int index)
{
m_selectedIndex = index;
- KBookmark bookmark = selectedBookmark();
+ const KBookmark bookmark = selectedBookmark();
setPixmap(SmallIcon(bookmark.icon()));
-
- emit bookmarkActivated(index);
+ emit bookmarkActivated(bookmark.url());
}
#include "bookmarkselector.moc"