diff options
| author | Peter Penz <[email protected]> | 2010-07-24 22:17:01 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-07-24 22:17:01 +0000 |
| commit | 1cb5a202e4c861025d4eda5813848cdb7d5f350d (patch) | |
| tree | 3f9696104b3c666f2a66c23c06b9427c759a012d /src/versioncontrol/pendingthreadsmaintainer.cpp | |
| parent | a5cf21ff06aff44cde563eaceae3c6cef452ee48 (diff) | |
Sourcecode hierarchy cleanup: Move folders "tooltips" and "versioncontrol" into "views"
svn path=/trunk/KDE/kdebase/apps/; revision=1154151
Diffstat (limited to 'src/versioncontrol/pendingthreadsmaintainer.cpp')
| -rw-r--r-- | src/versioncontrol/pendingthreadsmaintainer.cpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/versioncontrol/pendingthreadsmaintainer.cpp b/src/versioncontrol/pendingthreadsmaintainer.cpp deleted file mode 100644 index f61c79975..000000000 --- a/src/versioncontrol/pendingthreadsmaintainer.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Peter Penz <[email protected]> * - * * - * 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 * - ***************************************************************************/ - -#include "pendingthreadsmaintainer.h" - -#include <kglobal.h> -#include <QThread> -#include <QTimer> - -struct PendingThreadsMaintainerSingleton -{ - PendingThreadsMaintainer instance; -}; -K_GLOBAL_STATIC(PendingThreadsMaintainerSingleton, s_pendingThreadsMaintainer) - - -PendingThreadsMaintainer& PendingThreadsMaintainer::instance() -{ - return s_pendingThreadsMaintainer->instance; -} - -PendingThreadsMaintainer::~PendingThreadsMaintainer() -{ -} - -void PendingThreadsMaintainer::append(QThread* thread) -{ - Q_ASSERT(thread != 0); - m_threads.append(thread); - m_timer->start(); -} - -PendingThreadsMaintainer::PendingThreadsMaintainer() : - QObject(), - m_threads(), - m_timer(0) -{ - m_timer = new QTimer(this); - m_timer->setSingleShot(true); - m_timer->setInterval(5000); // 5 seconds - connect(m_timer, SIGNAL(timeout()), this, SLOT(cleanup())); -} - -void PendingThreadsMaintainer::cleanup() -{ - QList<QThread*>::iterator it = m_threads.begin(); - while (it != m_threads.end()) { - if ((*it)->isFinished()) { - (*it)->deleteLater(); - it = m_threads.erase(it); - } else { - ++it; - } - } - - if (!m_threads.isEmpty()) { - m_timer->start(); - } -} - -#include "pendingthreadsmaintainer.moc" |
