summaryrefslogtreecommitdiff
path: root/src/bookmarks
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-06-04 23:21:46 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-06-05 00:49:37 +0200
commitdeab0dd37edbc4007a3c2cf32d31811aff0e7e2d (patch)
treeb2a2884a69dd03428cdb9bcf15150a17ebbff867 /src/bookmarks
parentThis should fix the Ctrl+w bug. Anyway, it really doesn't solve it: there is ... (diff)
downloadrekonq-deab0dd37edbc4007a3c2cf32d31811aff0e7e2d.tar.xz
Awesome bar speed up
This commit introduces notable changes and needs a lot of tests Courtesy patch from Mathias Kraus. Thanks :) BUG: 237390
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp14
-rw-r--r--src/bookmarks/bookmarksmanager.h19
2 files changed, 17 insertions, 16 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index c430078b..93bb5386 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -203,7 +203,8 @@ QAction * BookmarkMenu::actionForBookmark(const KBookmark &bookmark)
}
else
{
- Application::bookmarkProvider()->completionObject()->addItem(bookmark.url().url());
+ UrlSearchItem urlSearchItem(UrlSearchItem::Bookmark, bookmark.url().prettyUrl() , bookmark.fullText(), QDateTime(), 1, bookmark.description(), QString());
+ Application::bookmarkProvider()->completionObject()->addItem(urlSearchItem);
return new KBookmarkAction(bookmark, owner(), this);
}
}
@@ -222,7 +223,6 @@ void BookmarkMenu::refill()
addAddBookmarksList();
addNewFolder();
addEditBookmarks();
-
}
else
{
@@ -270,8 +270,9 @@ BookmarkProvider::BookmarkProvider(QObject *parent)
, m_bookmarkMenu(0)
, m_completion(0)
{
+ kDebug() << "Loading Bookmarks Manager...";
// take care of the completion object
- m_completion = new KCompletion;
+ m_completion = new AwesomeUrlCompletion;
m_completion->setOrder(KCompletion::Weighted);
KUrl bookfile = KUrl("~/.kde/share/apps/konqueror/bookmarks.xml"); // share konqueror bookmarks
@@ -299,6 +300,8 @@ BookmarkProvider::BookmarkProvider(QObject *parent)
// setup menu
m_owner = new BookmarkOwner(this);
connect(m_owner, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType &)), this, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType &)));
+
+ kDebug() << "Loading Bookmarks Manager... DONE!";
}
@@ -346,6 +349,7 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString
fillBookmarkBar(bookmarkToolBar);
}
}
+ //TODO: also change completion object
}
@@ -379,7 +383,9 @@ void BookmarkProvider::contextMenu(const QPoint &point)
KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent)
{
KMenu *menu = new KMenu(parent);
+ kDebug() << "new Bookmarks Menu...";
m_bookmarkMenu = new BookmarkMenu(m_manager, m_owner, menu, m_actionCollection);
+ kDebug() << "new Bookmarks Menu...DONE";
KActionMenu *bookmarkActionMenu = new KActionMenu(parent);
bookmarkActionMenu->setMenu(menu);
bookmarkActionMenu->setText(i18n("&Bookmarks"));
@@ -425,7 +431,7 @@ KBookmarkGroup BookmarkProvider::rootGroup()
}
-KCompletion *BookmarkProvider::completionObject() const
+AwesomeUrlCompletion *BookmarkProvider::completionObject() const
{
return m_completion;
}
diff --git a/src/bookmarks/bookmarksmanager.h b/src/bookmarks/bookmarksmanager.h
index ae12280b..dfebebd2 100644
--- a/src/bookmarks/bookmarksmanager.h
+++ b/src/bookmarks/bookmarksmanager.h
@@ -36,13 +36,13 @@
// Local Includes
#include "application.h"
+#include "urlresolver.h"
// Qt Includes
#include <QWidget>
// KDE Includes
#include <KBookmarkOwner>
-#include <KCompletion>
// Forward Declarations
class BookmarkProvider;
@@ -226,19 +226,14 @@ public:
*/
KBookmarkGroup rootGroup();
- KBookmarkManager *bookmarkManager()
- {
- return m_manager;
- }
- BookmarkOwner *bookmarkOwner()
- {
- return m_owner;
- }
+ inline KBookmarkManager *bookmarkManager() { return m_manager; }
+
+ inline BookmarkOwner *bookmarkOwner() { return m_owner; }
/**
- * @returns the KCompletion object.
+ * @returns the AwesomeUrlCompletion object.
*/
- KCompletion *completionObject() const;
+ AwesomeUrlCompletion *completionObject() const;
QString titleForBookmarkUrl(QString url);
@@ -278,7 +273,7 @@ private:
KActionCollection *m_actionCollection;
BookmarkMenu *m_bookmarkMenu;
QList<KToolBar*> m_bookmarkToolBars;
- KCompletion *m_completion;
+ AwesomeUrlCompletion *m_completion;
};