Skip to content

Commit 009dbf0

Browse files
committed
fix: EPM Help->Contents opened nothing
Same docsRoot() bugs as TAC: hardcoded 'Program Files (x86)' path, appName always falling back to hardcoded default since QCoreApplication::applicationName() is never set, and missing the 'external' HTML subfolder in the generated docs path. Fixed by deriving the install folder name from QCoreApplication::applicationDirPath(), correcting the Program Files path, and pointing at docs/external/.
1 parent f543594 commit 009dbf0

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/libraries/qcommon/ApplicationEnhancements.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,26 @@ void startLocalBrowser(const QString &filePath)
143143
QString docsRoot()
144144
{
145145
QString result;
146-
QString appName;
147146

148-
appName = QCoreApplication::applicationName();
149-
if (appName.isEmpty())
150-
appName = "QEPM";
147+
// Derive the actual install folder name ("Alpaca", "QEPM", "QTAC", ...)
148+
// from where this binary is running, i.e. .../Qualcomm/<X>/<exe> -> "<X>".
149+
// This is more reliable than QCoreApplication::applicationName(), which
150+
// is rarely set explicitly and silently falls back to a hardcoded
151+
// default otherwise.
152+
QString appName = "QEPM";
153+
QDir binDir(QCoreApplication::applicationDirPath());
154+
if (binDir.exists())
155+
{
156+
const QString folderName = binDir.dirName();
157+
if (folderName.isEmpty() == false)
158+
appName = folderName;
159+
}
151160

152161
#ifdef Q_OS_WINDOWS
153-
result = "C:\\Program Files (x86)\\Qualcomm\\" + appName + "\\docs\\";
162+
result = "C:/Program Files/Qualcomm/" + appName + "/docs/external/";
154163
#endif
155164
#ifdef Q_OS_LINUX
156-
result = "/opt/qcom/" + appName + "/docs";
165+
result = "/opt/qcom/" + appName + "/docs/external";
157166
#endif
158167
return result;
159168
}

0 commit comments

Comments
 (0)