Mercurial > hg > easyhg
diff hgtabwidget.cpp @ 204:d256cc418fa3
* Fix failure to enable Add button when a "Removed" file was selected
author | Chris Cannam |
---|---|
date | Tue, 04 Jan 2011 15:22:07 +0000 |
parents | f16fe0db11f3 |
children | e67bd8abc3e3 |
line wrap: on
line diff
--- a/hgtabwidget.cpp Tue Jan 04 14:31:30 2011 +0000 +++ b/hgtabwidget.cpp Tue Jan 04 15:22:07 2011 +0000 @@ -115,10 +115,17 @@ bool HgTabWidget::canAdd() const { - if (m_fileStatusWidget->getSelectedAddableFiles().empty()) return false; - if (!m_fileStatusWidget->getSelectedCommittableFiles().empty()) return false; - if (!m_fileStatusWidget->getSelectedRemovableFiles().empty()) return false; - return true; + QStringList addable = m_fileStatusWidget->getSelectedAddableFiles(); + if (addable.empty()) return false; + + QStringList removable = m_fileStatusWidget->getSelectedRemovableFiles(); + if (!removable.empty()) return false; + + QStringList committable = m_fileStatusWidget->getSelectedCommittableFiles(); + // "Removed" files are both committable and addable; don't return + // a false positive if the selection only contains these + if (committable == addable || committable.empty()) return true; + return false; } bool HgTabWidget::canRemove() const