diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/application.cpp | 20 | ||||
-rw-r--r-- | src/application.h | 6 | ||||
-rw-r--r-- | src/bookmarks/bookmarkmanager.cpp (renamed from src/bookmarks/bookmarkprovider.cpp) | 76 | ||||
-rw-r--r-- | src/bookmarks/bookmarkmanager.h (renamed from src/bookmarks/bookmarkprovider.h) | 27 | ||||
-rw-r--r-- | src/bookmarks/bookmarkowner.cpp | 6 | ||||
-rw-r--r-- | src/bookmarks/bookmarkscontextmenu.cpp | 13 | ||||
-rw-r--r-- | src/bookmarks/bookmarkspanel.cpp | 8 | ||||
-rw-r--r-- | src/bookmarks/bookmarkstoolbar.cpp | 24 | ||||
-rw-r--r-- | src/bookmarks/bookmarkstreemodel.cpp | 15 | ||||
-rw-r--r-- | src/mainwindow.cpp | 12 | ||||
-rw-r--r-- | src/newtabpage.cpp | 6 | ||||
-rw-r--r-- | src/sync/syncmanager.cpp | 8 | ||||
-rw-r--r-- | src/urlbar/bookmarkwidget.cpp | 6 | ||||
-rw-r--r-- | src/urlbar/favoritewidget.cpp | 2 | ||||
-rw-r--r-- | src/urlbar/urlbar.cpp | 10 | ||||
-rw-r--r-- | src/urlbar/urlresolver.cpp | 4 | ||||
-rw-r--r-- | src/webview.cpp | 13 |
18 files changed, 149 insertions, 109 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f8a6124a..11f079a6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,7 +52,7 @@ SET( rekonq_KDEINIT_SRCS settings/webkitwidget.cpp settings/networkwidget.cpp #---------------------------------------- - bookmarks/bookmarkprovider.cpp + bookmarks/bookmarkmanager.cpp bookmarks/bookmarkspanel.cpp bookmarks/bookmarkstreemodel.cpp bookmarks/bookmarkscontextmenu.cpp diff --git a/src/application.cpp b/src/application.cpp index 768f25a2..5c6e9659 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -38,7 +38,7 @@ // Local Includes #include "adblockmanager.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "downloadmanager.h" #include "filterurljob.h" #include "historymanager.h" @@ -109,11 +109,11 @@ Application::~Application() m_historyManager.clear(); } - if (!m_bookmarkProvider.isNull()) + if (!m_bookmarkManager.isNull()) { - kDebug() << "deleting bookmark Provider"; - delete m_bookmarkProvider.data(); - m_bookmarkProvider.clear(); + kDebug() << "deleting bookmark Manager"; + delete m_bookmarkManager.data(); + m_bookmarkManager.clear(); } if (!m_sessionManager.isNull()) @@ -293,7 +293,7 @@ int Application::newInstance() historyManager(); // bookmarks loading - connect(bookmarkProvider(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), + connect(bookmarkManager(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), instance(), SLOT(loadUrl(const KUrl&, const Rekonq::OpenType&))); // crash recovering @@ -351,13 +351,13 @@ HistoryManager *Application::historyManager() } -BookmarkProvider *Application::bookmarkProvider() +BookmarkManager *Application::bookmarkManager() { - if (m_bookmarkProvider.isNull()) + if (m_bookmarkManager.isNull()) { - m_bookmarkProvider = new BookmarkProvider; + m_bookmarkManager = new BookmarkManager; } - return m_bookmarkProvider.data(); + return m_bookmarkManager.data(); } diff --git a/src/application.h b/src/application.h index 6a67ca61..ee1a6430 100644 --- a/src/application.h +++ b/src/application.h @@ -45,7 +45,7 @@ // Forward Declarations class AdBlockManager; -class BookmarkProvider; +class BookmarkManager; class DownloadManager; class HistoryManager; class IconManager; @@ -90,7 +90,7 @@ public: MainWindowList mainWindowList(); HistoryManager *historyManager(); - BookmarkProvider *bookmarkProvider(); + BookmarkManager *bookmarkManager(); SessionManager *sessionManager(); AdBlockManager *adblockManager(); OpenSearchManager *opensearchManager(); @@ -137,7 +137,7 @@ private Q_SLOTS: private: QWeakPointer<HistoryManager> m_historyManager; - QWeakPointer<BookmarkProvider> m_bookmarkProvider; + QWeakPointer<BookmarkManager> m_bookmarkManager; QWeakPointer<SessionManager> m_sessionManager; QWeakPointer<AdBlockManager> m_adblockManager; QWeakPointer<OpenSearchManager> m_opensearchManager; diff --git a/src/bookmarks/bookmarkprovider.cpp b/src/bookmarks/bookmarkmanager.cpp index 262941d8..49c697a5 100644 --- a/src/bookmarks/bookmarkprovider.cpp +++ b/src/bookmarks/bookmarkmanager.cpp @@ -28,8 +28,8 @@ // Self Includes -#include "bookmarkprovider.h" -#include "bookmarkprovider.moc" +#include "bookmarkmanager.h" +#include "bookmarkmanager.moc" // Local Includes #include "application.h" @@ -48,7 +48,7 @@ #include <QtCore/QFile> -BookmarkProvider::BookmarkProvider(QObject *parent) +BookmarkManager::BookmarkManager(QObject *parent) : QObject(parent) , m_manager(0) , m_owner(0) @@ -70,25 +70,24 @@ BookmarkProvider::BookmarkProvider(QObject *parent) } connect(m_manager, SIGNAL(changed(const QString &, const QString &)), this, SLOT(slotBookmarksChanged())); - connect(m_manager, SIGNAL(changed(const QString &, const QString &)), this, SIGNAL(changed())); // setup menu m_owner = new BookmarkOwner(m_manager, this); connect(m_owner, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), this, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&))); - KAction *a = KStandardAction::addBookmark(bookmarkOwner(), SLOT(bookmarkCurrentPage()), this); + KAction *a = KStandardAction::addBookmark(m_owner, SLOT(bookmarkCurrentPage()), this); m_actionCollection->addAction(QL1S("rekonq_add_bookmark"), a); } -BookmarkProvider::~BookmarkProvider() +BookmarkManager::~BookmarkManager() { delete m_manager; } -KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent) +KActionMenu* BookmarkManager::bookmarkActionMenu(QWidget *parent) { KMenu *menu = new KMenu(parent); KActionMenu *bookmarkActionMenu = new KActionMenu(menu); @@ -101,7 +100,7 @@ KActionMenu* BookmarkProvider::bookmarkActionMenu(QWidget *parent) } -void BookmarkProvider::registerBookmarkBar(BookmarkToolBar *toolbar) +void BookmarkManager::registerBookmarkBar(BookmarkToolBar *toolbar) { if (m_bookmarkToolBars.contains(toolbar)) return; @@ -110,13 +109,13 @@ void BookmarkProvider::registerBookmarkBar(BookmarkToolBar *toolbar) } -void BookmarkProvider::removeBookmarkBar(BookmarkToolBar *toolbar) +void BookmarkManager::removeBookmarkBar(BookmarkToolBar *toolbar) { m_bookmarkToolBars.removeOne(toolbar); } -void BookmarkProvider::registerBookmarkPanel(BookmarksPanel *panel) +void BookmarkManager::registerBookmarkPanel(BookmarksPanel *panel) { if (panel && !m_bookmarkPanels.contains(panel)) { @@ -126,7 +125,7 @@ void BookmarkProvider::registerBookmarkPanel(BookmarksPanel *panel) } -void BookmarkProvider::removeBookmarkPanel(BookmarksPanel *panel) +void BookmarkManager::removeBookmarkPanel(BookmarksPanel *panel) { if (!panel) return; @@ -135,11 +134,11 @@ void BookmarkProvider::removeBookmarkPanel(BookmarksPanel *panel) panel->disconnect(this); if (m_bookmarkPanels.isEmpty()) - rApp->bookmarkProvider()->bookmarkManager()->emitChanged(); + emitChanged(); } -QAction* BookmarkProvider::actionByName(const QString &name) +QAction* BookmarkManager::actionByName(const QString &name) { QAction *action = m_actionCollection->action(name); if (action) @@ -148,17 +147,17 @@ QAction* BookmarkProvider::actionByName(const QString &name) } -KBookmarkGroup BookmarkProvider::rootGroup() +KBookmarkGroup BookmarkManager::rootGroup() { return m_manager->root(); } -QList<KBookmark> BookmarkProvider::find(const QString &text) +QList<KBookmark> BookmarkManager::find(const QString &text) { QList<KBookmark> list; - KBookmarkGroup root = rApp->bookmarkProvider()->rootGroup(); + KBookmarkGroup root = rootGroup(); if (!root.isNull()) for (KBookmark bookmark = root.first(); !bookmark.isNull(); bookmark = root.next(bookmark)) find(&list, bookmark, text); @@ -167,7 +166,7 @@ QList<KBookmark> BookmarkProvider::find(const QString &text) } -KBookmark BookmarkProvider::bookmarkForUrl(const KUrl &url) +KBookmark BookmarkManager::bookmarkForUrl(const KUrl &url) { KBookmarkGroup root = rootGroup(); if (root.isNull()) @@ -177,7 +176,7 @@ KBookmark BookmarkProvider::bookmarkForUrl(const KUrl &url) } -void BookmarkProvider::slotBookmarksChanged() +void BookmarkManager::slotBookmarksChanged() { Q_FOREACH(BookmarkToolBar * bookmarkToolBar, m_bookmarkToolBars) { @@ -195,7 +194,7 @@ void BookmarkProvider::slotBookmarksChanged() } -void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar) +void BookmarkManager::fillBookmarkBar(BookmarkToolBar *toolBar) { KBookmarkGroup root = m_manager->toolbar(); if (root.isNull()) @@ -207,7 +206,7 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar) { KBookmarkActionMenu *menuAction = new KBookmarkActionMenu(bookmark.toGroup(), this); menuAction->setDelayed(false); - BookmarkMenu *bMenu = new BookmarkMenu(bookmarkManager(), bookmarkOwner(), menuAction->menu(), bookmark.address()); + BookmarkMenu *bMenu = new BookmarkMenu(m_manager, m_owner, menuAction->menu(), bookmark.address()); bMenu->setParent(menuAction->menu()); connect(menuAction->menu(), SIGNAL(aboutToShow()), toolBar, SLOT(menuDisplayed())); @@ -232,19 +231,22 @@ void BookmarkProvider::fillBookmarkBar(BookmarkToolBar *toolBar) } -void BookmarkProvider::slotPanelChanged() +void BookmarkManager::slotPanelChanged() { Q_FOREACH(BookmarksPanel * panel, m_bookmarkPanels) { if (panel && panel != sender()) panel->loadFoldedState(); } - if (rApp->mainWindow() && rApp->mainWindow()->currentTab() && rApp->mainWindow()->currentTab()->url().toMimeDataString().contains("about:bookmarks")) + if (rApp->mainWindow() + && rApp->mainWindow()->currentTab() + && rApp->mainWindow()->currentTab()->url().toMimeDataString().contains("about:bookmarks") + ) rApp->loadUrl(KUrl("about:bookmarks"), Rekonq::CurrentTab); } -void BookmarkProvider::find(QList<KBookmark> *list, const KBookmark &bookmark, const QString &text) +void BookmarkManager::find(QList<KBookmark> *list, const KBookmark &bookmark, const QString &text) { if (bookmark.isGroup()) { @@ -271,7 +273,7 @@ void BookmarkProvider::find(QList<KBookmark> *list, const KBookmark &bookmark, c } -KBookmark BookmarkProvider::bookmarkForUrl(const KBookmark &bookmark, const KUrl &url) +KBookmark BookmarkManager::bookmarkForUrl(const KBookmark &bookmark, const KUrl &url) { KBookmark found; @@ -295,7 +297,7 @@ KBookmark BookmarkProvider::bookmarkForUrl(const KBookmark &bookmark, const KUrl } -void BookmarkProvider::copyBookmarkGroup(const KBookmarkGroup &groupToCopy, KBookmarkGroup destGroup) +void BookmarkManager::copyBookmarkGroup(const KBookmarkGroup &groupToCopy, KBookmarkGroup destGroup) { KBookmark bookmark = groupToCopy.first(); while (!bookmark.isNull()) @@ -321,3 +323,27 @@ void BookmarkProvider::copyBookmarkGroup(const KBookmarkGroup &groupToCopy, KBoo bookmark = groupToCopy.next(bookmark); } } + + +void BookmarkManager::slotEditBookmarks() +{ + m_manager->slotEditBookmarks(); +} + + +KBookmark BookmarkManager::findByAddress(const QString &address) +{ + return m_manager->findByAddress(address); +} + + +void BookmarkManager::openFolderinTabs(const KBookmarkGroup &bm) +{ + m_owner->openFolderinTabs(bm); +} + + +void BookmarkManager::emitChanged() +{ + m_manager->emitChanged(); +} diff --git a/src/bookmarks/bookmarkprovider.h b/src/bookmarks/bookmarkmanager.h index db7efe45..b00a4b0e 100644 --- a/src/bookmarks/bookmarkprovider.h +++ b/src/bookmarks/bookmarkmanager.h @@ -27,13 +27,16 @@ * ============================================================ */ -#ifndef BOOKMARKPROVIDER_H -#define BOOKMARKPROVIDER_H +#ifndef BOOKMARK_MANAGER_H +#define BOOKMARK_MANAGER_H // Rekonq Includes #include "rekonq_defines.h" +// KDE Includes +#include <KBookmark> + // Qt Includes #include <QObject> @@ -46,7 +49,6 @@ class BookmarkMenu; class KAction; class KActionCollection; class KActionMenu; -class KBookmark; class KBookmarkGroup; class KBookmarkManager; class KUrl; @@ -60,7 +62,7 @@ class QAction; * from this class. * So it implements code to have each one. */ -class BookmarkProvider : public QObject +class BookmarkManager : public QObject { Q_OBJECT @@ -71,8 +73,8 @@ public: * (actually konqueror's bookmarks). * @param parent The MainWindow to provide bookmarks objects. */ - BookmarkProvider(QObject *parent = 0); - ~BookmarkProvider(); + BookmarkManager(QObject *parent = 0); + ~BookmarkManager(); /** * @short Get the Bookmarks Menu Action @@ -106,12 +108,12 @@ public: */ KBookmarkGroup rootGroup(); - inline KBookmarkManager* bookmarkManager() + inline KBookmarkManager* manager() { return m_manager; } - inline BookmarkOwner* bookmarkOwner() + inline BookmarkOwner* owner() { return m_owner; } @@ -120,6 +122,10 @@ public: KBookmark bookmarkForUrl(const KUrl &url); + KBookmark findByAddress(const QString &); + void openFolderinTabs(const KBookmarkGroup &bm); + void emitChanged(); + public Q_SLOTS: /** * @short Waits for signal that the group with the address has been modified by the caller. @@ -132,6 +138,8 @@ public Q_SLOTS: void slotBookmarksChanged(); void fillBookmarkBar(BookmarkToolBar *toolBar); + void slotEditBookmarks(); + private Q_SLOTS: void slotPanelChanged(); @@ -140,7 +148,6 @@ Q_SIGNALS: * @short This signal is emitted when an url has to be loaded */ void openUrl(const KUrl &, const Rekonq::OpenType &); - void emitChanged(); private: void find(QList<KBookmark> *list, const KBookmark &bookmark, const QString &text); @@ -155,4 +162,4 @@ private: }; -#endif // BOOKMARKPROVIDER_H +#endif // BOOKMARK_MANAGER_H diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp index 40b070dd..0d3894e5 100644 --- a/src/bookmarks/bookmarkowner.cpp +++ b/src/bookmarks/bookmarkowner.cpp @@ -33,7 +33,7 @@ // Local Includes #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "mainview.h" #include "mainwindow.h" #include "webtab.h" @@ -204,7 +204,7 @@ KBookmark BookmarkOwner::bookmarkCurrentPage(const KBookmark &bookmark) } else { - parent = rApp->bookmarkProvider()->rootGroup(); + parent = rApp->bookmarkManager()->rootGroup(); } KBookmark newBk = parent.addBookmark(currentTitle(), KUrl(currentUrl())); @@ -267,7 +267,7 @@ KBookmark BookmarkOwner::newSeparator(const KBookmark &bookmark) } else { - newBk = rApp->bookmarkProvider()->rootGroup().createNewSeparator(); + newBk = rApp->bookmarkManager()->rootGroup().createNewSeparator(); } newBk.setIcon("edit-clear"); diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp index 735e3412..355a6d7f 100644 --- a/src/bookmarks/bookmarkscontextmenu.cpp +++ b/src/bookmarks/bookmarkscontextmenu.cpp @@ -29,14 +29,19 @@ // Local Includes #include "bookmarkowner.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "application.h" // KDE Includes #include <KBookmarkManager> -BookmarksContextMenu::BookmarksContextMenu(const KBookmark &bookmark, KBookmarkManager *manager, BookmarkOwner *owner, bool nullForced, QWidget *parent) +BookmarksContextMenu::BookmarksContextMenu(const KBookmark &bookmark, + KBookmarkManager *manager, + BookmarkOwner *owner, + bool nullForced, + QWidget *parent + ) : KBookmarkContextMenu(bookmark, manager, owner, parent) , m_bmOwner(owner) , m_nullForced(nullForced) @@ -120,8 +125,8 @@ void BookmarksContextMenu::addSeparatorActions() void BookmarksContextMenu::addNullActions() { - KBookmarkManager *manager = rApp->bookmarkProvider()->bookmarkManager(); - if (manager->toolbar().hasParent()) + KBookmarkManager *mngr = rApp->bookmarkManager()->manager(); + if (mngr->toolbar().hasParent()) { addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::UNSET_TOOLBAR_FOLDER)); } diff --git a/src/bookmarks/bookmarkspanel.cpp b/src/bookmarks/bookmarkspanel.cpp index eb46119e..85d75402 100644 --- a/src/bookmarks/bookmarkspanel.cpp +++ b/src/bookmarks/bookmarkspanel.cpp @@ -34,7 +34,7 @@ // Local Includes #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "bookmarkstreemodel.h" #include "bookmarkscontextmenu.h" #include "bookmarkowner.h" @@ -75,8 +75,8 @@ void BookmarksPanel::contextMenu(const QPoint &pos) return; BookmarksContextMenu menu(bookmarkForIndex(panelTreeView()->indexAt(pos)), - rApp->bookmarkProvider()->bookmarkManager(), - rApp->bookmarkProvider()->bookmarkOwner() + rApp->bookmarkManager()->manager(), + rApp->bookmarkManager()->owner() ); menu.exec(panelTreeView()->mapToGlobal(pos)); @@ -89,7 +89,7 @@ void BookmarksPanel::deleteBookmark() if (_loadingState || !index.isValid()) return; - rApp->bookmarkProvider()->bookmarkOwner()->deleteBookmark(bookmarkForIndex(index)); + rApp->bookmarkManager()->owner()->deleteBookmark(bookmarkForIndex(index)); } diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp index 5fc76561..56793248 100644 --- a/src/bookmarks/bookmarkstoolbar.cpp +++ b/src/bookmarks/bookmarkstoolbar.cpp @@ -34,7 +34,7 @@ #include "bookmarkscontextmenu.h" #include "mainwindow.h" #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "bookmarkowner.h" #include "webtab.h" @@ -136,7 +136,7 @@ void BookmarkMenu::addOpenFolderInTabs() if (!bookmark.isNull()) { - parentMenu()->addAction(rApp->bookmarkProvider()->bookmarkOwner()->createAction(group, BookmarkOwner::OPEN_FOLDER)); + parentMenu()->addAction(rApp->bookmarkManager()->owner()->createAction(group, BookmarkOwner::OPEN_FOLDER)); } } } @@ -164,14 +164,14 @@ BookmarkToolBar::BookmarkToolBar(KToolBar *toolBar, QObject *parent) { toolBar->setContextMenuPolicy(Qt::CustomContextMenu); connect(toolBar, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenu(const QPoint &))); - connect(rApp->bookmarkProvider()->bookmarkManager(), SIGNAL(changed(QString, QString)), this, SLOT(hideMenu())); + connect(rApp->bookmarkManager()->manager(), SIGNAL(changed(QString, QString)), this, SLOT(hideMenu())); toolBar->setAcceptDrops(true); toolBar->installEventFilter(this); toolBar->setShortcutEnabled(false); if (toolBar->isVisible()) { - rApp->bookmarkProvider()->fillBookmarkBar(this); + rApp->bookmarkManager()->fillBookmarkBar(this); m_filled = true; } } @@ -186,7 +186,7 @@ KToolBar* BookmarkToolBar::toolBar() void BookmarkToolBar::contextMenu(const QPoint &point) { KBookmarkActionInterface *action = dynamic_cast<KBookmarkActionInterface*>(toolBar()->actionAt(point)); - KBookmark bookmark = rApp->bookmarkProvider()->bookmarkManager()->toolbar(); + KBookmark bookmark = rApp->bookmarkManager()->manager()->toolbar(); bool nullAction = true; if (action) { @@ -195,8 +195,8 @@ void BookmarkToolBar::contextMenu(const QPoint &point) } BookmarksContextMenu menu(bookmark, - rApp->bookmarkProvider()->bookmarkManager(), - rApp->bookmarkProvider()->bookmarkOwner(), + rApp->bookmarkManager()->manager(), + rApp->bookmarkManager()->owner(), nullAction); menu.exec(toolBar()->mapToGlobal(point)); } @@ -252,7 +252,7 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) { if (!m_filled) { - rApp->bookmarkProvider()->fillBookmarkBar(this); + rApp->bookmarkManager()->fillBookmarkBar(this); m_filled = true; } } @@ -388,7 +388,7 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) { QDropEvent *dropEvent = static_cast<QDropEvent*>(event); KBookmark bookmark; - KBookmarkGroup root = rApp->bookmarkProvider()->bookmarkManager()->toolbar(); + KBookmarkGroup root = rApp->bookmarkManager()->manager()->toolbar(); if (m_checkedAction) { @@ -399,7 +399,7 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) if (dropEvent->mimeData()->hasFormat("application/rekonq-bookmark")) { QByteArray addresses = dropEvent->mimeData()->data("application/rekonq-bookmark"); - bookmark = rApp->bookmarkProvider()->bookmarkManager()->findByAddress(QString::fromLatin1(addresses.data())); + bookmark = rApp->bookmarkManager()->findByAddress(QString::fromLatin1(addresses.data())); if (bookmark.isNull()) return false; } @@ -481,7 +481,7 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) } - rApp->bookmarkProvider()->bookmarkManager()->emitChanged(); + rApp->bookmarkManager()->emitChanged(); } } else @@ -493,7 +493,7 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event) root.moveBookmark(bookmark, KBookmark()); } - rApp->bookmarkProvider()->bookmarkManager()->emitChanged(); + rApp->bookmarkManager()->emitChanged(); } dropEvent->accept(); } diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp index 8e6104a4..56cab7bf 100644 --- a/src/bookmarks/bookmarkstreemodel.cpp +++ b/src/bookmarks/bookmarkstreemodel.cpp @@ -31,7 +31,7 @@ // Local Includes #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "iconmanager.h" // KDE Includes @@ -167,7 +167,8 @@ BookmarksTreeModel::BookmarksTreeModel(QObject *parent) , m_root(0) { resetModel(); - connect(rApp->bookmarkProvider()->bookmarkManager(), SIGNAL(changed(const QString &, const QString &)), this, SLOT(bookmarksChanged(const QString &))); + connect(rApp->bookmarkManager()->manager(), SIGNAL(changed(const QString &, const QString &)), + this, SLOT(bookmarksChanged(const QString &))); } @@ -285,13 +286,13 @@ bool BookmarksTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction acti return false; QByteArray addresses = data->data("application/rekonq-bookmark"); - KBookmark bookmark = rApp->bookmarkProvider()->bookmarkManager()->findByAddress(QString::fromLatin1(addresses.data())); + KBookmark bookmark = rApp->bookmarkManager()->findByAddress(QString::fromLatin1(addresses.data())); KBookmarkGroup root; if (parent.isValid()) root = bookmarkForIndex(parent).toGroup(); else - root = rApp->bookmarkProvider()->rootGroup(); + root = rApp->bookmarkManager()->rootGroup(); QModelIndex destIndex = index(row, column, parent); @@ -305,7 +306,7 @@ bool BookmarksTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction acti root.addBookmark(bookmark); } - rApp->bookmarkProvider()->bookmarkManager()->emitChanged(); + rApp->bookmarkManager()->emitChanged(); return true; } @@ -356,7 +357,7 @@ void BookmarksTreeModel::bookmarksChanged(const QString &groupAddress) node = node->child(i); nodeIndex = index(i, 0, nodeIndex); } - populate(node, rApp->bookmarkProvider()->bookmarkManager()->findByAddress(groupAddress).toGroup()); + populate(node, rApp->bookmarkManager()->findByAddress(groupAddress).toGroup()); endResetModel(); } @@ -366,7 +367,7 @@ void BookmarksTreeModel::bookmarksChanged(const QString &groupAddress) void BookmarksTreeModel::resetModel() { - setRoot(rApp->bookmarkProvider()->rootGroup()); + setRoot(rApp->bookmarkManager()->rootGroup()); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c46fbc68..b1556ed5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -38,7 +38,7 @@ #include "adblockmanager.h" #include "analyzerpanel.h" #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "bookmarkspanel.h" #include "bookmarkstoolbar.h" #include "downloadmanager.h" @@ -226,8 +226,8 @@ MainWindow::~MainWindow() { m_hidePopupTimer->stop(); - rApp->bookmarkProvider()->removeBookmarkBar(m_bookmarksBar); - rApp->bookmarkProvider()->removeBookmarkPanel(m_bookmarksPanel); + rApp->bookmarkManager()->removeBookmarkBar(m_bookmarksBar); + rApp->bookmarkManager()->removeBookmarkPanel(m_bookmarksPanel); rApp->removeMainWindow(this); } @@ -255,7 +255,7 @@ void MainWindow::initBookmarkBar() if (m_bookmarksBar) { - rApp->bookmarkProvider()->removeBookmarkBar(m_bookmarksBar); + rApp->bookmarkManager()->removeBookmarkBar(m_bookmarksBar); delete m_bookmarksBar; } m_bookmarksBar = new BookmarkToolBar(XMLGUIBkBar, this); @@ -495,7 +495,7 @@ void MainWindow::setupActions() connect(a, SIGNAL(triggered(bool)), m_view->tabBar(), SLOT(detachTab())); // Bookmark Menu - KActionMenu *bmMenu = rApp->bookmarkProvider()->bookmarkActionMenu(this); + KActionMenu *bmMenu = rApp->bookmarkManager()->bookmarkActionMenu(this); bmMenu->setIcon(KIcon("bookmarks")); bmMenu->setDelayed(false); bmMenu->setShortcutConfigurable(true); @@ -582,7 +582,7 @@ void MainWindow::setupPanels() addDockWidget(Qt::LeftDockWidgetArea, m_bookmarksPanel); - rApp->bookmarkProvider()->registerBookmarkPanel(m_bookmarksPanel); + rApp->bookmarkManager()->registerBookmarkPanel(m_bookmarksPanel); // setup bookmarks panel action a = (KAction *) m_bookmarksPanel->toggleViewAction(); diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 4929c9be..52b83bbd 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -34,7 +34,7 @@ // Local Includes #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "downloadmanager.h" #include "historymodels.h" #include "mainview.h" @@ -124,7 +124,7 @@ void NewTabPage::generate(const KUrl &url) } if (url == KUrl("about:bookmarks/edit")) { - rApp->bookmarkProvider()->bookmarkManager()->slotEditBookmarks(); + rApp->bookmarkManager()->slotEditBookmarks(); return; } @@ -464,7 +464,7 @@ void NewTabPage::bookmarksPage() KIconLoader::Toolbar); m_root.document().findFirst(QL1S("#actions")).appendInside(editBookmarks); - KBookmarkGroup bookGroup = rApp->bookmarkProvider()->rootGroup(); + KBookmarkGroup bookGroup = rApp->bookmarkManager()->rootGroup(); if (bookGroup.isNull()) { m_root.addClass(QL1S("empty")); diff --git a/src/sync/syncmanager.cpp b/src/sync/syncmanager.cpp index f4a2fdf4..fe4ffc43 100644 --- a/src/sync/syncmanager.cpp +++ b/src/sync/syncmanager.cpp @@ -33,7 +33,7 @@ // Local Includes #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "historymanager.h" #include "syncwidget.h" @@ -68,8 +68,8 @@ void SyncManager::loadSettings() // bookmarks ReKonfig::syncBookmarks() - ? connect(rApp->bookmarkProvider(), SIGNAL(changed()), this, SLOT(syncBookmarks())) - : disconnect(rApp->bookmarkProvider(), SIGNAL(changed()), this, SLOT(syncBookmarks())) + ? connect(rApp->bookmarkManager(), SIGNAL(changed()), this, SLOT(syncBookmarks())) + : disconnect(rApp->bookmarkManager(), SIGNAL(changed()), this, SLOT(syncBookmarks())) ; // history @@ -81,7 +81,7 @@ void SyncManager::loadSettings() else { // bookmarks - disconnect(rApp->bookmarkProvider(), SIGNAL(changed()), this, SLOT(syncBookmarks())); + disconnect(rApp->bookmarkManager(), SIGNAL(changed()), this, SLOT(syncBookmarks())); // history disconnect(rApp->historyManager(), SIGNAL(historySaved()), this, SLOT(syncHistory())); diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp index 5beecb4c..c144b8d0 100644 --- a/src/urlbar/bookmarkwidget.cpp +++ b/src/urlbar/bookmarkwidget.cpp @@ -30,7 +30,7 @@ // Local includes #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "bookmarkowner.h" // KDE Includes @@ -119,7 +119,7 @@ void BookmarkWidget::accept() if (!m_bookmark->isNull() && m_name->text() != m_bookmark->fullText()) { m_bookmark->setFullText(m_name->text()); - rApp->bookmarkProvider()->bookmarkManager()->emitChanged(); + rApp->bookmarkManager()->emitChanged(); } close(); } @@ -127,7 +127,7 @@ void BookmarkWidget::accept() void BookmarkWidget::removeBookmark() { - rApp->bookmarkProvider()->bookmarkOwner()->deleteBookmark(*m_bookmark); + rApp->bookmarkManager()->owner()->deleteBookmark(*m_bookmark); close(); emit updateIcon(); diff --git a/src/urlbar/favoritewidget.cpp b/src/urlbar/favoritewidget.cpp index da94410d..f72deace 100644 --- a/src/urlbar/favoritewidget.cpp +++ b/src/urlbar/favoritewidget.cpp @@ -33,7 +33,7 @@ // Local includes #include "application.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "bookmarkowner.h" // KDE Includes diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 9460cf8a..e95c5c33 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -41,7 +41,7 @@ #include "webpage.h" #include "webview.h" #include "completionwidget.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "bookmarkowner.h" #include "bookmarkwidget.h" #include "iconmanager.h" @@ -397,11 +397,11 @@ void UrlBar::showBookmarkInfo(QPoint pos) if (_tab->url().scheme() == QL1S("about")) return; - KBookmark bookmark = rApp->bookmarkProvider()->bookmarkForUrl(_tab->url()); + KBookmark bookmark = rApp->bookmarkManager()->bookmarkForUrl(_tab->url()); if (bookmark.isNull()) { - bookmark = rApp->bookmarkProvider()->bookmarkOwner()->bookmarkCurrentPage(); + bookmark = rApp->bookmarkManager()->owner()->bookmarkCurrentPage(); updateRightIcons(); } else @@ -549,7 +549,7 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic) rightIcon->setToolTip(i18n("Show SSL Info")); break; case UrlBar::BK: - if (rApp->bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull()) + if (rApp->bookmarkManager()->bookmarkForUrl(_tab->url()).isNull()) { rightIcon->setIcon(KIcon("bookmarks").pixmap(32, 32, QIcon::Disabled)); rightIcon->setToolTip(i18n("Bookmark this page")); @@ -678,7 +678,7 @@ void UrlBar::bookmarkContextMenu(QPoint pos) KMenu menu(this); QAction *qa; - if (!rApp->bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull()) + if (!rApp->bookmarkManager()->bookmarkForUrl(_tab->url()).isNull()) { qa = new KAction(KIcon("bookmarks"), i18n("Edit Bookmark"), this); connect(qa, SIGNAL(triggered(bool)), this, SLOT(showBookmarkDialog())); diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index 073cc728..425f233f 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -30,7 +30,7 @@ // Local Includes #include "historymanager.h" -#include "bookmarkprovider.h" +#include "bookmarkmanager.h" #include "searchengine.h" // KDE Includes @@ -352,7 +352,7 @@ void UrlResolver::computeHistory() // bookmarks void UrlResolver::computeBookmarks() { - QList<KBookmark> found = rApp->bookmarkProvider()->find(_typedString); + QList<KBookmark> found = rApp->bookmarkManager()->find(_typedString); Q_FOREACH(const KBookmark & b, found) { UrlSearchItem gItem(UrlSearchItem::Bookmark, b.url().url(), b.fullText()); diff --git a/src/webview.cpp b/src/webview.cpp index e524ae24..012f77eb 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -34,8 +34,7 @@ // Local Includes #include "application.h" -#include "bookmarkprovider.h" -#include "bookmarkowner.h" +#include "bookmarkmanager.h" #include "iconmanager.h" #include "mainview.h" #include "mainwindow.h" @@ -117,6 +116,7 @@ WebView::~WebView() preview.save(path); } + void WebView::changeWindowIcon() { if (ReKonfig::useFavicon()) @@ -130,6 +130,7 @@ void WebView::changeWindowIcon() } } + WebPage *WebView::page() { WebPage *const page = qobject_cast<WebPage *>(KWebView::page()); @@ -483,10 +484,10 @@ void WebView::dropEvent(QDropEvent *event) if (event->mimeData()->hasFormat("application/rekonq-bookmark")) { QByteArray addresses = event->mimeData()->data("application/rekonq-bookmark"); - KBookmark bookmark = rApp->bookmarkProvider()->bookmarkManager()->findByAddress(QString::fromLatin1(addresses.data())); + KBookmark bookmark = rApp->bookmarkManager()->findByAddress(QString::fromLatin1(addresses.data())); if (bookmark.isGroup()) { - rApp->bookmarkProvider()->bookmarkOwner()->openFolderinTabs(bookmark.toGroup()); + rApp->bookmarkManager()->openFolderinTabs(bookmark.toGroup()); } else { @@ -603,8 +604,8 @@ void WebView::bookmarkLink() KAction *a = qobject_cast<KAction*>(sender()); KUrl url(a->data().toUrl()); - rApp->bookmarkProvider()->rootGroup().addBookmark(url.prettyUrl(), url); - rApp->bookmarkProvider()->bookmarkManager()->emitChanged(); + rApp->bookmarkManager()->rootGroup().addBookmark(url.prettyUrl(), url); + rApp->bookmarkManager()->emitChanged(); } |