Changeset View
Changeset View
Standalone View
Standalone View
src/debugger.cpp
Show All 18 Lines | |||||
19 | #include <KConfig> | 19 | #include <KConfig> | ||
20 | #include <KConfigGroup> | 20 | #include <KConfigGroup> | ||
21 | #include <KMacroExpander> | 21 | #include <KMacroExpander> | ||
22 | #include <QCoreApplication> | 22 | #include <QCoreApplication> | ||
23 | #include <QDir> | 23 | #include <QDir> | ||
24 | 24 | | |||
25 | #include "crashedapplication.h" | 25 | #include "crashedapplication.h" | ||
26 | #include "drkonqi.h" | 26 | #include "drkonqi.h" | ||
27 | #include "drkonqi_debug.h" | ||||
27 | 28 | | |||
28 | //static | 29 | //static | ||
29 | QList<Debugger> Debugger::availableInternalDebuggers(const QString & backend) | 30 | QList<Debugger> Debugger::availableInternalDebuggers(const QString & backend) | ||
30 | { | 31 | { | ||
31 | return availableDebuggers(QStringLiteral("debuggers/internal"), backend); | 32 | return availableDebuggers(QStringLiteral("debuggers/internal"), backend); | ||
32 | } | 33 | } | ||
33 | 34 | | |||
34 | //static | 35 | //static | ||
35 | QList<Debugger> Debugger::availableExternalDebuggers(const QString & backend) | 36 | QList<Debugger> Debugger::availableExternalDebuggers(const QString & backend) | ||
36 | { | 37 | { | ||
37 | return availableDebuggers(QStringLiteral("debuggers/external"), backend); | 38 | return availableDebuggers(QStringLiteral("debuggers/external"), backend); | ||
38 | } | 39 | } | ||
39 | 40 | | |||
40 | bool Debugger::isValid() const | 41 | bool Debugger::isValid() const | ||
41 | { | 42 | { | ||
42 | return m_config; | 43 | return m_config; | ||
43 | } | 44 | } | ||
44 | 45 | | |||
45 | bool Debugger::isInstalled() const | 46 | bool Debugger::isInstalled() const | ||
46 | { | 47 | { | ||
47 | QString tryexec = tryExec(); | 48 | QString tryexec = tryExec(); | ||
48 | return !tryexec.isEmpty() && !QStandardPaths::findExecutable(tryexec).isEmpty(); | 49 | if(tryexec.isEmpty()) { | ||
50 | qCDebug(DRKONQI_LOG) << "tryExec of" << name() << "is empty!"; | ||||
51 | return false; | ||||
52 | } | ||||
53 | | ||||
54 | // Find for executable in PATH and in our application path | ||||
55 | return !QStandardPaths::findExecutable(tryexec).isEmpty() | ||||
56 | || !QStandardPaths::findExecutable(tryexec, {QCoreApplication::applicationDirPath()}).isEmpty(); | ||||
49 | } | 57 | } | ||
50 | 58 | | |||
51 | QString Debugger::name() const | 59 | QString Debugger::name() const | ||
52 | { | 60 | { | ||
53 | return isValid() ? m_config->group("General").readEntry("Name") : QString(); | 61 | return isValid() ? m_config->group("General").readEntry("Name") : QString(); | ||
54 | } | 62 | } | ||
55 | 63 | | |||
56 | QString Debugger::codeName() const | 64 | QString Debugger::codeName() const | ||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |