From 6c7f03e29ebc6420edc93357e6feb8fd71a0d0a7 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Fri, 5 Jun 2009 17:28:33 +0200
Subject: [PATCH] Session manager will no longer try to load a session when
 clicking OK.

This double role of managing sessions *and* loading the active one was
always a bit odd and confusing (unexpected behavior).

Reviewed-By: dt
---
 src/plugins/projectexplorer/sessiondialog.cpp |  6 ++----
 src/plugins/projectexplorer/sessiondialog.ui  | 15 ++++-----------
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp
index 1285bf171d3..ec5fadbe131 100644
--- a/src/plugins/projectexplorer/sessiondialog.cpp
+++ b/src/plugins/projectexplorer/sessiondialog.cpp
@@ -139,15 +139,13 @@ void SessionDialog::updateActions()
 
     if (m_ui.sessionList->currentItem())
         enableDelete = (m_ui.sessionList->currentItem()->text() != m_sessionManager->activeSession()
-                        && m_ui.sessionList->currentItem()->text() != "default");
+                        && (m_ui.sessionList->currentItem()->text() != QLatin1String("default")));
     m_ui.btDelete->setEnabled(enableDelete);
 }
 
 void SessionDialog::accept()
 {
-    if (m_ui.sessionList->currentItem()) {
-        m_sessionManager->loadSession(m_ui.sessionList->currentItem()->text());
-    }
+    // do nothing
     QDialog::accept();
 }
 
diff --git a/src/plugins/projectexplorer/sessiondialog.ui b/src/plugins/projectexplorer/sessiondialog.ui
index ab2f4b08a0c..ad11881aaef 100644
--- a/src/plugins/projectexplorer/sessiondialog.ui
+++ b/src/plugins/projectexplorer/sessiondialog.ui
@@ -14,17 +14,10 @@
    <string>Session Manager</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string>Choose your session</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0" colspan="2">
+   <item row="0" column="0" colspan="2">
     <widget class="QListWidget" name="sessionList"/>
    </item>
-   <item row="1" column="2">
+   <item row="0" column="2">
     <layout class="QVBoxLayout" name="verticalLayout">
      <item>
       <widget class="QPushButton" name="btCreateNew">
@@ -62,14 +55,14 @@
      </item>
     </layout>
    </item>
-   <item row="2" column="0">
+   <item row="1" column="0">
     <widget class="QLabel" name="whatsASessionLabel">
      <property name="text">
       <string>&lt;a href=&quot;qthelp://com.nokia.qtcreator/doc/creator-quick-tour.html#session-management-in-qt-creator&quot;&gt;What is a Session?&lt;/a&gt;</string>
      </property>
     </widget>
    </item>
-   <item row="2" column="1" colspan="2">
+   <item row="1" column="1" colspan="2">
     <widget class="QDialogButtonBox" name="buttonBox">
      <property name="standardButtons">
       <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-- 
GitLab