forked from qt-creator/qt-creator
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 <hjk@theqtcompany.com>
This commit is contained in:
@@ -46,10 +46,24 @@ using namespace Utils;
|
|||||||
namespace Analyzer {
|
namespace Analyzer {
|
||||||
namespace Internal {
|
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
|
class StartRemoteDialogPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KitChooser *kitChooser;
|
SshKitChooser *kitChooser;
|
||||||
QLineEdit *executable;
|
QLineEdit *executable;
|
||||||
QLineEdit *arguments;
|
QLineEdit *arguments;
|
||||||
QLineEdit *workingDirectory;
|
QLineEdit *workingDirectory;
|
||||||
@@ -65,7 +79,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
|
|||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
setWindowTitle(tr("Start Remote Analysis"));
|
setWindowTitle(tr("Start Remote Analysis"));
|
||||||
|
|
||||||
d->kitChooser = new KitChooser(this);
|
d->kitChooser = new Internal::SshKitChooser(this);
|
||||||
d->executable = new QLineEdit(this);
|
d->executable = new QLineEdit(this);
|
||||||
d->arguments = new QLineEdit(this);
|
d->arguments = new QLineEdit(this);
|
||||||
d->workingDirectory = new QLineEdit(this);
|
d->workingDirectory = new QLineEdit(this);
|
||||||
|
Reference in New Issue
Block a user