summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2012-04-25 12:44:48 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2012-04-25 17:48:55 +0200
commit4e9b6cbe9c40f95591b5073ec49df58d5e105f64 (patch)
tree53f145f7ac7ece822aa6e2d1bd2664e4b71538cc /src/plugins/projectexplorer/devicesupport/devicemanagermodel.h
parent83192865e70f32841729e72afebb84059470f9e6 (diff)
downloadqt-creator-4e9b6cbe9c40f95591b5073ec49df58d5e105f64.tar.gz
Device support: Clean up DeviceManager API.
- Remove redirection of setDisplayName() via DeviceManager. This inflated the API (method + signal) only for the settings widget, which can handle this case perfectly well by itself. - Make the public API Id-centric. Indexes were used in a lot of places for historical reasons (the device manager was a model once), but they made the API inconsistent and sometimes even plain stupid (notably the deviceRemoved() signal). Change-Id: I77601ac05726d1cd841ae213397f26048dddc585 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer/devicesupport/devicemanagermodel.h')
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicemanagermodel.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h
index 301e1138c2..ae3d4786f2 100644
--- a/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h
+++ b/src/plugins/projectexplorer/devicesupport/devicemanagermodel.h
@@ -32,6 +32,7 @@
#ifndef DEVICEMANAGERMODEL_H
#define DEVICEMANAGERMODEL_H
+#include <coreplugin/id.h>
#include <projectexplorer/projectexplorer_export.h>
#include <QAbstractListModel>
@@ -49,16 +50,20 @@ public:
explicit DeviceManagerModel(const DeviceManager *deviceManager, QObject *parent = 0);
~DeviceManagerModel();
+ void updateDevice(Core::Id id);
+
private slots:
- void handleDeviceAdded(const QSharedPointer<const IDevice> &device);
- void handleDeviceRemoved(int idx);
- void handleDataChanged(int idx);
+ void handleDeviceAdded(Core::Id id);
+ void handleDeviceRemoved(Core::Id id);
+ void handleDeviceUpdated(Core::Id id);
void handleDeviceListChanged();
private:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ int indexForId(Core::Id id) const;
+
Internal::DeviceManagerModelPrivate * const d;
};