summaryrefslogtreecommitdiff
path: root/src/plugins/git/branchdialog.cpp
diff options
context:
space:
mode:
authorPetar Perisin <petar.perisin@gmail.com>2014-01-24 06:31:31 +0100
committerPetar Perisin <petar.perisin@gmail.com>2014-01-27 16:23:09 +0100
commite163356f9f641e38e260132348f53da8b572298a (patch)
treedb8629e7343b960775180b6b6c7ae28827bc5f8a /src/plugins/git/branchdialog.cpp
parent86e3d5af5f438522808b4eaeb2aac15ca4152ef8 (diff)
downloadqt-creator-e163356f9f641e38e260132348f53da8b572298a.tar.gz
Git: Branches dialog - ensure all documents are saved
Change-Id: Ia48157b10fb2f9eb3a8b9b8e7e541a736dd75b4f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/branchdialog.cpp')
-rw-r--r--src/plugins/git/branchdialog.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp
index 9409c56f98..7a86cd3ec1 100644
--- a/src/plugins/git/branchdialog.cpp
+++ b/src/plugins/git/branchdialog.cpp
@@ -40,6 +40,7 @@
#include <utils/qtcassert.h>
#include <utils/execmenu.h>
#include <vcsbase/vcsbaseoutputwindow.h>
+#include <coreplugin/documentmanager.h>
#include <QAction>
#include <QItemSelectionModel>
@@ -177,6 +178,8 @@ void BranchDialog::add()
void BranchDialog::checkout()
{
+ if (!Core::DocumentManager::saveAllModifiedDocuments())
+ return;
QModelIndex idx = selectedIndex();
const QString currentBranch = m_model->fullName(m_model->currentBranch());
@@ -319,6 +322,8 @@ void BranchDialog::log()
void BranchDialog::merge()
{
+ if (!Core::DocumentManager::saveAllModifiedDocuments())
+ return;
QModelIndex idx = selectedIndex();
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
@@ -340,6 +345,8 @@ void BranchDialog::merge()
void BranchDialog::rebase()
{
+ if (!Core::DocumentManager::saveAllModifiedDocuments())
+ return;
QModelIndex idx = selectedIndex();
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
@@ -351,6 +358,8 @@ void BranchDialog::rebase()
void BranchDialog::cherryPick()
{
+ if (!Core::DocumentManager::saveAllModifiedDocuments())
+ return;
QModelIndex idx = selectedIndex();
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!