Changeset View
Changeset View
Standalone View
Standalone View
debugger/pdblauncher.cpp
Show All 32 Lines | |||||
33 | #include <KLocalizedString> | 33 | #include <KLocalizedString> | ||
34 | #include <KMessageBox> | 34 | #include <KMessageBox> | ||
35 | #include <KParts/MainWindow> | 35 | #include <KParts/MainWindow> | ||
36 | #include <KConfigGroup> | 36 | #include <KConfigGroup> | ||
37 | #include <QFileInfo> | 37 | #include <QFileInfo> | ||
38 | 38 | | |||
39 | #include <QDebug> | 39 | #include <QDebug> | ||
40 | #include "debuggerdebug.h" | 40 | #include "debuggerdebug.h" | ||
41 | #include <util/environmentprofilelist.h> | ||||
41 | 42 | | |||
42 | 43 | | |||
43 | namespace Python { | 44 | namespace Python { | ||
44 | 45 | | |||
45 | PdbLauncher::PdbLauncher() | 46 | PdbLauncher::PdbLauncher() | ||
46 | { | 47 | { | ||
47 | 48 | | |||
48 | } | 49 | } | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 110 | { | |||
110 | wd = QUrl::fromLocalFile( QFileInfo( scriptUrl.toLocalFile() ).absolutePath() ); | 111 | wd = QUrl::fromLocalFile( QFileInfo( scriptUrl.toLocalFile() ).absolutePath() ); | ||
111 | } | 112 | } | ||
112 | 113 | | |||
113 | DebugJob* job = new DebugJob(); | 114 | DebugJob* job = new DebugJob(); | ||
114 | job->m_scriptUrl = scriptUrl; | 115 | job->m_scriptUrl = scriptUrl; | ||
115 | job->m_interpreter = interpreter; | 116 | job->m_interpreter = interpreter; | ||
116 | job->m_args = iface->arguments(cfg, err); | 117 | job->m_args = iface->arguments(cfg, err); | ||
117 | job->m_workingDirectory = wd; | 118 | job->m_workingDirectory = wd; | ||
119 | | ||||
120 | const KDevelop::EnvironmentProfileList environmentProfiles(KSharedConfig::openConfig()); | ||||
121 | QString envProfileName = iface->environmentProfileName(cfg); | ||||
122 | | ||||
123 | if (envProfileName.isEmpty()) { | ||||
124 | qCWarning(KDEV_PYTHON_DEBUGGER) << "No environment profile specified, looks like a broken " | ||||
125 | "configuration, please check run configuration " << cfg->name() << | ||||
126 | ". Using default environment profile."; | ||||
127 | envProfileName = environmentProfiles.defaultProfileName(); | ||||
128 | } | ||||
129 | job->m_envProfileName = envProfileName; | ||||
130 | | ||||
118 | QList<KJob*> l; | 131 | QList<KJob*> l; | ||
119 | l << job; | 132 | l << job; | ||
120 | return new KDevelop::ExecuteCompositeJob( KDevelop::ICore::self()->runController(), l ); | 133 | return new KDevelop::ExecuteCompositeJob( KDevelop::ICore::self()->runController(), l ); | ||
121 | } | 134 | } | ||
122 | qCDebug(KDEV_PYTHON_DEBUGGER) << "unknown launch mode"; | 135 | qCDebug(KDEV_PYTHON_DEBUGGER) << "unknown launch mode"; | ||
123 | return nullptr; | 136 | return nullptr; | ||
124 | } | 137 | } | ||
125 | 138 | | |||
126 | QStringList PdbLauncher::supportedModes() const | 139 | QStringList PdbLauncher::supportedModes() const | ||
127 | { | 140 | { | ||
128 | return QStringList() << "debug"; | 141 | return QStringList() << "debug"; | ||
129 | } | 142 | } | ||
130 | 143 | | |||
131 | } | 144 | } |