return m_plugin->versionControlActions(items);
} else {
QList<QAction*> actions;
- for (const auto &plugin : qAsConst(m_plugins)) {
+ for (const QPointer<KVersionControlPlugin> &plugin : qAsConst(m_plugins)) {
actions << plugin->outOfVersionControlActions(items);
}
return actions;
}
if (m_plugin != nullptr) {
- if (!rootItem.url().path().startsWith(m_wcRoot) || !QFile::exists(m_wcRoot + '/' + m_plugin->fileName())) {
+ 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
initPlugins();
// Verify whether the current directory is under a version system
- for (const auto &plugin : qAsConst(m_plugins)) {
+ for (const QPointer<KVersionControlPlugin> &plugin : qAsConst(m_plugins)) {
+ if (!plugin) {
+ continue;
+ }
+
// first naively check if we are at working copy root
const QString fileName = directory.path() + '/' + plugin->fileName();
if (QFile::exists(fileName)) {
- m_wcRoot = directory.path();
+ m_localRepoRoot = directory.path();
return plugin;
}
- auto wcRoot = plugin->localRepositoryRoot(directory.path());
- if (!wcRoot.isEmpty()) {
- m_wcRoot = wcRoot;
+ const QString root = plugin->localRepositoryRoot(directory.path());
+ if (!root.isEmpty()) {
+ m_localRepoRoot = root;
return plugin;
}
}