Commit 09e1e870 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Device support: Make IDevice::executeAction() const again.



It was a mistake to remove the const modifier: While the action can
conceptually do anything it wants to the device, it must not directly
modify the actual object.

Change-Id: Iae39aec6332c381983062afc71365ecfcb854c3c
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent de22e66e
......@@ -103,7 +103,7 @@ QString MaddeDevice::displayNameForActionId(Core::Id actionId) const
return QString(); // Can't happen.
}
void MaddeDevice::executeAction(Core::Id actionId, QWidget *parent)
void MaddeDevice::executeAction(Core::Id actionId, QWidget *parent) const
{
QTC_ASSERT(actionIds().contains(actionId), return);
......
......@@ -53,7 +53,7 @@ public:
QString displayType() const;
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent);
void executeAction(Core::Id actionId, QWidget *parent) const;
ProjectExplorer::IDevice::Ptr clone() const;
static QString maddeDisplayType(const QString &type);
......
......@@ -63,7 +63,7 @@ QString DesktopDevice::displayNameForActionId(Core::Id actionId) const
return QString();
}
void DesktopDevice::executeAction(Core::Id actionId, QWidget *parent)
void DesktopDevice::executeAction(Core::Id actionId, QWidget *parent) const
{
Q_UNUSED(actionId);
Q_UNUSED(parent);
......
......@@ -52,7 +52,7 @@ public:
IDeviceWidget *createWidget();
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent = 0);
void executeAction(Core::Id actionId, QWidget *parent = 0) const;
IDevice::Ptr clone() const;
......
......@@ -282,7 +282,7 @@ void DeviceSettingsWidget::clearDetails()
void DeviceSettingsWidget::handleAdditionalActionRequest(int actionId)
{
IDevice::Ptr device = m_deviceManager->mutableDevice(currentDevice()->id());
const IDevice::ConstPtr device = m_deviceManager->find(currentDevice()->id());
QTC_ASSERT(device, return);
device->executeAction(Core::Id::fromUniqueIdentifier(actionId), this);
}
......
......@@ -82,7 +82,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) = 0;
virtual void executeAction(Core::Id actionId, QWidget *parent = 0) const = 0;
enum AvailabilityState { DeviceAvailable, DeviceUnavailable, DeviceAvailabilityUnknown };
AvailabilityState availability() const;
......
......@@ -207,7 +207,7 @@ QString SymbianIDevice::displayNameForActionId(Core::Id actionId) const
return QString();
}
void SymbianIDevice::executeAction(Core::Id actionId, QWidget *parent)
void SymbianIDevice::executeAction(Core::Id actionId, QWidget *parent) const
{
Q_UNUSED(actionId);
Q_UNUSED(parent);
......
......@@ -78,7 +78,7 @@ public:
ProjectExplorer::IDeviceWidget* createWidget();
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget*parent);
void executeAction(Core::Id actionId, QWidget*parent) const;
protected:
SymbianIDevice(const SymbianIDevice &other);
......
......@@ -120,7 +120,7 @@ QString LinuxDeviceConfiguration::displayNameForActionId(Core::Id actionId) cons
return QString(); // Can't happen.
}
void LinuxDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent)
void LinuxDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent) const
{
QTC_ASSERT(actionIds().contains(actionId), return);
......
......@@ -77,7 +77,7 @@ public:
ProjectExplorer::IDeviceWidget *createWidget();
QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent);
void executeAction(Core::Id actionId, QWidget *parent) const;
void fromMap(const QVariantMap &map);
ProjectExplorer::IDevice::Ptr clone() 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