mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
fix crashing on launch
This commit is contained in:
parent
49e8b67b71
commit
a993a5979d
|
@ -112,7 +112,7 @@ QList<QAction*> VersionControlObserver::actions(const KFileItemList& items) cons
|
|||
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;
|
||||
|
@ -306,14 +306,18 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& director
|
|||
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_localRepoRoot = directory.path();
|
||||
return plugin;
|
||||
}
|
||||
auto root = plugin->localRepositoryRoot(directory.path());
|
||||
const QString root = plugin->localRepositoryRoot(directory.path());
|
||||
if (!root.isEmpty()) {
|
||||
m_localRepoRoot = root;
|
||||
return plugin;
|
||||
|
|
|
@ -146,7 +146,7 @@ private:
|
|||
|
||||
bool m_pluginsInitialized;
|
||||
KVersionControlPlugin* m_plugin;
|
||||
QList<KVersionControlPlugin*> m_plugins;
|
||||
QList<QPointer<KVersionControlPlugin>> m_plugins;
|
||||
UpdateItemStatesThread* m_updateItemStatesThread;
|
||||
|
||||
friend class UpdateItemStatesThread;
|
||||
|
|
Loading…
Reference in a new issue