Skip to content

Commit

Permalink
Prevent Uncommitted Changes from being shown when ShowCleanStatus is …
Browse files Browse the repository at this point in the history
…false

Merge pull request #714 from jensenr30/fix-show-clean-status
  • Loading branch information
Murmele authored May 22, 2024
2 parents 025f55c + 1bc89cd commit 04991eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/ui/CommitList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ class CommitModel : public QAbstractListModel {

// Update status row.
bool head = (!mRef.isValid() || mRef.isHead());
bool valid = (mCleanStatus || !mStatus.isFinished() || status().isValid());
if (head && valid && mPathspec.isEmpty()) {
bool valid = (!mStatus.isFinished() || status().isValid());
if (mShowCleanStatus && head && valid && mPathspec.isEmpty()) {
QVector<Column> row;
if (mGraphVisible && mRef.isValid() && mStatus.isFinished()) {
row.append({Segment(Bottom, kTaintedColor), Segment(Dot, QColor())});
Expand Down Expand Up @@ -239,7 +239,7 @@ class CommitModel : public QAbstractListModel {
git::Config config = mRepo.appConfig();
mRefsAll = config.value<bool>("commit.refs.all", true);
mSortDate = config.value<bool>("commit.sort.date", true);
mCleanStatus = config.value<bool>("commit.status.clean", false);
mShowCleanStatus = config.value<bool>("commit.show.status", true);
mGraphVisible = config.value<bool>("commit.graph.visible", true);

if (walk)
Expand Down Expand Up @@ -559,7 +559,7 @@ class CommitModel : public QAbstractListModel {
bool mSuppressResetWalker{false};
bool mRefsAll = true;
bool mSortDate = true;
bool mCleanStatus = true;
bool mShowCleanStatus = true;
bool mGraphVisible = true;
};

Expand Down
4 changes: 2 additions & 2 deletions src/ui/CommitToolBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace {
const QString kRefsKey = "commit.refs.all";
const QString kSortKey = "commit.sort.date";
const QString kGraphKey = "commit.graph.visible";
const QString kStatusKey = "commit.status.clean";
const QString kStatusKey = "commit.show.status";
const QString kStyleSheet = "QToolBar {"
" border: none"
"}"
Expand Down Expand Up @@ -155,7 +155,7 @@ CommitToolBar::CommitToolBar(QWidget *parent) : QToolBar(parent) {

QAction *status = menu->addAction(tr("Show Clean Status"));
status->setCheckable(true);
status->setChecked(config.value<bool>(kStatusKey, false));
status->setChecked(config.value<bool>(kStatusKey, true));
connect(status, &QAction::triggered, [this](bool checked) {
RepoView *view = RepoView::parentView(this);
view->repo().appConfig().setValue(kStatusKey, checked);
Expand Down

0 comments on commit 04991eb

Please sign in to comment.