diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2010-03-29 18:36:34 +0200 |
---|---|---|
committer | megabigbug <megabigbug@arrakis.(none)> | 2010-03-29 18:36:34 +0200 |
commit | 3be011352dc0f354723269cbc8f07f4d5fbcc3d6 (patch) | |
tree | be795a064f8723c0d58448d77094beebb536f5e6 /src/bookmarks/bookmarksmanager.cpp | |
parent | Merge branch 'master' of git://gitorious.org/rekonq/mainline (diff) | |
parent | rekonq 0.4.57 (diff) | |
download | rekonq-3be011352dc0f354723269cbc8f07f4d5fbcc3d6.tar.xz |
Merge branch 'master' of git://gitorious.org/rekonq/mainline
Diffstat (limited to 'src/bookmarks/bookmarksmanager.cpp')
-rw-r--r-- | src/bookmarks/bookmarksmanager.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp index cfe26a55..89e39ef8 100644 --- a/src/bookmarks/bookmarksmanager.cpp +++ b/src/bookmarks/bookmarksmanager.cpp @@ -161,7 +161,12 @@ BookmarkProvider::BookmarkProvider(QObject *parent) , m_actionCollection(new KActionCollection(this)) , m_bookmarkMenu(0) , m_bookmarkToolBar(0) + , m_completion(0) { + // take care of the completion object + m_completion = new KCompletion; + m_completion->setOrder( KCompletion::Weighted ); + KUrl bookfile = KUrl("~/.kde/share/apps/konqueror/bookmarks.xml"); // share konqueror bookmarks if (!QFile::exists(bookfile.path())) @@ -178,7 +183,9 @@ BookmarkProvider::BookmarkProvider(QObject *parent) bookfile = KUrl(bookmarksPath); } } - m_manager = KBookmarkManager::managerForExternalFile(bookfile.path()); + // A workaround to avoid a long delay between the two changed signals of the bookmark manager + m_manager = KBookmarkManager::managerForFile(bookfile.path(), "rekonq"); + connect(m_manager, SIGNAL(changed(const QString &, const QString &)), this, SLOT(slotBookmarksChanged(const QString &, const QString &))); @@ -220,6 +227,7 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString return; m_bookmarkToolBar->clear(); // FIXME CRASH + m_completion->clear(); KBookmark bookmark = toolBarGroup.first(); while (!bookmark.isNull()) @@ -285,7 +293,8 @@ KAction *BookmarkProvider::fillBookmarkBar(const KBookmark &bookmark) return a; } else - { + { + m_completion->addItem(bookmark.url().path()); return new KBookmarkAction(bookmark, m_owner, this); } } @@ -295,3 +304,8 @@ KBookmarkGroup BookmarkProvider::rootGroup() { return m_manager->root(); } + +KCompletion *BookmarkProvider::completionObject() const +{ + return m_completion; +} |