Commit 163dc0c3 authored by Nikolai Krasheninnikov's avatar Nikolai Krasheninnikov Committed by Elvis Angelaccio
Browse files

"SVN Commit" action is now active on file addition.

Summary:
Adding a file causes no "SVN Commit" action available. This commit fixes an issue.
It is now possible to add single file (or files) and do SVN commit.

Reviewers: #dolphin, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Subscribers: elvisangelaccio

Differential Revision: https://phabricator.kde.org/D26204
parent 5255e153
...@@ -226,7 +226,7 @@ KVersionControlPlugin::ItemVersion FileViewSvnPlugin::itemVersion(const KFileIte ...@@ -226,7 +226,7 @@ KVersionControlPlugin::ItemVersion FileViewSvnPlugin::itemVersion(const KFileIte
while (it != m_versionInfoHash.constEnd()) { while (it != m_versionInfoHash.constEnd()) {
if (it.key().startsWith(itemDir)) { if (it.key().startsWith(itemDir)) {
const ItemVersion version = m_versionInfoHash.value(it.key()); const ItemVersion version = m_versionInfoHash.value(it.key());
if (version == LocallyModifiedVersion) { if (version == LocallyModifiedVersion || version == AddedVersion || version == RemovedVersion) {
return LocallyModifiedVersion; return LocallyModifiedVersion;
} }
} }
...@@ -263,6 +263,8 @@ QList<QAction*> FileViewSvnPlugin::actions(const KFileItemList& items) const ...@@ -263,6 +263,8 @@ QList<QAction*> FileViewSvnPlugin::actions(const KFileItemList& items) const
switch (version) { switch (version) {
case LocallyModifiedVersion: case LocallyModifiedVersion:
case ConflictingVersion: case ConflictingVersion:
case AddedVersion:
case RemovedVersion:
++editingCount; ++editingCount;
break; break;
default: default:
...@@ -470,7 +472,11 @@ QList<QAction*> FileViewSvnPlugin::directoryActions(const KFileItem& directory) ...@@ -470,7 +472,11 @@ QList<QAction*> FileViewSvnPlugin::directoryActions(const KFileItem& directory)
const ItemVersion version = itemVersion(directory); const ItemVersion version = itemVersion(directory);
m_showLocalChangesAction->setEnabled(enabled && (version != NormalVersion)); m_showLocalChangesAction->setEnabled(enabled && (version != NormalVersion));
m_commitAction->setEnabled(enabled && (version == LocallyModifiedVersion)); if (version == LocallyModifiedVersion || version == AddedVersion || version == RemovedVersion) {
m_commitAction->setEnabled(enabled);
} else {
m_commitAction->setEnabled(false);
}
QList<QAction*> actions; QList<QAction*> actions;
actions.append(m_updateAction); actions.append(m_updateAction);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment