mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +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);
|
return m_plugin->versionControlActions(items);
|
||||||
} else {
|
} else {
|
||||||
QList<QAction*> actions;
|
QList<QAction*> actions;
|
||||||
for (const auto &plugin : qAsConst(m_plugins)) {
|
for (const QPointer<KVersionControlPlugin> &plugin : qAsConst(m_plugins)) {
|
||||||
actions << plugin->outOfVersionControlActions(items);
|
actions << plugin->outOfVersionControlActions(items);
|
||||||
}
|
}
|
||||||
return actions;
|
return actions;
|
||||||
|
@ -306,14 +306,18 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const QUrl& director
|
||||||
initPlugins();
|
initPlugins();
|
||||||
|
|
||||||
// Verify whether the current directory is under a version system
|
// 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
|
// first naively check if we are at working copy root
|
||||||
const QString fileName = directory.path() + '/' + plugin->fileName();
|
const QString fileName = directory.path() + '/' + plugin->fileName();
|
||||||
if (QFile::exists(fileName)) {
|
if (QFile::exists(fileName)) {
|
||||||
m_localRepoRoot = directory.path();
|
m_localRepoRoot = directory.path();
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
auto root = plugin->localRepositoryRoot(directory.path());
|
const QString root = plugin->localRepositoryRoot(directory.path());
|
||||||
if (!root.isEmpty()) {
|
if (!root.isEmpty()) {
|
||||||
m_localRepoRoot = root;
|
m_localRepoRoot = root;
|
||||||
return plugin;
|
return plugin;
|
||||||
|
|
|
@ -146,7 +146,7 @@ private:
|
||||||
|
|
||||||
bool m_pluginsInitialized;
|
bool m_pluginsInitialized;
|
||||||
KVersionControlPlugin* m_plugin;
|
KVersionControlPlugin* m_plugin;
|
||||||
QList<KVersionControlPlugin*> m_plugins;
|
QList<QPointer<KVersionControlPlugin>> m_plugins;
|
||||||
UpdateItemStatesThread* m_updateItemStatesThread;
|
UpdateItemStatesThread* m_updateItemStatesThread;
|
||||||
|
|
||||||
friend class UpdateItemStatesThread;
|
friend class UpdateItemStatesThread;
|
||||||
|
|
Loading…
Reference in a new issue