changeset 152:2b997861174b

* Set parents (setCurrent) on history widget when we know the new parents, not at each enable-disable actions call
author Chris Cannam
date Thu, 02 Dec 2010 11:51:15 +0000
parents c91445ee3d57
children 70fe12873106
files hgtabwidget.cpp hgtabwidget.h mainwindow.cpp
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgtabwidget.cpp	Thu Dec 02 11:33:09 2010 +0000
+++ b/hgtabwidget.cpp	Thu Dec 02 11:51:15 2010 +0000
@@ -73,9 +73,9 @@
     m_fileStatusWidget->clearSelections();
 }
 
-void HgTabWidget::setCurrent(QStringList ids, bool showUncommittedChanges)
+void HgTabWidget::setCurrent(QStringList ids)
 {
-    m_historyWidget->setCurrent(ids, showUncommittedChanges);
+    m_historyWidget->setCurrent(ids, canCommit());
 }
 
 bool HgTabWidget::canCommit() const
--- a/hgtabwidget.h	Thu Dec 02 11:33:09 2010 +0000
+++ b/hgtabwidget.h	Thu Dec 02 11:51:15 2010 +0000
@@ -48,7 +48,7 @@
     void setWorkFolderAndRepoNames(QString workFolderPath, QString remoteRepoPath);
     void setState(QString state);
 
-    void setCurrent(QStringList ids, bool showUncommittedChanges);
+    void setCurrent(QStringList ids);
 
     FileStates getFileStates() { return m_fileStates; }
 
--- a/mainwindow.cpp	Thu Dec 02 11:33:09 2010 +0000
+++ b/mainwindow.cpp	Thu Dec 02 11:51:15 2010 +0000
@@ -1286,8 +1286,12 @@
         break;
         
     case ACT_QUERY_PARENTS:
+    {
         foreach (Changeset *cs, currentParents) delete cs;
         currentParents = Changeset::parseChangesets(output);
+        QStringList parentIds = Changeset::getIds(currentParents);
+        hgTabs->setCurrent(parentIds);
+    }
         break;
         
     case ACT_QUERY_HEADS:
@@ -1596,10 +1600,6 @@
     hgMergeAct->setEnabled(localRepoActionsEnabled && canMerge);
     hgUpdateAct->setEnabled(localRepoActionsEnabled && canUpdate);
 
-    QStringList ids;
-    foreach (Changeset *cs, currentParents) ids.push_back(cs->id());
-    hgTabs->setCurrent(ids, hgTabs->canCommit());
-
     // Set the state field on the file status widget
 
     QString branchText;