void QDeclarativeInspectorService::addView(QObject *view)
{
m_views.append(view);
+ updateStatus();
}
void QDeclarativeInspectorService::removeView(QObject *view)
{
m_views.removeAll(view);
+ updateStatus();
}
void QDeclarativeInspectorService::sendMessage(const QByteArray &message)
void QDeclarativeInspectorService::statusChanged(Status status)
{
- if (m_views.isEmpty())
+ updateStatus();
+}
+
+void QDeclarativeInspectorService::updateStatus()
+{
+ if (m_views.isEmpty()) {
+ if (m_inspectorPlugin)
+ m_inspectorPlugin->deactivate();
return;
+ }
- if (status == Enabled) {
+ if (status() == Enabled) {
if (!m_inspectorPlugin)
m_inspectorPlugin = loadInspectorPlugin();