From 4af55bc4b0aa43aa2ce375df2a3f4c7f34f9a694 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 27 Feb 2015 11:53:16 +0100 Subject: [PATCH] Analyzer: Don't offer non-supported kits in StartRemoteDialog. Without this patch, the dialog offers e.g. the Desktop kit and then analyzing fails with an SSH-related message that will make no sense to users. Change-Id: Id8791f402c8e8e6c6803dc4cc16b89b38cf1fe33 Reviewed-by: hjk --- src/plugins/analyzerbase/startremotedialog.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/plugins/analyzerbase/startremotedialog.cpp b/src/plugins/analyzerbase/startremotedialog.cpp index a7cc9c68d9e..e971e6a7ee2 100644 --- a/src/plugins/analyzerbase/startremotedialog.cpp +++ b/src/plugins/analyzerbase/startremotedialog.cpp @@ -46,10 +46,24 @@ using namespace Utils; namespace Analyzer { namespace Internal { +class SshKitChooser : public KitChooser +{ +public: + SshKitChooser(QWidget *parent = 0) : KitChooser(parent) { } + +private: + bool kitMatches(const Kit *kit) const { + if (!KitChooser::kitMatches(kit)) + return false; + const IDevice::ConstPtr device = DeviceKitInformation::device(kit); + return device && !device->sshParameters().host.isEmpty(); + } +}; + class StartRemoteDialogPrivate { public: - KitChooser *kitChooser; + SshKitChooser *kitChooser; QLineEdit *executable; QLineEdit *arguments; QLineEdit *workingDirectory; @@ -65,7 +79,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent) setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowTitle(tr("Start Remote Analysis")); - d->kitChooser = new KitChooser(this); + d->kitChooser = new Internal::SshKitChooser(this); d->executable = new QLineEdit(this); d->arguments = new QLineEdit(this); d->workingDirectory = new QLineEdit(this);