Some more refactoring, reuse existing code.

Reuse the core help engine in the settings pages. Do not setup the gui
help engine at all since any getter will do so. Split update documentation
into smaller pieces for better performance.

Reviewed-by: ck
This commit is contained in:
kh1
2010-03-16 15:48:09 +01:00
parent 37871bc43c
commit 3357458101
6 changed files with 219 additions and 207 deletions

View File

@@ -31,22 +31,18 @@
#define DOCSETTINGSPAGE_H
#include "ui_docsettingspage.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtGui/QWidget>
QT_FORWARD_DECLARE_CLASS(QHelpEngine)
namespace Help {
namespace Internal {
class DocSettingsPage : public Core::IOptionsPage
{
Q_OBJECT
typedef QHash<QString, QString> FilesToNameSpaceHash;
public:
DocSettingsPage(QHelpEngine *helpEngine);
DocSettingsPage();
QString id() const;
QString displayName() const;
@@ -55,14 +51,15 @@ public:
QWidget *createPage(QWidget *parent);
void apply();
void finish() { }
void finish() {}
virtual bool matches(const QString &s) const;
bool applyChanges();
QStringList docsToRegister() const;
QStringList docsToUnregister() const;
signals:
void documentationAdded();
void dialogAccepted();
void documentationChanged();
private slots:
void addDocumentation();
@@ -71,13 +68,16 @@ private slots:
private:
bool eventFilter(QObject *object, QEvent *event);
void removeDocumentation(const QList<QListWidgetItem*> items);
void addItem(const QString &nameSpace, const QString &fileName);
private:
QHelpEngine *m_helpEngine;
bool m_registeredDocs;
QStringList m_removeDocs;
Ui::DocSettingsPage m_ui;
QString m_searchKeywords;
QString m_recentDialogPath;
FilesToNameSpaceHash m_filesToRegister;
FilesToNameSpaceHash m_filesToUnregister;
};
} // namespace Help