diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/baremetal/sdcctoolchain.cpp | 48 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerengine.cpp | 4 | ||||
m--------- | src/shared/qbs | 0 |
3 files changed, 33 insertions, 19 deletions
diff --git a/src/plugins/baremetal/sdcctoolchain.cpp b/src/plugins/baremetal/sdcctoolchain.cpp index 199d8ef0aa..a7b62686c8 100644 --- a/src/plugins/baremetal/sdcctoolchain.cpp +++ b/src/plugins/baremetal/sdcctoolchain.cpp @@ -381,27 +381,41 @@ QList<ToolChain *> SdccToolChainFactory::autoDetect(const QList<ToolChain *> &al if (Utils::HostOsInfo::isWindowsHost()) { -#ifdef Q_OS_WIN64 - static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\SDCC"; -#else - static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\SDCC"; -#endif - - QSettings registry(kRegistryNode, QSettings::NativeFormat); - QString compilerPath = registry.value("Default").toString(); - if (!compilerPath.isEmpty()) { + // Tries to detect the candidate from the 32-bit + // or 64-bit system registry format. + auto probeCandidate = [](QSettings::Format format) { + QSettings registry("HKEY_LOCAL_MACHINE\\SOFTWARE\\SDCC", + format); + QString compilerPath = registry.value("Default").toString(); + if (compilerPath.isEmpty()) + return Candidate{}; // Build full compiler path. compilerPath += "\\bin\\sdcc.exe"; const FilePath fn = FilePath::fromString( QFileInfo(compilerPath).absoluteFilePath()); - if (compilerExists(fn)) { - // Build compiler version. - const QString version = QString("%1.%2.%3").arg( - registry.value("VersionMajor").toString(), - registry.value("VersionMinor").toString(), - registry.value("VersionRevision").toString()); - candidates.push_back({fn, version}); - } + if (!compilerExists(fn)) + return Candidate{}; + // Build compiler version. + const QString version = QString("%1.%2.%3").arg( + registry.value("VersionMajor").toString(), + registry.value("VersionMinor").toString(), + registry.value("VersionRevision").toString()); + return Candidate{fn, version}; + }; + + const QSettings::Format allowedFormats[] = { + QSettings::NativeFormat, +#ifdef Q_OS_WIN + QSettings::Registry32Format, + QSettings::Registry64Format +#endif + }; + + for (const QSettings::Format format : allowedFormats) { + const auto candidate = probeCandidate(format); + if (candidate.compilerPath.isEmpty() || candidates.contains(candidate)) + continue; + candidates.push_back(candidate); } } diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 9d59cc0fe0..8fa02ef988 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2285,8 +2285,8 @@ void DebuggerEngine::openDisassemblerView(const Location &location) void DebuggerEngine::raiseWatchersWindow() { - if (d->m_watchersView) { - if (auto dock = qobject_cast<QDockWidget *>(d->m_watchersView->parentWidget())) { + if (d->m_watchersView && d->m_watchersWindow) { + if (auto dock = qobject_cast<QDockWidget *>(d->m_watchersWindow->parentWidget())) { if (QAction *act = dock->toggleViewAction()) { if (!act->isChecked()) QTimer::singleShot(1, act, [act] { act->trigger(); }); diff --git a/src/shared/qbs b/src/shared/qbs -Subproject 94fe404a5a6d7cf91926bcfbd026953994b2581 +Subproject aec975a3f95f905b2d63ea1500ace28eddea7b9 |