From d5db7e9a0becafe7e23287e37d1e54f5af8dd7f4 Mon Sep 17 00:00:00 2001
From: dt <qtc-committer@nokia.com>
Date: Wed, 24 Mar 2010 17:33:57 +0100
Subject: [PATCH] Select the tab after insertion

Reviewed-By: con
---
 src/plugins/projectexplorer/doubletabwidget.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/projectexplorer/doubletabwidget.cpp b/src/plugins/projectexplorer/doubletabwidget.cpp
index 33f9157e0c5..95010781afc 100644
--- a/src/plugins/projectexplorer/doubletabwidget.cpp
+++ b/src/plugins/projectexplorer/doubletabwidget.cpp
@@ -119,7 +119,7 @@ void DoubleTabWidget::insertTab(int index, const QString &name, const QStringLis
     tab.currentSubTab = tab.subTabs.isEmpty() ? -1 : 0;
     m_tabs.insert(index, tab);
     if (m_currentIndex == -1) {
-        m_currentIndex = m_tabs.size()-1;
+        m_currentIndex = index;
         emit currentIndexChanged(m_currentIndex, m_tabs.at(m_currentIndex).currentSubTab);
     } else if (m_currentIndex >= index) {
         ++m_currentIndex;
-- 
GitLab