Commit 2a3ef094 authored by Christian Kandeler's avatar Christian Kandeler

Device support: Make IDevice::executeAction non-const.

Presumably this function is currently const because no current
implementation actually changes device properties, but there
is no reason why that should not be allowed.

Change-Id: I80e4355be70e40bca9df5e1287a1d1d3f60c6534
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 0b5639f7
......@@ -78,7 +78,7 @@ QString AndroidDevice::displayNameForActionId(Core::Id actionId) const
return QString();
}
void AndroidDevice::executeAction(Core::Id actionId, QWidget *parent) const
void AndroidDevice::executeAction(Core::Id actionId, QWidget *parent)
{
Q_UNUSED(actionId)
Q_UNUSED(parent)
......
......@@ -45,7 +45,7 @@ public:
ProjectExplorer::IDeviceWidget *createWidget();
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent = 0) const;
void executeAction(Core::Id actionId, QWidget *parent = 0);
bool canAutoDetectPorts() const;
ProjectExplorer::IDevice::Ptr clone() const;
......
......@@ -88,7 +88,7 @@ QString DesktopDevice::displayNameForActionId(Core::Id actionId) const
return QString();
}
void DesktopDevice::executeAction(Core::Id actionId, QWidget *parent) const
void DesktopDevice::executeAction(Core::Id actionId, QWidget *parent)
{
Q_UNUSED(actionId);
Q_UNUSED(parent);
......
......@@ -49,7 +49,7 @@ public:
IDeviceWidget *createWidget();
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent = 0) const;
void executeAction(Core::Id actionId, QWidget *parent = 0);
bool canAutoDetectPorts() const;
bool canCreateProcessModel() const;
DeviceProcessList *createProcessListModel(QObject *parent) const;
......
......@@ -433,7 +433,7 @@ private:
IDeviceWidget *createWidget() { return 0; }
QList<Core::Id> actionIds() const { return QList<Core::Id>(); }
QString displayNameForActionId(Core::Id) const { return QString(); }
void executeAction(Core::Id, QWidget *) const { }
void executeAction(Core::Id, QWidget *) { }
Ptr clone() const { return Ptr(new TestDevice(*this)); }
};
......
......@@ -336,10 +336,13 @@ void DeviceSettingsWidget::clearDetails()
void DeviceSettingsWidget::handleAdditionalActionRequest(int actionId)
{
const IDevice::ConstPtr device = m_deviceManager->find(currentDevice()->id());
const IDevice::Ptr device = m_deviceManager->mutableDevice(currentDevice()->id());
QTC_ASSERT(device, return);
updateDeviceFromUi();
device->executeAction(Core::Id::fromUniqueIdentifier(actionId), this);
// Widget must be set up from scratch, because the action could have changed random attributes.
currentDeviceChanged(currentIndex());
}
void DeviceSettingsWidget::handleProcessListRequested()
......
......@@ -111,7 +111,7 @@ public:
virtual IDeviceWidget *createWidget() = 0;
virtual QList<Core::Id> actionIds() const = 0;
virtual QString displayNameForActionId(Core::Id actionId) const = 0;
virtual void executeAction(Core::Id actionId, QWidget *parent = 0) const = 0;
virtual void executeAction(Core::Id actionId, QWidget *parent = 0) = 0;
virtual DeviceProcessSupport::Ptr processSupport() const;
// Devices that can auto detect ports need not return a ports gathering method. Such devices can
......
......@@ -143,7 +143,7 @@ QString BlackBerryDeviceConfiguration::displayNameForActionId(Core::Id actionId)
return QString();
}
void BlackBerryDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent) const
void BlackBerryDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent)
{
Q_UNUSED(parent);
......
......@@ -62,7 +62,7 @@ public:
ProjectExplorer::IDeviceWidget *createWidget();
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent) const;
void executeAction(Core::Id actionId, QWidget *parent);
ProjectExplorer::IDevice::Ptr clone() const;
bool hasDeviceTester() const;
......
......@@ -217,7 +217,7 @@ QString LinuxDevice::displayNameForActionId(Core::Id actionId) const
return QString(); // Can't happen.
}
void LinuxDevice::executeAction(Core::Id actionId, QWidget *parent) const
void LinuxDevice::executeAction(Core::Id actionId, QWidget *parent)
{
QTC_ASSERT(actionIds().contains(actionId), return);
......
......@@ -66,7 +66,7 @@ public:
ProjectExplorer::IDeviceWidget *createWidget();
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent) const;
void executeAction(Core::Id actionId, QWidget *parent);
ProjectExplorer::IDevice::Ptr clone() const;
ProjectExplorer::DeviceProcessSupport::Ptr processSupport() const;
......
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