summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/analyzerbase/startremotedialog.cpp2
-rw-r--r--src/plugins/debugger/debuggerdialogs.cpp10
-rw-r--r--src/plugins/debugger/loadremotecoredialog.cpp2
-rw-r--r--src/plugins/projectexplorer/profilechooser.cpp15
-rw-r--r--src/plugins/projectexplorer/profilechooser.h11
-rw-r--r--src/plugins/remotelinux/startgdbserverdialog.cpp2
6 files changed, 29 insertions, 13 deletions
diff --git a/src/plugins/analyzerbase/startremotedialog.cpp b/src/plugins/analyzerbase/startremotedialog.cpp
index 7696314413..5d1e3856c1 100644
--- a/src/plugins/analyzerbase/startremotedialog.cpp
+++ b/src/plugins/analyzerbase/startremotedialog.cpp
@@ -69,7 +69,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Remote Analysis"));
- d->profileChooser = new ProfileChooser(this, true);
+ d->profileChooser = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
d->executable = new QLineEdit(this);
d->arguments = new QLineEdit(this);
d->workingDirectory = new QLineEdit(this);
diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp
index 0ad5feddc9..ed5fe952e0 100644
--- a/src/plugins/debugger/debuggerdialogs.cpp
+++ b/src/plugins/debugger/debuggerdialogs.cpp
@@ -215,7 +215,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));
- d->profileComboBox = new ProfileChooser(this, false);
+ d->profileComboBox = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
QFrame *line = new QFrame(this);
line->setFrameShape(QFrame::HLine);
@@ -346,7 +346,7 @@ AttachExternalDialog::AttachExternalDialog(QWidget *parent)
d->filterWidget = new FilterLineEdit(this);
d->filterWidget->setFocus(Qt::TabFocusReason);
- d->profileComboBox = new ProfileChooser(this, true);
+ d->profileComboBox = new ProfileChooser(this, ProfileChooser::LocalDebugging);
d->procView = new QTreeView(this);
d->procView->setAlternatingRowColors(true);
@@ -628,7 +628,7 @@ StartExternalDialog::StartExternalDialog(QWidget *parent)
d->runInTerminalCheckBox = new QCheckBox(this);
- d->profileChooser = new ProfileChooser(this, true);
+ d->profileChooser = new ProfileChooser(this, ProfileChooser::LocalDebugging);
d->breakAtMainCheckBox = new QCheckBox(this);
d->breakAtMainCheckBox->setText(QString());
@@ -939,7 +939,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Debugger"));
- d->profileChooser = new ProfileChooser(this);
+ d->profileChooser = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
d->executablePathChooser = new PathChooser(this);
d->executablePathChooser->setExpectedKind(PathChooser::File);
@@ -1149,7 +1149,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Debugger"));
- d->profileChooser = new ProfileChooser(this);
+ d->profileChooser = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
d->hostLineEdit = new QLineEdit(this);
d->hostLineEdit->setText(QString::fromUtf8("localhost"));
diff --git a/src/plugins/debugger/loadremotecoredialog.cpp b/src/plugins/debugger/loadremotecoredialog.cpp
index 65d567690c..f3fc5aafad 100644
--- a/src/plugins/debugger/loadremotecoredialog.cpp
+++ b/src/plugins/debugger/loadremotecoredialog.cpp
@@ -114,7 +114,7 @@ LoadRemoteCoreFileDialog::LoadRemoteCoreFileDialog(QWidget *parent)
d->deviceComboBox = new QComboBox(this);
- d->profileChooser = new ProfileChooser(this);
+ d->profileChooser = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
d->fileSystemModel = new SftpFileSystemModel(this);
//executablePathChooser = new PathChooser(q);
diff --git a/src/plugins/projectexplorer/profilechooser.cpp b/src/plugins/projectexplorer/profilechooser.cpp
index 15b0180a2e..24b7f5057a 100644
--- a/src/plugins/projectexplorer/profilechooser.cpp
+++ b/src/plugins/projectexplorer/profilechooser.cpp
@@ -43,21 +43,28 @@
namespace ProjectExplorer {
-ProfileChooser::ProfileChooser(QWidget *parent, bool hostAbiOnly) :
+ProfileChooser::ProfileChooser(QWidget *parent, unsigned flags) :
QComboBox(parent)
{
+ populate(flags);
+}
+
+void ProfileChooser::populate(unsigned flags)
+{
+ clear();
const Abi hostAbi = Abi::hostAbi();
foreach (const Profile *profile, ProfileManager::instance()->profiles()) {
- if (!profile->isValid())
+ if (!profile->isValid() && !(flags & IncludeInvalidProfiles))
continue;
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
if (!tc)
continue;
const Abi abi = tc->targetAbi();
- if (hostAbiOnly && hostAbi.os() != abi.os())
+ if ((flags & HostAbiOnly) && hostAbi.os() != abi.os())
continue;
-
const QString debuggerCommand = profile->value(Core::Id("Debugger.Information")).toString();
+ if ((flags & HasDebugger) && debuggerCommand.isEmpty())
+ continue;
const QString completeBase = QFileInfo(debuggerCommand).completeBaseName();
const QString name = tr("%1 (%2)").arg(profile->displayName(), completeBase);
addItem(name, qVariantFromValue(profile->id()));
diff --git a/src/plugins/projectexplorer/profilechooser.h b/src/plugins/projectexplorer/profilechooser.h
index 79011ca04e..2f9cf2dd49 100644
--- a/src/plugins/projectexplorer/profilechooser.h
+++ b/src/plugins/projectexplorer/profilechooser.h
@@ -47,7 +47,15 @@ class PROJECTEXPLORER_EXPORT ProfileChooser : public QComboBox
Q_OBJECT
public:
- explicit ProfileChooser(QWidget *parent, bool hostAbiOnly = false);
+ enum Flags {
+ HostAbiOnly = 0x1,
+ IncludeInvalidProfiles = 0x2,
+ HasDebugger = 0x4,
+ RemoteDebugging = IncludeInvalidProfiles | HasDebugger,
+ LocalDebugging = RemoteDebugging | HostAbiOnly
+ };
+
+ explicit ProfileChooser(QWidget *parent, unsigned flags = 0);
void setCurrentProfileId(Core::Id id);
Core::Id currentProfileId() const;
@@ -55,6 +63,7 @@ public:
Profile *currentProfile() const;
private:
+ void populate(unsigned flags);
Profile *profileAt(int index) const;
};
diff --git a/src/plugins/remotelinux/startgdbserverdialog.cpp b/src/plugins/remotelinux/startgdbserverdialog.cpp
index 7f98f445ed..196a9e3cf3 100644
--- a/src/plugins/remotelinux/startgdbserverdialog.cpp
+++ b/src/plugins/remotelinux/startgdbserverdialog.cpp
@@ -119,7 +119,7 @@ StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q
deviceComboBox = new QComboBox(q);
- profileChooser = new ProfileChooser(q);
+ profileChooser = new ProfileChooser(q, ProfileChooser::RemoteDebugging);
// sysrootPathChooser = new PathChooser(q);
// sysrootPathChooser->setExpectedKind(PathChooser::Directory);
// sysrootPathChooser->setPromptDialogTitle(StartGdbServerDialog::tr("Select Sysroot"));