Changeset View
Changeset View
Standalone View
Standalone View
plugins/qthelp/qthelpplugin.cpp
Show All 33 Lines | |||||
34 | 34 | | |||
35 | K_PLUGIN_FACTORY_WITH_JSON(QtHelpPluginFactory, "kdevqthelp.json", registerPlugin<QtHelpPlugin>(); ) | 35 | K_PLUGIN_FACTORY_WITH_JSON(QtHelpPluginFactory, "kdevqthelp.json", registerPlugin<QtHelpPlugin>(); ) | ||
36 | 36 | | |||
37 | QtHelpPlugin::QtHelpPlugin(QObject* parent, const QVariantList& args) | 37 | QtHelpPlugin::QtHelpPlugin(QObject* parent, const QVariantList& args) | ||
38 | : KDevelop::IPlugin(QStringLiteral("kdevqthelp"), parent) | 38 | : KDevelop::IPlugin(QStringLiteral("kdevqthelp"), parent) | ||
39 | , m_qtHelpProviders() | 39 | , m_qtHelpProviders() | ||
40 | , m_qtDoc(new QtHelpQtDoc(this, QVariantList())) | 40 | , m_qtDoc(new QtHelpQtDoc(this, QVariantList())) | ||
41 | , m_loadSystemQtDoc(false) | 41 | , m_loadSystemQtDoc(false) | ||
42 | , m_useExternalViewer(false) | ||||
42 | { | 43 | { | ||
mwolff: not needed | |||||
43 | Q_UNUSED(args); | 44 | Q_UNUSED(args); | ||
44 | s_plugin = this; | 45 | s_plugin = this; | ||
45 | connect(this, &QtHelpPlugin::changedProvidersList, KDevelop::ICore::self()->documentationController(), &KDevelop::IDocumentationController::changedDocumentationProviders); | 46 | connect(this, &QtHelpPlugin::changedProvidersList, KDevelop::ICore::self()->documentationController(), &KDevelop::IDocumentationController::changedDocumentationProviders); | ||
46 | QMetaObject::invokeMethod(this, "readConfig", Qt::QueuedConnection); | 47 | QMetaObject::invokeMethod(this, "readConfig", Qt::QueuedConnection); | ||
47 | } | 48 | } | ||
48 | 49 | | |||
49 | QtHelpPlugin::~QtHelpPlugin() | 50 | QtHelpPlugin::~QtHelpPlugin() | ||
50 | { | 51 | { | ||
51 | } | 52 | } | ||
52 | 53 | | |||
53 | 54 | | |||
54 | void QtHelpPlugin::readConfig() | 55 | void QtHelpPlugin::readConfig() | ||
55 | { | 56 | { | ||
56 | QStringList iconList, nameList, pathList, ghnsList; | 57 | QStringList iconList, nameList, pathList, ghnsList; | ||
57 | QString searchDir; | 58 | QString searchDir; | ||
58 | qtHelpReadConfig(iconList, nameList, pathList, ghnsList, searchDir, m_loadSystemQtDoc); | 59 | qtHelpReadConfig(iconList, nameList, pathList, ghnsList, searchDir, m_loadSystemQtDoc, m_useExternalViewer); | ||
59 | 60 | | |||
60 | searchHelpDirectory(pathList, nameList, iconList, searchDir); | 61 | searchHelpDirectory(pathList, nameList, iconList, searchDir); | ||
61 | loadQtHelpProvider(pathList, nameList, iconList); | 62 | loadQtHelpProvider(pathList, nameList, iconList); | ||
62 | loadQtDocumentation(m_loadSystemQtDoc); | 63 | loadQtDocumentation(m_loadSystemQtDoc); | ||
64 | m_qtDoc->setUseExternalViewer(m_useExternalViewer); | ||||
63 | 65 | | |||
64 | emit changedProvidersList(); | 66 | emit changedProvidersList(); | ||
65 | } | 67 | } | ||
66 | 68 | | |||
67 | void QtHelpPlugin::loadQtDocumentation(bool loadQtDoc) | 69 | void QtHelpPlugin::loadQtDocumentation(bool loadQtDoc) | ||
68 | { | 70 | { | ||
69 | if(!loadQtDoc){ | 71 | if(!loadQtDoc){ | ||
70 | m_qtDoc->unloadDocumentation(); | 72 | m_qtDoc->unloadDocumentation(); | ||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 155 | { | |||
154 | return m_qtHelpProviders; | 156 | return m_qtHelpProviders; | ||
155 | } | 157 | } | ||
156 | 158 | | |||
157 | bool QtHelpPlugin::isQtHelpQtDocLoaded() const | 159 | bool QtHelpPlugin::isQtHelpQtDocLoaded() const | ||
158 | { | 160 | { | ||
159 | return m_loadSystemQtDoc; | 161 | return m_loadSystemQtDoc; | ||
160 | } | 162 | } | ||
161 | 163 | | |||
164 | bool QtHelpPlugin::useExternalViewer() const | ||||
165 | { | ||||
166 | return m_useExternalViewer; | ||||
167 | } | ||||
168 | | ||||
162 | bool QtHelpPlugin::isQtHelpAvailable() const | 169 | bool QtHelpPlugin::isQtHelpAvailable() const | ||
163 | { | 170 | { | ||
164 | return !m_qtDoc->qchFiles().isEmpty(); | 171 | return !m_qtDoc->qchFiles().isEmpty(); | ||
165 | } | 172 | } | ||
166 | 173 | | |||
167 | KDevelop::ConfigPage* QtHelpPlugin::configPage(int number, QWidget* parent) | 174 | KDevelop::ConfigPage* QtHelpPlugin::configPage(int number, QWidget* parent) | ||
168 | { | 175 | { | ||
169 | if (number == 0) { | 176 | if (number == 0) { | ||
Show All 11 Lines |
not needed