X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c44b9e685e55c419be2d139744233d232da82898..a7692611315065b308cd8243563cc50d40bd0f71:/src/views/versioncontrol/updateitemstatesthread.cpp diff --git a/src/views/versioncontrol/updateitemstatesthread.cpp b/src/views/versioncontrol/updateitemstatesthread.cpp index 6be07d361..7b806a592 100644 --- a/src/views/versioncontrol/updateitemstatesthread.cpp +++ b/src/views/versioncontrol/updateitemstatesthread.cpp @@ -20,6 +20,7 @@ #include "updateitemstatesthread.h" #include +#include #include @@ -28,7 +29,6 @@ UpdateItemStatesThread::UpdateItemStatesThread(KVersionControlPlugin* plugin, QThread(), m_globalPluginMutex(0), m_plugin(plugin), - m_retrievedItems(false), m_itemStates(itemStates) { // Several threads may share one instance of a plugin. A global @@ -47,12 +47,11 @@ void UpdateItemStatesThread::run() Q_ASSERT(!m_itemStates.isEmpty()); Q_ASSERT(m_plugin); - m_retrievedItems = false; - QMutexLocker pluginLocker(m_globalPluginMutex); - foreach (const QString& directory, m_itemStates.keys()) { - if (m_plugin->beginRetrieval(directory)) { - QVector& items = m_itemStates[directory]; + QMap >::iterator it = m_itemStates.begin(); + for (; it != m_itemStates.end(); ++it) { + if (m_plugin->beginRetrieval(it.key())) { + QVector& items = it.value(); const int count = items.count(); KVersionControlPlugin2* pluginV2 = qobject_cast(m_plugin); @@ -66,21 +65,10 @@ void UpdateItemStatesThread::run() items[i].version = static_cast(state); } } - - m_plugin->endRetrieval(); - m_retrievedItems = true; } - } -} - -bool UpdateItemStatesThread::lockPlugin() -{ - return m_globalPluginMutex->tryLock(300); -} -void UpdateItemStatesThread::unlockPlugin() -{ - m_globalPluginMutex->unlock(); + m_plugin->endRetrieval(); + } } QMap > UpdateItemStatesThread::itemStates() const @@ -88,9 +76,3 @@ QMap > UpdateItemStatesThrea return m_itemStates; } -bool UpdateItemStatesThread::retrievedItems() const -{ - return m_retrievedItems; -} - -#include "updateitemstatesthread.moc"