forked from qt-creator/qt-creator
Git: Support case-insensitive grep/pickaxe
Change-Id: Ie3da0f5cca2bd3ffa658e3adbba0b1b86a2911d9 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
6d8efefbe5
commit
b14351dab8
@@ -1062,6 +1062,9 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
|
||||
if (!pickaxeValue.isEmpty())
|
||||
arguments << "-S" << pickaxeValue;
|
||||
|
||||
if ((!grepValue.isEmpty() || !pickaxeValue.isEmpty()) && !editor->caseSensitive())
|
||||
arguments << "-i";
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
arguments << "--" << fileName;
|
||||
|
||||
|
||||
@@ -92,12 +92,19 @@ public:
|
||||
addWidget(grepLineEdit);
|
||||
addSeparator();
|
||||
addWidget(pickaxeLineEdit);
|
||||
addSeparator();
|
||||
caseAction = new QAction(tr("Case sensitive"), this);
|
||||
caseAction->setCheckable(true);
|
||||
caseAction->setChecked(true);
|
||||
connect(caseAction, &QAction::toggled, editor, &GitEditorWidget::refresh);
|
||||
addAction(caseAction);
|
||||
hide();
|
||||
connect(editor, &GitEditorWidget::toggleFilters, this, &QWidget::setVisible);
|
||||
}
|
||||
|
||||
Utils::FancyLineEdit *grepLineEdit;
|
||||
Utils::FancyLineEdit *pickaxeLineEdit;
|
||||
QAction *caseAction;
|
||||
};
|
||||
|
||||
GitEditorWidget::GitEditorWidget() :
|
||||
@@ -426,5 +433,10 @@ QString GitEditorWidget::pickaxeValue() const
|
||||
return m_logFilterWidget->pickaxeLineEdit->text();
|
||||
}
|
||||
|
||||
bool GitEditorWidget::caseSensitive() const
|
||||
{
|
||||
return m_logFilterWidget && m_logFilterWidget->caseAction->isChecked();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Git
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
void setPickaxeLineEdit(Utils::FancyLineEdit *lineEdit);
|
||||
QString grepValue() const;
|
||||
QString pickaxeValue() const;
|
||||
bool caseSensitive() const;
|
||||
void refresh();
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user