31
31
#include < memory>
32
32
#include < stdexcept>
33
33
34
- #ifdef DOCS_QTHELP
35
34
namespace MantidQt ::MantidWidgets {
36
35
37
36
using std::string;
38
37
using namespace MantidQt ::API;
39
38
39
+ #ifdef DOCS_QTHELP
40
40
REGISTER_HELPWINDOW (MantidHelpWindow)
41
+ #endif
41
42
42
43
namespace {
43
44
// / static logger
@@ -64,6 +65,8 @@ const QString HTML_BASE_PATH("/");
64
65
// / Page to display if nothing provided
65
66
const QString DEFAULT_PAGENAME (" index" );
66
67
68
+ bool MantidHelpWindow::helpWindowExists () { return !g_helpWindow.isNull (); }
69
+
67
70
/* *
68
71
* Default constructor shows the base index page.
69
72
*/
@@ -299,7 +302,7 @@ void MantidHelpWindow::shutdown() {
299
302
*
300
303
* @param binDir The location of the mantid executable.
301
304
*/
302
- void MantidHelpWindow::findCollectionFile (std::string &binDir) {
305
+ void MantidHelpWindow::findCollectionFile (const std::string &binDir) {
303
306
// this being empty notes the feature being disabled
304
307
m_collectionFile = " " ;
305
308
@@ -316,9 +319,9 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
316
319
}
317
320
318
321
// try where the builds will put it for a single configuration build
319
- searchDir.cdUp ();
322
+ UNUSED_ARG ( searchDir.cdUp () );
320
323
if (searchDir.cd (" docs" )) {
321
- searchDir.cd (" qthelp" );
324
+ UNUSED_ARG ( searchDir.cd (" qthelp" ) );
322
325
path = searchDir.absoluteFilePath (COLLECTION_FILE);
323
326
g_log.debug () << " Trying \" " << path.toStdString () << " \"\n " ;
324
327
if (searchDir.exists (COLLECTION_FILE)) {
@@ -327,9 +330,9 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
327
330
}
328
331
}
329
332
// try where the builds will put it for a multi-configuration build
330
- searchDir.cdUp ();
333
+ UNUSED_ARG ( searchDir.cdUp () );
331
334
if (searchDir.cd (" docs" )) {
332
- searchDir.cd (" qthelp" );
335
+ UNUSED_ARG ( searchDir.cd (" qthelp" ) );
333
336
path = searchDir.absoluteFilePath (COLLECTION_FILE);
334
337
g_log.debug () << " Trying \" " << path.toStdString () << " \"\n " ;
335
338
if (searchDir.exists (COLLECTION_FILE)) {
@@ -340,9 +343,9 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
340
343
341
344
// try in windows/linux install location
342
345
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" ) );
346
349
path = searchDir.absoluteFilePath (COLLECTION_FILE);
347
350
g_log.debug () << " Trying \" " << path.toStdString () << " \"\n " ;
348
351
if (searchDir.exists (COLLECTION_FILE)) {
@@ -352,10 +355,10 @@ void MantidHelpWindow::findCollectionFile(std::string &binDir) {
352
355
353
356
// try a special place for mac/osx
354
357
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" ) );
359
362
path = searchDir.absoluteFilePath (COLLECTION_FILE);
360
363
g_log.debug () << " Trying \" " << path.toStdString () << " \"\n " ;
361
364
if (searchDir.exists (COLLECTION_FILE)) {
@@ -381,4 +384,3 @@ void MantidHelpWindow::determineFileLocs() {
381
384
void MantidHelpWindow::warning (const QString &msg) { g_log.warning (msg.toStdString ()); }
382
385
383
386
} // namespace MantidQt::MantidWidgets
384
- #endif
0 commit comments