Make use of the help manager's core help engine.

This commit is contained in:
kh1
2010-03-23 17:29:43 +01:00
parent 8d118d3a8d
commit 10a3699ca1
2 changed files with 7 additions and 6 deletions

View File

@@ -28,7 +28,9 @@
**************************************************************************/
#include "bookmarkmanager.h"
#include "centralwidget.h"
#include "helpmanager.h"
#include <QtGui/QMenu>
#include <QtGui/QIcon>
@@ -607,8 +609,7 @@ BookmarkManager::BookmarkManager(QHelpEngineCore* _helpEngine) :
m_folderIcon(QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon)),
m_bookmarkIcon(QLatin1String(":/help/images/bookmark.png")),
treeModel(new BookmarkModel(0, 1, this)),
listModel(new BookmarkModel(0, 1, this)),
helpEngine(_helpEngine)
listModel(new BookmarkModel(0, 1, this))
{
connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this,
SLOT(itemChanged(QStandardItem*)));
@@ -636,7 +637,8 @@ void BookmarkManager::saveBookmarks()
QDataStream stream(&bookmarks, QIODevice::WriteOnly);
readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0);
helpEngine->setCustomValue(QLatin1String("Bookmarks"), bookmarks);
(&Help::HelpManager::helpEngineCore())->setCustomValue(QLatin1String("Bookmarks"),
bookmarks);
}
QStringList BookmarkManager::bookmarkFolders() const
@@ -754,8 +756,8 @@ void BookmarkManager::setupBookmarkModels()
QList<int> lastDepths;
QList<QStandardItem*> parents;
QByteArray ba =
helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray();
QByteArray ba = Help::HelpManager::helpEngineCore()
.customValue(QLatin1String("Bookmarks")).toByteArray();
QDataStream stream(ba);
while (!stream.atEnd()) {
stream >> depth >> name >> type >> expanded;

View File

@@ -190,7 +190,6 @@ private:
BookmarkModel *treeModel;
BookmarkModel *listModel;
QStandardItem *renameItem;
QHelpEngineCore *helpEngine;
};
#endif