From f0a25101d2116be60cee80e30383b4cfaaf52936 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 14 Jul 2023 08:47:57 +0300 Subject: [PATCH] libs: remove unused and redundant KVersionControlPlugin enums icon-wise it shall be the same because there is no icon for unstaged added files, changing the tint of modified files just to make it clearly different from the added files Signed-off-by: Ivailo Monev --- dolphin/plugins/git/fileviewgitplugin.cpp | 5 +---- dolphin/src/views/dolphinfileitemlistwidget.cpp | 10 +--------- libs/konq/kversioncontrolplugin.h | 12 ------------ 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/dolphin/plugins/git/fileviewgitplugin.cpp b/dolphin/plugins/git/fileviewgitplugin.cpp index 4fa10dc6..ef6aa845 100644 --- a/dolphin/plugins/git/fileviewgitplugin.cpp +++ b/dolphin/plugins/git/fileviewgitplugin.cpp @@ -151,12 +151,9 @@ KVersionControlPlugin::ItemVersion FileViewGitPlugin::itemVersion(const KFileIte kDebug() << "New file" << item; return KVersionControlPlugin::AddedVersion; } - if (gitstatusflags & GIT_STATUS_INDEX_MODIFIED) { + if (gitstatusflags & GIT_STATUS_INDEX_MODIFIED || gitstatusflags & GIT_STATUS_WT_MODIFIED) { kDebug() << "Modified file" << item; return KVersionControlPlugin::LocallyModifiedVersion; - } else if (gitstatusflags & GIT_STATUS_WT_MODIFIED) { - kDebug() << "Modified unstaged file" << item; - return KVersionControlPlugin::LocallyModifiedUnstagedVersion; } if (gitstatusflags & GIT_STATUS_INDEX_DELETED || gitstatusflags & GIT_STATUS_WT_DELETED) { kDebug() << "Deleted file" << item; diff --git a/dolphin/src/views/dolphinfileitemlistwidget.cpp b/dolphin/src/views/dolphinfileitemlistwidget.cpp index e3489576..0f594473 100644 --- a/dolphin/src/views/dolphinfileitemlistwidget.cpp +++ b/dolphin/src/views/dolphinfileitemlistwidget.cpp @@ -51,11 +51,9 @@ void DolphinFileItemListWidget::refreshCache() // as tint colors and are mixed with the current set text color. The tint colors // have been optimized for the base colors of the corresponding Oxygen emblems. switch (version) { - case KVersionControlPlugin::UpdateRequiredVersion: tintColor = Qt::yellow; break; - case KVersionControlPlugin::LocallyModifiedUnstagedVersion: tintColor = Qt::green; break; - case KVersionControlPlugin::LocallyModifiedVersion: tintColor = Qt::green; break; case KVersionControlPlugin::AddedVersion: tintColor = Qt::green; break; case KVersionControlPlugin::RemovedVersion: tintColor = Qt::darkRed; break; + case KVersionControlPlugin::LocallyModifiedVersion: tintColor = Qt::yellow; break; case KVersionControlPlugin::ConflictingVersion: tintColor = Qt::red; break; case KVersionControlPlugin::IgnoredVersion: tintColor = Qt::white; break; case KVersionControlPlugin::NormalVersion: @@ -95,15 +93,9 @@ QPixmap DolphinFileItemListWidget::overlayForState(KVersionControlPlugin::ItemVe case KVersionControlPlugin::NormalVersion: iconName = "vcs-normal"; break; - case KVersionControlPlugin::UpdateRequiredVersion: - iconName = "vcs-update-required"; - break; case KVersionControlPlugin::LocallyModifiedVersion: iconName = "vcs-locally-modified"; break; - case KVersionControlPlugin::LocallyModifiedUnstagedVersion: - iconName = "vcs-locally-modified-unstaged"; - break; case KVersionControlPlugin::AddedVersion: iconName = "vcs-added"; break; diff --git a/libs/konq/kversioncontrolplugin.h b/libs/konq/kversioncontrolplugin.h index 818c04db..77801dfe 100644 --- a/libs/konq/kversioncontrolplugin.h +++ b/libs/konq/kversioncontrolplugin.h @@ -96,11 +96,6 @@ public: * the latest version. */ NormalVersion, - /** - * The file is under version control and a newer - * version exists on the main branch. - */ - UpdateRequiredVersion, /** * The file is under version control and has been * modified locally. All modifications will be part @@ -123,13 +118,6 @@ public: * branch. */ ConflictingVersion, - /** - * The file is under version control and has local - * modifications, which will not be part of the next - * commit (or are "unstaged" in git jargon). - * @since 4.6 - */ - LocallyModifiedUnstagedVersion, /** * The file is not under version control and is listed * in the ignore list of the version control system.