svn path=/trunk/KDE/kdebase/apps/; revision=
1045694
#include "draganddrophelper.h"
#include "folderexpander.h"
#include "tooltips/tooltipmanager.h"
#include "draganddrophelper.h"
#include "folderexpander.h"
#include "tooltips/tooltipmanager.h"
-#include "versioncontrol/versioncontrolobserver.h"
#include "viewextensionsfactory.h"
#include "zoomlevelinfo.h"
#include "viewextensionsfactory.h"
#include "zoomlevelinfo.h"
connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()),
this, SLOT(updateFont()));
connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()),
this, SLOT(updateFont()));
- /*FolderExpander* folderExpander = new FolderExpander(this, m_proxyModel);
- folderExpander->setEnabled(DolphinSettings::instance().generalSettings()->autoExpandFolders());
- connect (folderExpander, SIGNAL(enterDir(const QModelIndex&)),
- m_container->m_controller, SLOT(triggerItem(const QModelIndex&)));
-
- new VersionControlObserver(this);*/
-
DolphinController* controller = m_container->m_controller;
connect(controller, SIGNAL(zoomLevelChanged(int)),
this, SLOT(setZoomLevel(int)));
DolphinController* controller = m_container->m_controller;
connect(controller, SIGNAL(zoomLevelChanged(int)),
this, SLOT(setZoomLevel(int)));
#include "updateitemstatesthread.h"
#include "updateitemstatesthread.h"
-UpdateItemStatesThread::UpdateItemStatesThread(QObject* parent) :
- QThread(parent),
+UpdateItemStatesThread::UpdateItemStatesThread() :
+ QThread(),
- m_mutex(QMutex::Recursive),
+ static QMutex globalMutex;
+ m_mutex = &globalMutex;
}
UpdateItemStatesThread::~UpdateItemStatesThread()
}
UpdateItemStatesThread::~UpdateItemStatesThread()
// VersionControlObserver::addDirectory() to be sure that the last item contains the root.
const QString directory = m_itemStates.last().item.url().directory(KUrl::AppendTrailingSlash);
// VersionControlObserver::addDirectory() to be sure that the last item contains the root.
const QString directory = m_itemStates.last().item.url().directory(KUrl::AppendTrailingSlash);
- QMutexLocker locker(&m_mutex);
+ QMutexLocker locker(m_mutex);
m_retrievedItems = false;
if (m_plugin->beginRetrieval(directory)) {
const int count = m_itemStates.count();
m_retrievedItems = false;
if (m_plugin->beginRetrieval(directory)) {
const int count = m_itemStates.count();
bool UpdateItemStatesThread::beginReadItemStates()
{
bool UpdateItemStatesThread::beginReadItemStates()
{
- return m_mutex.tryLock(300);
+ return m_mutex->tryLock(300);
}
void UpdateItemStatesThread::endReadItemStates()
{
}
void UpdateItemStatesThread::endReadItemStates()
{
}
QList<VersionControlObserver::ItemState> UpdateItemStatesThread::itemStates() const
}
QList<VersionControlObserver::ItemState> UpdateItemStatesThread::itemStates() const
- UpdateItemStatesThread(QObject* parent);
+ UpdateItemStatesThread();
virtual ~UpdateItemStatesThread();
void setData(KVersionControlPlugin* plugin,
virtual ~UpdateItemStatesThread();
void setData(KVersionControlPlugin* plugin,
private:
bool m_retrievedItems;
KVersionControlPlugin* m_plugin;
private:
bool m_retrievedItems;
KVersionControlPlugin* m_plugin;
QList<VersionControlObserver::ItemState> m_itemStates;
};
QList<VersionControlObserver::ItemState> m_itemStates;
};
if (m_updateItemStatesThread != 0) {
disconnect(m_updateItemStatesThread, SIGNAL(finished()),
this, SLOT(applyUpdatedItemStates()));
if (m_updateItemStatesThread != 0) {
disconnect(m_updateItemStatesThread, SIGNAL(finished()),
this, SLOT(applyUpdatedItemStates()));
- m_updateItemStatesThread->deleteWhenFinished();
+ if (m_updateItemStatesThread->isFinished()) {
+ delete m_updateItemStatesThread;
+ } else {
+ m_updateItemStatesThread->deleteWhenFinished();
+ }
m_updateItemStatesThread = 0;
}
m_updateItemStatesThread = 0;
}
+
+ m_plugin->disconnect();
+ m_plugin = 0;
}
QList<QAction*> VersionControlObserver::contextMenuActions(const KFileItemList& items) const
}
QList<QAction*> VersionControlObserver::contextMenuActions(const KFileItemList& items) const
{
Q_ASSERT(m_plugin != 0);
if (m_updateItemStatesThread == 0) {
{
Q_ASSERT(m_plugin != 0);
if (m_updateItemStatesThread == 0) {
- m_updateItemStatesThread = new UpdateItemStatesThread(this);
+ m_updateItemStatesThread = new UpdateItemStatesThread();
connect(m_updateItemStatesThread, SIGNAL(finished()),
this, SLOT(applyUpdatedItemStates()));
}
connect(m_updateItemStatesThread, SIGNAL(finished()),
this, SLOT(applyUpdatedItemStates()));
}