summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-03-22 12:09:30 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-03-22 12:09:30 +0100
commit98fc1dc5406c3d4f191f899154eda1b0fa144d1a (patch)
tree75dc40bfa4843428704aabb83348403bdf903c9c
parenttypo (diff)
downloadrekonq-98fc1dc5406c3d4f191f899154eda1b0fa144d1a.tar.xz
update toolbar when bookmarks change. Yeah..
-rw-r--r--data/defaultbookmarks.xbel39
-rw-r--r--src/bookmarks.cpp28
-rw-r--r--src/bookmarks.h1
3 files changed, 47 insertions, 21 deletions
diff --git a/data/defaultbookmarks.xbel b/data/defaultbookmarks.xbel
index 4cad6c78..b4919c5c 100644
--- a/data/defaultbookmarks.xbel
+++ b/data/defaultbookmarks.xbel
@@ -1,25 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xbel>
<xbel version="1.0">
- <folder folded="no">
- <title>Default Bookmark</title>
- <bookmark href="http://qtsoftware.com/">
- <title>QtSoftware</title>
- </bookmark>
- <bookmark href="http://webkit.org/">
- <title>WebKit.org</title>
- </bookmark>
- <bookmark href="http://rekonq.sourceforge.net/">
- <title>rekonq site</title>
- </bookmark>
- <bookmark href="http://labs.trolltech.com/">
- <title>Trolltech Labs</title>
- </bookmark>
- <bookmark href="http://kde-apps.org/">
- <title>KDE-Apps.org</title>
- </bookmark>
- <bookmark href="http://www.kde.org/">
- <title>KDE site</title>
- </bookmark>
- </folder>
+ <bookmark href="http://qtsoftware.com/">
+ <title>QtSoftware</title>
+ </bookmark>
+ <bookmark href="http://webkit.org/">
+ <title>WebKit.org</title>
+ </bookmark>
+ <bookmark href="http://rekonq.sourceforge.net/">
+ <title>rekonq site</title>
+ </bookmark>
+ <bookmark href="http://labs.trolltech.com/">
+ <title>Trolltech Labs</title>
+ </bookmark>
+ <bookmark href="http://kde-apps.org/">
+ <title>KDE-Apps.org</title>
+ </bookmark>
+ <bookmark href="http://www.kde.org/">
+ <title>KDE site</title>
+ </bookmark>
</xbel>
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp
index 9b48de6f..bb2fb162 100644
--- a/src/bookmarks.cpp
+++ b/src/bookmarks.cpp
@@ -112,6 +112,34 @@ BookmarksProvider::BookmarksProvider(KMainWindow* parent)
}
m_manager = KBookmarkManager::managerForExternalFile( bookfile.path() );
m_ac = new KActionCollection( this );
+
+ connect( m_manager, SIGNAL( changed(const QString &, const QString &) ), this, SLOT( slotBookmarksChanged(const QString &) ) );
+}
+
+
+void BookmarksProvider::slotBookmarksChanged(const QString & group)
+{
+ KBookmarkGroup toolbarGroup = m_manager->toolbar();
+// KBookmarkGroup tb = getToolbar(); // heavy for non cached toolbar version
+ kWarning() << "KBookmarkBar::slotBookmarksChanged( " << group << " )";
+
+ if ( toolbarGroup.isNull() )
+ return;
+
+/* if ( KBookmark::commonParent(group, tb.address()) == group) // Is group a parent of tb.address?
+ {
+ */m_bmToolbar->clear();
+ provideBmToolbar(m_bmToolbar);
+// }
+// else
+// {
+// // Iterate recursively into child menus
+// for ( QList<KBookmarkMenu *>::ConstIterator smit = m_lstSubMenus.constBegin(), smend = m_lstSubMenus.constEnd();
+// smit != smend; ++smit )
+// {
+// (*smit)->slotBookmarksChanged( group );
+// }
+// }
}
diff --git a/src/bookmarks.h b/src/bookmarks.h
index d6e74baa..9ef82624 100644
--- a/src/bookmarks.h
+++ b/src/bookmarks.h
@@ -169,6 +169,7 @@ public:
public slots:
void contextMenu(const QPoint & point);
+ void slotBookmarksChanged(const QString &);
private:
KMainWindow *m_parent;