summaryrefslogtreecommitdiffstats
path: root/src/ftvhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ftvhelp.cpp')
-rw-r--r--src/ftvhelp.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index 5d1061c..a8f9de3 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -31,6 +31,7 @@
#include "language.h"
#include "htmlgen.h"
#include "layout.h"
+#include "pagedef.h"
#define MAX_INDENT 1024
@@ -849,10 +850,17 @@ void FTVHelp::generateTreeViewScripts()
QCString &projName = Config_getString("PROJECT_NAME");
if (projName.isEmpty())
{
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::MainPage);
- t << "\"" << convertToJSString(lne->title()) << "\", ";
+ if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty()) // Use title of main page as root
+ {
+ t << "\"" << convertToJSString(Doxygen::mainPage->title()) << "\", ";
+ }
+ else // Use default section title as root
+ {
+ LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::MainPage);
+ t << "\"" << convertToJSString(lne->title()) << "\", ";
+ }
}
- else
+ else // use PROJECT_NAME as root tree element
{
t << "\"" << convertToJSString(projName) << "\", ";
}