Commit 9b7fc506 authored by Nikolai Krasheninnikov's avatar Nikolai Krasheninnikov
Browse files

Added VCS plugins signals connections for outOfVersionControl() actions.

Summary:
Plugins can now do out of version control actions (D29041), so we need them to inform of their state.
This change connects every plugin signal to Dolphin on plugin instantiation.

Test Plan:
1. Try SVN Update of inaccessible repository: see SVN error message shows up.
2. Try pull inaccessible git repository: see GIT error message shows up.
3. Try SVN Commit: see SVN message.

Reviewers: #dolphin, meven, elvisangelaccio

Reviewed By: #dolphin, meven

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D29488
parent a291c599
...@@ -168,21 +168,8 @@ void VersionControlObserver::verifyDirectory() ...@@ -168,21 +168,8 @@ void VersionControlObserver::verifyDirectory()
return; return;
} }
if (m_plugin) {
m_plugin->disconnect(this);
}
m_plugin = searchPlugin(rootItem.url()); m_plugin = searchPlugin(rootItem.url());
if (m_plugin) { if (m_plugin) {
connect(m_plugin, &KVersionControlPlugin::itemVersionsChanged,
this, &VersionControlObserver::silentDirectoryVerification);
connect(m_plugin, &KVersionControlPlugin::infoMessage,
this, &VersionControlObserver::infoMessage);
connect(m_plugin, &KVersionControlPlugin::errorMessage,
this, &VersionControlObserver::errorMessage);
connect(m_plugin, &KVersionControlPlugin::operationCompletedMessage,
this, &VersionControlObserver::operationCompletedMessage);
if (!m_versionedDirectory) { if (!m_versionedDirectory) {
m_versionedDirectory = true; m_versionedDirectory = true;
...@@ -311,6 +298,15 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& director ...@@ -311,6 +298,15 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& director
if (enabledPlugins.contains((*it)->name())) { if (enabledPlugins.contains((*it)->name())) {
KVersionControlPlugin* plugin = (*it)->createInstance<KVersionControlPlugin>(this); KVersionControlPlugin* plugin = (*it)->createInstance<KVersionControlPlugin>(this);
if (plugin) { if (plugin) {
connect(plugin, &KVersionControlPlugin::itemVersionsChanged,
this, &VersionControlObserver::silentDirectoryVerification);
connect(plugin, &KVersionControlPlugin::infoMessage,
this, &VersionControlObserver::infoMessage);
connect(plugin, &KVersionControlPlugin::errorMessage,
this, &VersionControlObserver::errorMessage);
connect(plugin, &KVersionControlPlugin::operationCompletedMessage,
this, &VersionControlObserver::operationCompletedMessage);
m_plugins.append( qMakePair(plugin, plugin->fileName()) ); m_plugins.append( qMakePair(plugin, plugin->fileName()) );
} }
} }
......
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