From 1cc61e06ea8d188d6604ebf317d2ad1884de42c1 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@nokia.com>
Date: Mon, 25 Oct 2010 08:56:25 +0200
Subject: [PATCH] QmlJSInspector: API cleanup

Simplify method names.
---
 src/plugins/qmljsinspector/qmljsclientproxy.cpp    |  8 ++++----
 src/plugins/qmljsinspector/qmljsinspector.cpp      |  6 +++---
 src/plugins/qmljsinspector/qmljsobserverclient.cpp | 12 ++++++------
 src/plugins/qmljsinspector/qmljsobserverclient.h   |  6 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/plugins/qmljsinspector/qmljsclientproxy.cpp b/src/plugins/qmljsinspector/qmljsclientproxy.cpp
index bf8969f3576..d1d171e60f4 100644
--- a/src/plugins/qmljsinspector/qmljsclientproxy.cpp
+++ b/src/plugins/qmljsinspector/qmljsclientproxy.cpp
@@ -163,7 +163,7 @@ void ClientProxy::refreshObjectTree()
     }
 }
 
-void ClientProxy::onCurrentObjectsChanged(const QList< int >& debugIds, bool requestIfNeeded)
+void ClientProxy::onCurrentObjectsChanged(const QList<int> &debugIds, bool requestIfNeeded)
 {
     QList<QDeclarativeDebugObjectReference> selectedItems;
 
@@ -194,7 +194,7 @@ void ClientProxy::setSelectedItemsByObjectId(const QList<QDeclarativeDebugObject
             debugIds << ref.debugId();
         }
 
-        m_designClient->setSelectedItemsByObjectId(debugIds);
+        m_designClient->setCurrentObjects(debugIds);
     }
 }
 
@@ -401,8 +401,8 @@ void ClientProxy::objectTreeFetched(QDeclarativeDebugQuery::State state)
         emit objectTreeUpdated();
 
         if (isConnected()) {
-            if (!m_designClient->selectedItemIds().isEmpty())
-                onCurrentObjectsChanged(m_designClient->selectedItemIds(), false);
+            if (!m_designClient->currentObjects().isEmpty())
+                onCurrentObjectsChanged(m_designClient->currentObjects(), false);
 
             m_designClient->setObjectIdList(m_rootObjects);
         }
diff --git a/src/plugins/qmljsinspector/qmljsinspector.cpp b/src/plugins/qmljsinspector/qmljsinspector.cpp
index a9a391dbf2d..e2ce8020083 100644
--- a/src/plugins/qmljsinspector/qmljsinspector.cpp
+++ b/src/plugins/qmljsinspector/qmljsinspector.cpp
@@ -276,7 +276,7 @@ void InspectorUi::connected(ClientProxy *clientProxy)
 {
     m_clientProxy = clientProxy;
 
-    connect(m_clientProxy, SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)),
+    connect(m_clientProxy, SIGNAL(currentObjectsChanged(QList<QDeclarativeDebugObjectReference>)),
             SLOT(setSelectedItemsByObjectReference(QList<QDeclarativeDebugObjectReference>)));
 
     connect(m_clientProxy, SIGNAL(enginesChanged()), SLOT(updateEngineList()));
@@ -309,7 +309,7 @@ void InspectorUi::connected(ClientProxy *clientProxy)
 
 void InspectorUi::disconnected()
 {
-    disconnect(m_clientProxy, SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)),
+    disconnect(m_clientProxy, SIGNAL(currentObjectsChanged(QList<QDeclarativeDebugObjectReference>)),
                this, SLOT(setSelectedItemsByObjectReference(QList<QDeclarativeDebugObjectReference>)));
 
     disconnect(m_clientProxy, SIGNAL(enginesChanged()), this, SLOT(updateEngineList()));
@@ -431,7 +431,7 @@ QmlJSLiveTextPreview *InspectorUi::createPreviewForEditor(Core::IEditor *newEdit
         } else {
             preview = new QmlJSLiveTextPreview(doc, initdoc, m_clientProxy, this);
             connect(preview,
-                    SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)),
+                    SIGNAL(currentObjectsChanged(QList<QDeclarativeDebugObjectReference>)),
                     SLOT(changeSelectedItems(QList<QDeclarativeDebugObjectReference>)));
             connect(preview, SIGNAL(reloadQmlViewerRequested()), m_clientProxy, SLOT(reloadQmlViewer()));
             connect(preview, SIGNAL(disableLivePreviewRequested()), SLOT(disableLivePreview()));
diff --git a/src/plugins/qmljsinspector/qmljsobserverclient.cpp b/src/plugins/qmljsinspector/qmljsobserverclient.cpp
index 525ce233567..7b9719dc2e3 100644
--- a/src/plugins/qmljsinspector/qmljsobserverclient.cpp
+++ b/src/plugins/qmljsinspector/qmljsobserverclient.cpp
@@ -75,17 +75,17 @@ void QmlJSObserverClient::messageReceived(const QByteArray &message)
         int objectCount;
         ds >> objectCount;
 
-        m_selectedItemIds.clear();
+        m_currentDebugIds.clear();
 
         for(int i = 0; i < objectCount; ++i) {
             int debugId;
             ds >> debugId;
             if (debugId != -1) {
-                m_selectedItemIds  << debugId;
+                m_currentDebugIds << debugId;
             }
         }
 
-        emit currentObjectsChanged(m_selectedItemIds);
+        emit currentObjectsChanged(m_currentDebugIds);
     } else if (type == "TOOL_CHANGED") {
         int toolId;
         ds >> toolId;
@@ -120,12 +120,12 @@ void QmlJSObserverClient::messageReceived(const QByteArray &message)
     }
 }
 
-QList<int> QmlJSObserverClient::selectedItemIds() const
+QList<int> QmlJSObserverClient::currentObjects() const
 {
-    return m_selectedItemIds;
+    return m_currentDebugIds;
 }
 
-void QmlJSObserverClient::setSelectedItemsByObjectId(const QList<int> &debugIds) {
+void QmlJSObserverClient::setCurrentObjects(const QList<int> &debugIds) {
     if (!m_connection || !m_connection->isConnected())
         return;
 
diff --git a/src/plugins/qmljsinspector/qmljsobserverclient.h b/src/plugins/qmljsinspector/qmljsobserverclient.h
index 8ffdbf64490..1e87bf94d3e 100644
--- a/src/plugins/qmljsinspector/qmljsobserverclient.h
+++ b/src/plugins/qmljsinspector/qmljsobserverclient.h
@@ -54,7 +54,7 @@ public:
     explicit QmlJSObserverClient(QDeclarativeDebugConnection *client,
                                     QObject *parent = 0);
 
-    void setSelectedItemsByObjectId(const QList<int> &debugIds);
+    void setCurrentObjects(const QList<int> &debugIds);
     void reloadViewer();
     void setDesignModeBehavior(bool inDesignMode);
     void setAnimationSpeed(qreal slowdownFactor);
@@ -71,7 +71,7 @@ public:
     void applyChangesToQmlFile();
     void applyChangesFromQmlFile();
 
-    QList<int> selectedItemIds() const;
+    QList<int> currentObjects() const;
 
     // ### Qt 4.8: remove if we can have access to qdeclarativecontextdata or id's
     void setObjectIdList(const QList<QDeclarativeDebugObjectReference> &objectRoots);
@@ -98,7 +98,7 @@ protected:
     virtual void messageReceived(const QByteArray &);
 
 private:
-    QList<int> m_selectedItemIds;
+    QList<int> m_currentDebugIds;
     QDeclarativeDebugConnection *m_connection;
 };
 
-- 
GitLab