forked from qt-creator/qt-creator
Git: Warn when commits are not found
Change-Id: I5e03853f0b658d7f246538ca90e35f38cc2f49d4 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
7b5b5b13b4
commit
f3eedaf300
@@ -31,6 +31,8 @@
|
|||||||
#include "gitplugin.h"
|
#include "gitplugin.h"
|
||||||
#include "gitclient.h"
|
#include "gitclient.h"
|
||||||
|
|
||||||
|
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||||
|
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@@ -67,8 +69,14 @@ LogChangeWidget::LogChangeWidget(QWidget *parent)
|
|||||||
|
|
||||||
bool LogChangeWidget::init(const QString &repository, const QString &commit, bool includeRemote)
|
bool LogChangeWidget::init(const QString &repository, const QString &commit, bool includeRemote)
|
||||||
{
|
{
|
||||||
if (!populateLog(repository, commit, includeRemote) || !m_model->rowCount())
|
if (!populateLog(repository, commit, includeRemote))
|
||||||
return false;
|
return false;
|
||||||
|
if (!m_model->rowCount()) {
|
||||||
|
VcsBase::VcsBaseOutputWindow::instance()->appendError(
|
||||||
|
includeRemote ? tr("No commits were found")
|
||||||
|
: tr("No local commits were found"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
selectionModel()->select(m_model->index(0, 0),
|
selectionModel()->select(m_model->index(0, 0),
|
||||||
QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||||
return true;
|
return true;
|
||||||
@@ -181,7 +189,7 @@ LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) :
|
|||||||
bool LogChangeDialog::runDialog(const QString &repository, const QString &commit, bool includeRemote)
|
bool LogChangeDialog::runDialog(const QString &repository, const QString &commit, bool includeRemote)
|
||||||
{
|
{
|
||||||
if (!widget->init(repository, commit, includeRemote))
|
if (!widget->init(repository, commit, includeRemote))
|
||||||
return QDialog::Rejected;
|
return false;
|
||||||
|
|
||||||
return QDialog::exec() == QDialog::Accepted;
|
return QDialog::exec() == QDialog::Accepted;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user