Skip to content

Commit 77fecbc

Browse files
Get the code to compile
1 parent 441a395 commit 77fecbc

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

qt/widgets/common/inc/MantidQtWidgets/Common/MantidHelpWindow.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
class QHelpEngine;
1717
class QString;
1818
class QWidget;
19-
#ifdef DOCS_QTHELP
2019
class pqHelpWindow;
21-
#endif
20+
2221
namespace MantidQt {
2322
namespace MantidWidgets {
2423

@@ -55,10 +54,8 @@ public slots:
5554

5655
/// The full path of the collection file.
5756
std::string m_collectionFile;
58-
#ifdef DOCS_QTHELP
5957
/// The window that renders the help information
6058
static QPointer<pqHelpWindow> g_helpWindow;
61-
#endif
6259
/// Whether this is the very first startup of the helpwindow.
6360
bool m_firstRun;
6461

qt/widgets/common/src/InterfaceManager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,11 @@ void InterfaceManager::showCustomInterfaceHelp(const QString &name, const QStrin
281281
void InterfaceManager::showWebPage(const QString &url) { MantidDesktopServices::openUrl(url); }
282282

283283
void InterfaceManager::closeHelpWindow() {
284+
#ifdef DOCS_QTHELP
284285
if (MantidHelpWindow::helpWindowExists()) {
286+
#else
287+
if (true) {
288+
#endif
285289
auto window = createHelpWindow();
286290
if (window)
287291
window->shutdown();

qt/widgets/common/src/MantidHelpWindow.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
#include <memory>
3232
#include <stdexcept>
3333

34-
#ifdef DOCS_QTHELP
3534
namespace MantidQt::MantidWidgets {
3635

3736
using std::string;
3837
using namespace MantidQt::API;
3938

39+
#ifdef DOCS_QTHELP
4040
REGISTER_HELPWINDOW(MantidHelpWindow)
41+
#endif
4142

4243
namespace {
4344
/// static logger
@@ -64,6 +65,8 @@ const QString HTML_BASE_PATH("/");
6465
/// Page to display if nothing provided
6566
const QString DEFAULT_PAGENAME("index");
6667

68+
bool MantidHelpWindow::helpWindowExists() { return !g_helpWindow.isNull(); }
69+
6770
/**
6871
* Default constructor shows the base index page.
6972
*/
@@ -299,7 +302,7 @@ void MantidHelpWindow::shutdown() {
299302
*
300303
* @param binDir The location of the mantid executable.
301304
*/
302-
void MantidHelpWindow::findCollectionFile(std::string &binDir) {
305+
void MantidHelpWindow::findCollectionFile(const std::string &binDir) {
303306
// this being empty notes the feature being disabled
304307
m_collectionFile = "";
305308

@@ -316,9 +319,9 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
316319
}
317320

318321
// try where the builds will put it for a single configuration build
319-
searchDir.cdUp();
322+
UNUSED_ARG(searchDir.cdUp());
320323
if (searchDir.cd("docs")) {
321-
searchDir.cd("qthelp");
324+
UNUSED_ARG(searchDir.cd("qthelp"));
322325
path = searchDir.absoluteFilePath(COLLECTION_FILE);
323326
g_log.debug() << "Trying \"" << path.toStdString() << "\"\n";
324327
if (searchDir.exists(COLLECTION_FILE)) {
@@ -327,9 +330,9 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
327330
}
328331
}
329332
// try where the builds will put it for a multi-configuration build
330-
searchDir.cdUp();
333+
UNUSED_ARG(searchDir.cdUp());
331334
if (searchDir.cd("docs")) {
332-
searchDir.cd("qthelp");
335+
UNUSED_ARG(searchDir.cd("qthelp"));
333336
path = searchDir.absoluteFilePath(COLLECTION_FILE);
334337
g_log.debug() << "Trying \"" << path.toStdString() << "\"\n";
335338
if (searchDir.exists(COLLECTION_FILE)) {
@@ -340,9 +343,9 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
340343

341344
// try in windows/linux install location
342345
searchDir = QDir(QString::fromStdString(binDir));
343-
searchDir.cdUp();
344-
searchDir.cd("share");
345-
searchDir.cd("doc");
346+
UNUSED_ARG(searchDir.cdUp());
347+
UNUSED_ARG(searchDir.cd("share"));
348+
UNUSED_ARG(searchDir.cd("doc"));
346349
path = searchDir.absoluteFilePath(COLLECTION_FILE);
347350
g_log.debug() << "Trying \"" << path.toStdString() << "\"\n";
348351
if (searchDir.exists(COLLECTION_FILE)) {
@@ -352,10 +355,10 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
352355

353356
// try a special place for mac/osx
354357
searchDir = QDir(QString::fromStdString(binDir));
355-
searchDir.cdUp();
356-
searchDir.cdUp();
357-
searchDir.cd("share");
358-
searchDir.cd("doc");
358+
UNUSED_ARG(searchDir.cdUp());
359+
UNUSED_ARG(searchDir.cdUp());
360+
UNUSED_ARG(searchDir.cd("share"));
361+
UNUSED_ARG(searchDir.cd("doc"));
359362
path = searchDir.absoluteFilePath(COLLECTION_FILE);
360363
g_log.debug() << "Trying \"" << path.toStdString() << "\"\n";
361364
if (searchDir.exists(COLLECTION_FILE)) {
@@ -381,4 +384,3 @@ void MantidHelpWindow::determineFileLocs() {
381384
void MantidHelpWindow::warning(const QString &msg) { g_log.warning(msg.toStdString()); }
382385

383386
} // namespace MantidQt::MantidWidgets
384-
#endif

qt/widgets/common/src/PythonHelpWindow.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include "MantidQtWidgets/Common/PythonHelpWindow.h"
2+
#include "MantidKernel/RegistrationHelper.h"
3+
#include "MantidQtWidgets/Common/InterfaceManager.h"
24
#include "MantidQtWidgets/Common/PythonHelpBridge.h"
35
#include <QString>
46
#include <string>

0 commit comments

Comments
 (0)