From 896ee459af10c73d20d0ae093b4c02348ffedb18 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 6 Nov 2009 15:43:08 +0000 Subject: * enable the loading of version control plugins (thanks to Aaron for the hint) * Don't terminate the thread that receives the item states when changing a view. Instead let the thread get finished and ignore the result. svn path=/trunk/KDE/kdebase/apps/; revision=1045674 --- src/versioncontrol/updateitemstatesthread.h | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/versioncontrol/updateitemstatesthread.h (limited to 'src/versioncontrol/updateitemstatesthread.h') diff --git a/src/versioncontrol/updateitemstatesthread.h b/src/versioncontrol/updateitemstatesthread.h new file mode 100644 index 000000000..36768d0e9 --- /dev/null +++ b/src/versioncontrol/updateitemstatesthread.h @@ -0,0 +1,68 @@ +/*************************************************************************** + * Copyright (C) 2009 by Peter Penz * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef UPDATEITEMSTATESTHREAD_H +#define UPDATEITEMSTATESTHREAD_H + +#include +#include + +#include +#include + +class KVersionControlPlugin; + +/** + * The performance of updating the version state of items depends + * on the used plugin. To prevent that Dolphin gets blocked by a + * slow plugin, the updating is delegated to a thread. + */ +class LIBDOLPHINPRIVATE_EXPORT UpdateItemStatesThread : public QThread +{ + Q_OBJECT + +public: + UpdateItemStatesThread(QObject* parent); + virtual ~UpdateItemStatesThread(); + + void setData(KVersionControlPlugin* plugin, + const QList& itemStates); + + bool beginReadItemStates(); + void endReadItemStates(); + QList itemStates() const; + + bool retrievedItems() const; + + void deleteWhenFinished(); + +protected: + virtual void run(); + +private slots: + void slotFinished(); + +private: + bool m_retrievedItems; + KVersionControlPlugin* m_plugin; + QMutex m_mutex; + QList m_itemStates; +}; + +#endif // UPDATEITEMSTATESTHREAD_H -- cgit v1.3