Commit 4af55bc4 authored by Christian Kandeler's avatar Christian Kandeler

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: default avatarhjk <hjk@theqtcompany.com>
parent c273a47d
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment