diff options
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/bookmarkowner.cpp | 24 | ||||
-rw-r--r-- | src/bookmarks/bookmarkowner.h | 5 | ||||
-rw-r--r-- | src/bookmarks/bookmarkprovider.cpp | 12 | ||||
-rw-r--r-- | src/bookmarks/bookmarkprovider.h | 12 | ||||
-rw-r--r-- | src/bookmarks/bookmarkspanel.cpp | 4 | ||||
-rw-r--r-- | src/bookmarks/bookmarkspanel.h | 15 | ||||
-rw-r--r-- | src/bookmarks/bookmarkstoolbar.cpp | 24 | ||||
-rw-r--r-- | src/bookmarks/bookmarkstoolbar.h | 6 | ||||
-rw-r--r-- | src/bookmarks/bookmarkstreemodel.cpp | 14 |
9 files changed, 67 insertions, 49 deletions
diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp index de193d41..bfca6ef3 100644 --- a/src/bookmarks/bookmarkowner.cpp +++ b/src/bookmarks/bookmarkowner.cpp @@ -61,36 +61,36 @@ KAction* BookmarkOwner::createAction(const KBookmark &bookmark, const BookmarkAc { case OPEN: return createAction(i18n("Open"), "tab-new", - i18n("Open bookmark in current tab"), SLOT(openBookmark(const KBookmark &)), bookmark); + i18n("Open bookmark in current tab"), SLOT(openBookmark(const KBookmark &)), bookmark); case OPEN_IN_TAB: return createAction(i18n("Open in New Tab"), "tab-new", - i18n("Open bookmark in new tab"), SLOT(openBookmarkInNewTab(const KBookmark &)), bookmark); + i18n("Open bookmark in new tab"), SLOT(openBookmarkInNewTab(const KBookmark &)), bookmark); case OPEN_IN_WINDOW: return createAction(i18n("Open in New Window"), "window-new", - i18n("Open bookmark in new window"), SLOT(openBookmarkInNewWindow(const KBookmark &)), bookmark); + i18n("Open bookmark in new window"), SLOT(openBookmarkInNewWindow(const KBookmark &)), bookmark); case OPEN_FOLDER: return createAction(i18n("Open Folder in Tabs"), "tab-new", - i18n("Open all the bookmarks in folder in tabs"), SLOT(openBookmarkFolder(const KBookmark &)), bookmark); + i18n("Open all the bookmarks in folder in tabs"), SLOT(openBookmarkFolder(const KBookmark &)), bookmark); case BOOKMARK_PAGE: return createAction(i18n("Add Bookmark"), "bookmark-new", - i18n("Bookmark current page"), SLOT(bookmarkCurrentPage(const KBookmark &)), bookmark); + i18n("Bookmark current page"), SLOT(bookmarkCurrentPage(const KBookmark &)), bookmark); case NEW_FOLDER: return createAction(i18n("New Folder"), "folder-new", - i18n("Create a new bookmark folder"), SLOT(newBookmarkFolder(const KBookmark &)), bookmark); + i18n("Create a new bookmark folder"), SLOT(newBookmarkFolder(const KBookmark &)), bookmark); case NEW_SEPARATOR: return createAction(i18n("New Separator"), "edit-clear", - i18n("Create a new bookmark separator"), SLOT(newSeparator(const KBookmark &)), bookmark); + i18n("Create a new bookmark separator"), SLOT(newSeparator(const KBookmark &)), bookmark); case COPY: return createAction(i18n("Copy Link"), "edit-copy", - i18n("Copy the bookmark's link address"), SLOT(copyLink(const KBookmark &)), bookmark); + i18n("Copy the bookmark's link address"), SLOT(copyLink(const KBookmark &)), bookmark); case EDIT: return createAction(i18n("Edit"), "configure", - i18n("Edit the bookmark"), SLOT(editBookmark(const KBookmark &)), bookmark); + i18n("Edit the bookmark"), SLOT(editBookmark(const KBookmark &)), bookmark); case DELETE: - return createAction(i18n("Delete"), "edit-delete", - i18n("Delete the bookmark"), SLOT(deleteBookmark(const KBookmark &)), bookmark); + return createAction(i18n("Delete"), "edit-delete", + i18n("Delete the bookmark"), SLOT(deleteBookmark(const KBookmark &)), bookmark); default: - return 0; + return 0; } } diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h index 16fc111f..918e25d1 100644 --- a/src/bookmarks/bookmarkowner.h +++ b/src/bookmarks/bookmarkowner.h @@ -79,7 +79,10 @@ public: virtual QList< QPair<QString, QString> > currentBookmarkList() const; // @} - virtual bool supportsTabs() const {return true;} + virtual bool supportsTabs() const + { + return true; + } // @{ /** diff --git a/src/bookmarks/bookmarkprovider.cpp b/src/bookmarks/bookmarkprovider.cpp index d58fd29a..6d7a6440 100644 --- a/src/bookmarks/bookmarkprovider.cpp +++ b/src/bookmarks/bookmarkprovider.cpp @@ -199,7 +199,7 @@ void BookmarkProvider::slotBookmarksChanged() fillBookmarkBar(bookmarkToolBar); } } - if(rApp->mainWindow()->currentTab()->url().toMimeDataString().contains("about:bookmarks")) + if (rApp->mainWindow()->currentTab()->url().toMimeDataString().contains("about:bookmarks")) rApp->loadUrl(KUrl("about:bookmarks"), Rekonq::CurrentTab); } @@ -232,7 +232,7 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar) else { KBookmarkAction *action = new KBookmarkAction(bookmark, m_owner, this); - action->setIcon(rApp->iconManager()->iconForUrl( KUrl(bookmark.url()) )); + action->setIcon(rApp->iconManager()->iconForUrl(KUrl(bookmark.url()))); connect(action, SIGNAL(hovered()), toolBar, SLOT(actionHovered())); toolBar->toolBar()->addAction(action); toolBar->toolBar()->widgetForAction(action)->installEventFilter(toolBar); @@ -243,12 +243,12 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar) void BookmarkProvider::slotPanelChanged() { - foreach (BookmarksPanel *panel, m_bookmarkPanels) + foreach(BookmarksPanel *panel, m_bookmarkPanels) { if (panel && panel != sender()) panel->loadFoldedState(); } - if(rApp->mainWindow()->currentTab()->url().toMimeDataString().contains("about:bookmarks")) + if (rApp->mainWindow()->currentTab()->url().toMimeDataString().contains("about:bookmarks")) rApp->loadUrl(KUrl("about:bookmarks"), Rekonq::CurrentTab); } @@ -265,10 +265,10 @@ void BookmarkProvider::find(QList<KBookmark> *list, const KBookmark &bookmark, c { QStringList words = text.split(' '); bool matches = true; - foreach (const QString &word, words) + foreach(const QString &word, words) { if (!bookmark.url().url().contains(word, Qt::CaseInsensitive) - && !bookmark.fullText().contains(word, Qt::CaseInsensitive)) + && !bookmark.fullText().contains(word, Qt::CaseInsensitive)) { matches = false; break; diff --git a/src/bookmarks/bookmarkprovider.h b/src/bookmarks/bookmarkprovider.h index 3e63bd2f..e0dee7a5 100644 --- a/src/bookmarks/bookmarkprovider.h +++ b/src/bookmarks/bookmarkprovider.h @@ -106,9 +106,15 @@ public: */ KBookmarkGroup rootGroup(); - inline KBookmarkManager* bookmarkManager() { return m_manager; } + inline KBookmarkManager* bookmarkManager() + { + return m_manager; + } - inline BookmarkOwner* bookmarkOwner() { return m_owner; } + inline BookmarkOwner* bookmarkOwner() + { + return m_owner; + } QList<KBookmark> find(const QString &text); @@ -128,7 +134,7 @@ public Q_SLOTS: private Q_SLOTS: void slotPanelChanged(); - + Q_SIGNALS: /** * @short This signal is emitted when an url has to be loaded diff --git a/src/bookmarks/bookmarkspanel.cpp b/src/bookmarks/bookmarkspanel.cpp index a7d6daf8..94a3de94 100644 --- a/src/bookmarks/bookmarkspanel.cpp +++ b/src/bookmarks/bookmarkspanel.cpp @@ -74,7 +74,7 @@ void BookmarksPanel::contextMenu(const QPoint &pos) if (_loadingState) return; - BookmarksContextMenu menu(bookmarkForIndex( panelTreeView()->indexAt(pos) ), + BookmarksContextMenu menu(bookmarkForIndex(panelTreeView()->indexAt(pos)), rApp->bookmarkProvider()->bookmarkManager(), rApp->bookmarkProvider()->bookmarkOwner() ); @@ -129,7 +129,7 @@ void BookmarksPanel::setup() void BookmarksPanel::loadFoldedState(const QModelIndex &root) { QAbstractItemModel *model = panelTreeView()->model(); - if(!model) + if (!model) return; int count = model->rowCount(root); diff --git a/src/bookmarks/bookmarkspanel.h b/src/bookmarks/bookmarkspanel.h index 2a3942d7..06873b1a 100644 --- a/src/bookmarks/bookmarkspanel.h +++ b/src/bookmarks/bookmarkspanel.h @@ -60,9 +60,18 @@ Q_SIGNALS: private Q_SLOTS: void contextMenu(const QPoint &pos); - virtual void contextMenuItem (const QPoint &pos) {contextMenu(pos);} - virtual void contextMenuGroup (const QPoint &pos) {contextMenu(pos);} - virtual void contextMenuEmpty (const QPoint &pos) {contextMenu(pos);} + virtual void contextMenuItem(const QPoint &pos) + { + contextMenu(pos); + } + virtual void contextMenuGroup(const QPoint &pos) + { + contextMenu(pos); + } + virtual void contextMenuEmpty(const QPoint &pos) + { + contextMenu(pos); + } void deleteBookmark(); void onCollapse(const QModelIndex &index); diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp index 8c19c96f..072f9db7 100644 --- a/src/bookmarks/bookmarkstoolbar.cpp +++ b/src/bookmarks/bookmarkstoolbar.cpp @@ -92,7 +92,7 @@ QAction * BookmarkMenu::actionForBookmark(const KBookmark &bookmark) else { KBookmarkAction *action = new KBookmarkAction(bookmark, owner(), this); - action->setIcon(rApp->iconManager()->iconForUrl( KUrl(bookmark.url()) )); + action->setIcon(rApp->iconManager()->iconForUrl(KUrl(bookmark.url()))); connect(action, SIGNAL(hovered()), this, SLOT(actionHovered())); return action; } @@ -157,12 +157,12 @@ void BookmarkMenu::actionHovered() BookmarkToolBar::BookmarkToolBar(KToolBar *toolBar, QObject *parent) - : QObject(parent) - , m_toolBar(toolBar) - , m_currentMenu(0) - , m_dragAction(0) - , m_dropAction(0) - , m_filled(false) + : QObject(parent) + , m_toolBar(toolBar) + , m_currentMenu(0) + , m_dragAction(0) + , m_dropAction(0) + , m_filled(false) { toolBar->setContextMenuPolicy(Qt::CustomContextMenu); connect(toolBar, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenu(const QPoint &))); @@ -220,7 +220,7 @@ void BookmarkToolBar::menuHidden() void BookmarkToolBar::hideMenu() { - if(m_currentMenu) + if (m_currentMenu) m_currentMenu->hide(); } @@ -367,7 +367,7 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) QWidget *widgetAction = toolBar()->widgetForAction(destAction); if (destBookmarkAction && !destBookmarkAction->bookmark().isNull() && widgetAction - && bookmark.address() != destBookmarkAction->bookmark().address()) + && bookmark.address() != destBookmarkAction->bookmark().address()) { KBookmark destBookmark = destBookmarkAction->bookmark(); @@ -430,9 +430,9 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) if (action && action->bookmark().isGroup() && distance < QApplication::startDragDistance()) { - KBookmarkActionMenu *menu = dynamic_cast<KBookmarkActionMenu *>(toolBar()->actionAt(m_startDragPos)); - QPoint actionPos = toolBar()->mapToGlobal(toolBar()->widgetForAction(menu)->pos()); - menu->menu()->popup(QPoint(actionPos.x(), actionPos.y() + toolBar()->widgetForAction(menu)->height())); + KBookmarkActionMenu *menu = dynamic_cast<KBookmarkActionMenu *>(toolBar()->actionAt(m_startDragPos)); + QPoint actionPos = toolBar()->mapToGlobal(toolBar()->widgetForAction(menu)->pos()); + menu->menu()->popup(QPoint(actionPos.x(), actionPos.y() + toolBar()->widgetForAction(menu)->height())); } } } diff --git a/src/bookmarks/bookmarkstoolbar.h b/src/bookmarks/bookmarkstoolbar.h index d7d1cee9..83e4605f 100644 --- a/src/bookmarks/bookmarkstoolbar.h +++ b/src/bookmarks/bookmarkstoolbar.h @@ -85,10 +85,10 @@ class BookmarkToolBar : public QObject Q_OBJECT public: -BookmarkToolBar(KToolBar *toolBar, QObject *parent); -~BookmarkToolBar(); + BookmarkToolBar(KToolBar *toolBar, QObject *parent); + ~BookmarkToolBar(); -KToolBar* toolBar(); + KToolBar* toolBar(); protected: bool eventFilter(QObject *watched, QEvent *event); diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp index 0478a714..8d82e2b0 100644 --- a/src/bookmarks/bookmarkstreemodel.cpp +++ b/src/bookmarks/bookmarkstreemodel.cpp @@ -334,20 +334,20 @@ void BookmarksTreeModel::bookmarksChanged(const QString &groupAddress) BtmItem *node = m_root; QModelIndex nodeIndex; - QStringList indexChain( groupAddress.split('/', QString::SkipEmptyParts) ); + QStringList indexChain(groupAddress.split('/', QString::SkipEmptyParts)); bool ok; int i; - foreach (const QString &sIndex, indexChain) + foreach(const QString &sIndex, indexChain) { - i = sIndex.toInt( &ok ); - if( !ok ) + i = sIndex.toInt(&ok); + if (!ok) break; - if( i < 0 || i >= node->childCount() ) + if (i < 0 || i >= node->childCount()) break; - node = node->child( i ); - nodeIndex = index( i, 0, nodeIndex ); + node = node->child(i); + nodeIndex = index(i, 0, nodeIndex); } populate(node, rApp->bookmarkProvider()->bookmarkManager()->findByAddress(groupAddress).toGroup()); endResetModel(); |