summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2023-03-23 11:43:23 +0100
committerDavid Schulz <david.schulz@qt.io>2023-03-23 11:37:56 +0000
commit75bdaf25d044750af44cb8cc491f53f4af7ac01f (patch)
treed72668195f2c6eba8e63763b77d5cfdd8e212306
parentcd3c7e368d338b4bc3a1b10c0196cde64e370a1a (diff)
downloadqt-creator-75bdaf25d044750af44cb8cc491f53f4af7ac01f.tar.gz
Debugger: enable dependency action only if we can find depends
Change-Id: I1f8c8d4108a1e3c6a03b93c9cf280c005806fc44 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/debugger/moduleshandler.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp
index 9ae6b068af..6e7496bd37 100644
--- a/src/plugins/debugger/moduleshandler.cpp
+++ b/src/plugins/debugger/moduleshandler.cpp
@@ -140,6 +140,12 @@ public:
DebuggerEngine *engine;
};
+static bool dependsCanBeFound()
+{
+ static bool dependsInPath = Environment::systemEnvironment().searchInPath("depends").isEmpty();
+ return dependsInPath;
+}
+
bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev)
{
ModuleItem *item = itemForIndexAtLevel<1>(ev.sourceModelIndex());
@@ -163,11 +169,13 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev)
moduleNameValid && enabled && canReload,
[this, modulePath] { engine->loadSymbols(modulePath); });
- // FIXME: Dependencies only available on Windows, when "depends" is installed.
addAction(this, menu, Tr::tr("Show Dependencies of \"%1\"").arg(moduleName),
Tr::tr("Show Dependencies"),
- moduleNameValid && !moduleName.isEmpty() && HostOsInfo::isWindowsHost(),
- [modulePath] { QtcProcess::startDetached({{"depends"}, {modulePath.toString()}}); });
+ moduleNameValid && !modulePath.needsDevice() && modulePath.exists()
+ && dependsCanBeFound(),
+ [modulePath] {
+ QtcProcess::startDetached({{"depends"}, {modulePath.toString()}});
+ });
addAction(this, menu, Tr::tr("Load Symbols for All Modules"),
enabled && canLoadSymbols,