forked from qt-creator/qt-creator
Make use of the help manager's core help engine.
This commit is contained in:
@@ -28,7 +28,9 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "bookmarkmanager.h"
|
#include "bookmarkmanager.h"
|
||||||
|
|
||||||
#include "centralwidget.h"
|
#include "centralwidget.h"
|
||||||
|
#include "helpmanager.h"
|
||||||
|
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
@@ -607,8 +609,7 @@ BookmarkManager::BookmarkManager(QHelpEngineCore* _helpEngine) :
|
|||||||
m_folderIcon(QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon)),
|
m_folderIcon(QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon)),
|
||||||
m_bookmarkIcon(QLatin1String(":/help/images/bookmark.png")),
|
m_bookmarkIcon(QLatin1String(":/help/images/bookmark.png")),
|
||||||
treeModel(new BookmarkModel(0, 1, this)),
|
treeModel(new BookmarkModel(0, 1, this)),
|
||||||
listModel(new BookmarkModel(0, 1, this)),
|
listModel(new BookmarkModel(0, 1, this))
|
||||||
helpEngine(_helpEngine)
|
|
||||||
{
|
{
|
||||||
connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this,
|
connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this,
|
||||||
SLOT(itemChanged(QStandardItem*)));
|
SLOT(itemChanged(QStandardItem*)));
|
||||||
@@ -636,7 +637,8 @@ void BookmarkManager::saveBookmarks()
|
|||||||
QDataStream stream(&bookmarks, QIODevice::WriteOnly);
|
QDataStream stream(&bookmarks, QIODevice::WriteOnly);
|
||||||
|
|
||||||
readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0);
|
readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0);
|
||||||
helpEngine->setCustomValue(QLatin1String("Bookmarks"), bookmarks);
|
(&Help::HelpManager::helpEngineCore())->setCustomValue(QLatin1String("Bookmarks"),
|
||||||
|
bookmarks);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList BookmarkManager::bookmarkFolders() const
|
QStringList BookmarkManager::bookmarkFolders() const
|
||||||
@@ -754,8 +756,8 @@ void BookmarkManager::setupBookmarkModels()
|
|||||||
QList<int> lastDepths;
|
QList<int> lastDepths;
|
||||||
QList<QStandardItem*> parents;
|
QList<QStandardItem*> parents;
|
||||||
|
|
||||||
QByteArray ba =
|
QByteArray ba = Help::HelpManager::helpEngineCore()
|
||||||
helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray();
|
.customValue(QLatin1String("Bookmarks")).toByteArray();
|
||||||
QDataStream stream(ba);
|
QDataStream stream(ba);
|
||||||
while (!stream.atEnd()) {
|
while (!stream.atEnd()) {
|
||||||
stream >> depth >> name >> type >> expanded;
|
stream >> depth >> name >> type >> expanded;
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ private:
|
|||||||
BookmarkModel *treeModel;
|
BookmarkModel *treeModel;
|
||||||
BookmarkModel *listModel;
|
BookmarkModel *listModel;
|
||||||
QStandardItem *renameItem;
|
QStandardItem *renameItem;
|
||||||
QHelpEngineCore *helpEngine;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user