summaryrefslogtreecommitdiff
path: root/src/bookmarks
diff options
context:
space:
mode:
authorPhaneendra Hegde <pnh.pes@gmail.com>2012-05-27 09:49:35 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-05-27 23:34:32 +0200
commitc4e2c2524615d781e1884123169dfdd928be09d4 (patch)
tree0e6e47f69ec9884ce60c9539217c2bf471a529db /src/bookmarks
parentAdd application icon ( Windows & OS X ). (diff)
downloadrekonq-c4e2c2524615d781e1884123169dfdd928be09d4.tar.xz
Fancy bookmarking on rekonq :)
- Fancy bookmarking's resource link dialog added to bookmark context menu - UI improvements in bookmarks dialog - WARNING: Nepomuk/soprano dependencies added NB: Merged and squashed by adjam ;)
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/bookmarkowner.cpp24
-rw-r--r--src/bookmarks/bookmarkowner.h2
-rw-r--r--src/bookmarks/bookmarkscontextmenu.cpp1
3 files changed, 26 insertions, 1 deletions
diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp
index 141807ca..74683874 100644
--- a/src/bookmarks/bookmarkowner.cpp
+++ b/src/bookmarks/bookmarkowner.cpp
@@ -37,11 +37,15 @@
#include "mainview.h"
#include "mainwindow.h"
#include "webtab.h"
+#include "resourcelinkdialog.h"
// KDE Includes
#include <KBookmarkDialog>
#include <KLocalizedString>
#include <KMessageBox>
+#include <Nepomuk/Resource>
+#include <Nepomuk/Vocabulary/NFO>
+
// Qt Includes
#include <QClipboard>
@@ -86,6 +90,9 @@ KAction* BookmarkOwner::createAction(const KBookmark &bookmark, const BookmarkAc
case EDIT:
return createAction(i18n("Edit"), "configure",
i18n("Edit the bookmark"), SLOT(editBookmark(KBookmark)), bookmark);
+ case FANCYBOOKMARK:
+ return createAction(i18n("Fancy Bookmark"), "nepomuk",
+ i18n("Link Nepomuk resources"), SLOT(fancyBookmark(KBookmark)), bookmark);
case DELETE:
return createAction(i18n("Delete"), "edit-delete",
i18n("Delete the bookmark"), SLOT(deleteBookmark(KBookmark)), bookmark);
@@ -205,13 +212,19 @@ KBookmark BookmarkOwner::bookmarkCurrentPage(const KBookmark &bookmark)
else
{
parent = rApp->bookmarkManager()->rootGroup();
+ Nepomuk::Resource nfoResource;
+ nfoResource = ((QUrl)currentUrl());
+ nfoResource.addType( Nepomuk::Vocabulary::NFO::Website() );
+ nfoResource.setLabel( currentTitle() );
+ qDebug()<<nfoResource.uri();
+
}
KBookmark newBk = parent.addBookmark(currentTitle(), KUrl(currentUrl()));
if (!bookmark.isNull())
parent.moveBookmark(newBk, bookmark);
- m_manager->emitChanged(parent);
+ m_manager->emitChanged(parent);
return newBk;
}
@@ -297,6 +310,13 @@ void BookmarkOwner::editBookmark(KBookmark bookmark)
delete dialog;
}
+void BookmarkOwner::fancyBookmark(KBookmark bookmark)
+{
+ Nepomuk::Resource nfoResource = (KUrl)bookmark.url();
+ Nepomuk::ResourceLinkDialog r( nfoResource );
+ r.exec();
+
+}
bool BookmarkOwner::deleteBookmark(const KBookmark &bookmark)
{
@@ -334,6 +354,8 @@ bool BookmarkOwner::deleteBookmark(const KBookmark &bookmark)
return false;
bmg.deleteBookmark(bookmark);
+ Nepomuk::Resource nfoResource(bookmark.url());
+ nfoResource.remove();
m_manager->emitChanged(bmg);
return true;
}
diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h
index c362fe5e..a9712d55 100644
--- a/src/bookmarks/bookmarkowner.h
+++ b/src/bookmarks/bookmarkowner.h
@@ -60,6 +60,7 @@ public:
NEW_SEPARATOR,
COPY,
EDIT,
+ FANCYBOOKMARK,
DELETE,
NUM_ACTIONS,
SET_TOOLBAR_FOLDER,
@@ -107,6 +108,7 @@ public Q_SLOTS:
void copyLink(const KBookmark &bookmark);
void editBookmark(KBookmark bookmark);
+ void fancyBookmark(KBookmark bookmark);
bool deleteBookmark(const KBookmark &bookmark);
void setToolBarFolder(KBookmark bookmark = KBookmark());
void unsetToolBarFolder();
diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp
index 355a6d7f..bc8f0e3a 100644
--- a/src/bookmarks/bookmarkscontextmenu.cpp
+++ b/src/bookmarks/bookmarkscontextmenu.cpp
@@ -67,6 +67,7 @@ void BookmarksContextMenu::addBookmarkActions()
addSeparator();
addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::EDIT));
+ addAction(m_bmOwner->createAction(bookmark(),BookmarkOwner::FANCYBOOKMARK));
addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::DELETE));
}