X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/25751088c33ce507096a3e25ee1eeaa7de38c76b..8cea647ce11dbc8bb009f8a16adaaa94be3dcfb1:/src/views/versioncontrol/versioncontrolobserver.cpp diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index 13481cc7a..44dffac45 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -37,10 +37,10 @@ VersionControlObserver::VersionControlObserver(QObject* parent) : m_pendingItemStatesUpdate(false), m_versionedDirectory(false), m_silentUpdate(false), - m_model(0), - m_dirVerificationTimer(0), - m_plugin(0), - m_updateItemStatesThread(0) + m_model(nullptr), + m_dirVerificationTimer(nullptr), + m_plugin(nullptr), + m_updateItemStatesThread(nullptr) { // The verification timer specifies the timeout until the shown directory // is checked whether it is versioned. Per default it is assumed that users @@ -58,7 +58,7 @@ VersionControlObserver::~VersionControlObserver() { if (m_plugin) { m_plugin->disconnect(this); - m_plugin = 0; + m_plugin = nullptr; } } @@ -97,7 +97,7 @@ QList VersionControlObserver::actions(const KFileItemList& items) cons } } - if (!m_model || hasNullItems) { + if (!m_model || hasNullItems || !isVersioned()) { return {}; } @@ -163,7 +163,7 @@ void VersionControlObserver::verifyDirectory() void VersionControlObserver::slotThreadFinished() { UpdateItemStatesThread* thread = m_updateItemStatesThread; - m_updateItemStatesThread = 0; // The thread deletes itself automatically (see updateItemStates()) + m_updateItemStatesThread = nullptr; // The thread deletes itself automatically (see updateItemStates()) if (!m_plugin || !thread) { return; @@ -266,7 +266,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& director if (!pluginsAvailable) { // A searching for plugins has already been done, but no // plugins are installed - return 0; + return nullptr; } if (plugins.isEmpty()) { @@ -274,7 +274,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& director // all fileview version control plugins and remember them in 'plugins'. const QStringList enabledPlugins = VersionControlSettings::enabledPlugins(); - const KService::List pluginServices = KServiceTypeTrader::self()->query("FileViewVersionControlPlugin"); + const KService::List pluginServices = KServiceTypeTrader::self()->query(QStringLiteral("FileViewVersionControlPlugin")); for (KService::List::ConstIterator it = pluginServices.constBegin(); it != pluginServices.constEnd(); ++it) { if (enabledPlugins.contains((*it)->name())) { KVersionControlPlugin* plugin = (*it)->createInstance(); @@ -285,13 +285,13 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& director } if (plugins.isEmpty()) { pluginsAvailable = false; - return 0; + return nullptr; } } // We use the number of upUrl() calls to find the best matching plugin // for the given directory. The smaller value, the better it is (0 is best). - KVersionControlPlugin* bestPlugin = 0; + KVersionControlPlugin* bestPlugin = nullptr; int bestScore = INT_MAX; // Verify whether the current directory contains revision information