forked from qt-creator/qt-creator
Help: Decouple BookmarksWidget from OpenPageManager.
Connect via signal to make it possible to build the shared help code as a static library. Change-Id: If4e9c8ee43eb32e08167c7642f52214643de6d5c Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com> Reviewed-by: Marco Bubke <marco.bubke@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
@@ -472,6 +472,8 @@ void HelpPlugin::setupUi()
|
||||
m_bookmarkItem = new Core::SideBarItem(bookmarkWidget, QLatin1String(SB_BOOKMARKS));
|
||||
connect(bookmarkWidget, SIGNAL(linkActivated(QUrl)), m_centralWidget,
|
||||
SLOT(setSource(QUrl)));
|
||||
connect(bookmarkWidget, SIGNAL(createPage(QUrl,bool)), &OpenPagesManager::instance(),
|
||||
SLOT(createPage(QUrl,bool)));
|
||||
|
||||
shortcut = new QShortcut(m_splitter);
|
||||
shortcut->setWhatsThis(tr("Activate Bookmarks in Help mode"));
|
||||
|
@@ -32,9 +32,7 @@
|
||||
|
||||
#include "bookmarkmanager.h"
|
||||
|
||||
#include "centralwidget.h"
|
||||
#include "localhelpmanager.h"
|
||||
#include "openpagesmanager.h"
|
||||
|
||||
#include <utils/filterlineedit.h>
|
||||
#include <utils/styledbar.h>
|
||||
@@ -406,7 +404,7 @@ void BookmarkWidget::customContextMenuRequested(const QPoint &point)
|
||||
emit linkActivated(data);
|
||||
}
|
||||
else if (pickedAction == showItemNewTab) {
|
||||
OpenPagesManager::instance().createPage(data);
|
||||
emit createPage(QUrl(data), false);
|
||||
}
|
||||
else if (pickedAction == removeItem) {
|
||||
bookmarkManager->removeBookmarkItem(treeView,
|
||||
@@ -569,7 +567,7 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e)
|
||||
|| (me->button() == Qt::MidButton)) {
|
||||
QString data = index.data(Qt::UserRole + 10).toString();
|
||||
if (!data.isEmpty() && data != QLatin1String("Folder"))
|
||||
OpenPagesManager::instance().createPage(data);
|
||||
emit createPage(QUrl(data), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -119,6 +119,7 @@ public:
|
||||
signals:
|
||||
void addBookmark();
|
||||
void linkActivated(const QUrl &url);
|
||||
void createPage(const QUrl &url, bool fromSearch);
|
||||
|
||||
private slots:
|
||||
void removeClicked();
|
||||
|
Reference in New Issue
Block a user