- m_plugin = searchPlugin(versionControlUrl);
- if (m_plugin) {
- connect(m_plugin, SIGNAL(versionStatesChanged()),
- this, SLOT(silentDirectoryVerification()));
- connect(m_plugin, SIGNAL(infoMessage(QString)),
- this, SIGNAL(infoMessage(QString)));
- connect(m_plugin, SIGNAL(errorMessage(QString)),
- this, SIGNAL(errorMessage(QString)));
- connect(m_plugin, SIGNAL(operationCompletedMessage(QString)),
- this, SIGNAL(operationCompletedMessage(QString)));
-
- if (!m_versionedDirectory) {
- m_versionedDirectory = true;
-
- // The directory is versioned. Assume that the user will further browse through
- // versioned directories and decrease the verification timer.
- m_dirVerificationTimer->setInterval(100);
- connect(m_dirLister, SIGNAL(refreshItems(const QList<QPair<KFileItem,KFileItem>>&)),
- this, SLOT(delayedDirectoryVerification()));
- connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
- this, SLOT(delayedDirectoryVerification()));
+ if (m_plugin != nullptr) {
+ if (!rootItem.url().path().startsWith(m_localRepoRoot) || !QFile::exists(m_localRepoRoot + '/' + m_plugin->fileName())) {
+ m_plugin = nullptr;
+
+ // The directory is not versioned. Reset the verification timer to a higher
+ // value, so that browsing through non-versioned directories is not slown down
+ // by an immediate verification.
+ m_dirVerificationTimer->setInterval(500);
+ } else {
+ // View was versionned but should not be anymore
+ updateItemStates();