forked from qt-creator/qt-creator
Git: Enable renaming local branches by direct editing
Change-Id: I7edab94d949a6e48642f280af52fd156c803cafb Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
1f1149bb58
commit
a82dd10518
@@ -24,9 +24,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "branchadddialog.h"
|
||||
#include "branchmodel.h"
|
||||
#include "ui_branchadddialog.h"
|
||||
#include "gitplugin.h"
|
||||
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <QPushButton>
|
||||
@@ -87,6 +89,21 @@ private:
|
||||
QStringList m_localBranches;
|
||||
};
|
||||
|
||||
BranchValidationDelegate::BranchValidationDelegate(QWidget *parent, BranchModel *model)
|
||||
: QItemDelegate(parent)
|
||||
, m_model(model)
|
||||
{
|
||||
}
|
||||
|
||||
QWidget *BranchValidationDelegate::createEditor(QWidget *parent,
|
||||
const QStyleOptionViewItem & /*option*/,
|
||||
const QModelIndex & /*index*/) const
|
||||
{
|
||||
auto lineEdit = new Utils::FancyLineEdit(parent);
|
||||
BranchNameValidator *validator = new BranchNameValidator(m_model->localBranchNames(), lineEdit);
|
||||
lineEdit->setValidator(validator);
|
||||
return lineEdit;
|
||||
}
|
||||
|
||||
BranchAddDialog::BranchAddDialog(const QStringList &localBranches, bool addBranch, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
||||
Reference in New Issue
Block a user