OSDN Git Service

QmlProfiler: Keep configuration of attach dialog
authorKai Koehne <kai.koehne@nokia.com>
Sat, 15 Oct 2011 09:52:03 +0000 (11:52 +0200)
committerKai Koehne <kai.koehne@nokia.com>
Mon, 17 Oct 2011 13:05:19 +0000 (15:05 +0200)
Change-Id: If9f4918a77c874c82fec63eacf1464b78b5d82ac
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
src/plugins/qmlprofiler/qmlprofilertool.cpp

index 1c2dfe6..6b12dd2 100644 (file)
@@ -489,15 +489,36 @@ void QmlProfilerTool::clearDisplay()
 static void startRemoteTool(IAnalyzerTool *tool, StartMode mode)
 {
     Q_UNUSED(tool);
-    QmlProfilerAttachDialog dialog;
-    if (dialog.exec() != QDialog::Accepted)
-        return;
+
+    QString host;
+    quint16 port;
+
+    {
+        QSettings *settings = Core::ICore::instance()->settings();
+
+        host = settings->value(QLatin1String("AnalyzerQmlAttachDialog/host"), QLatin1String("localhost")).toString();
+        port = settings->value(QLatin1String("AnalyzerQmlAttachDialog/port"), 3768).toInt();
+
+        QmlProfilerAttachDialog dialog;
+
+        dialog.setAddress(host);
+        dialog.setPort(port);
+
+        if (dialog.exec() != QDialog::Accepted)
+            return;
+
+        host = dialog.address();
+        port = dialog.port();
+
+        settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/host"), host);
+        settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/port"), port);
+    }
 
     AnalyzerStartParameters sp;
     sp.toolId = tool->id();
     sp.startMode = mode;
-    sp.connParams.host = dialog.address();
-    sp.connParams.port = dialog.port();
+    sp.connParams.host = host;
+    sp.connParams.port = port;
 
     AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, 0);
     QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));