summaryrefslogtreecommitdiffstats
path: root/kpilot/lib/actionQueue.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
commitf4fae92b6768541e2952173c3d4b09040f95bf7e (patch)
treed8c5d93232235cd635f3310b4d95490df181ba2d /kpilot/lib/actionQueue.cc
parent125c0a08265b75a133644d3b55f47e37c919f45d (diff)
downloadtdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.tar.gz
tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.zip
Moved kpilot from kdepim to applications, as the core Trinity libraries should not contain hardware-dependent software
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1221127 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpilot/lib/actionQueue.cc')
-rw-r--r--kpilot/lib/actionQueue.cc172
1 files changed, 0 insertions, 172 deletions
diff --git a/kpilot/lib/actionQueue.cc b/kpilot/lib/actionQueue.cc
deleted file mode 100644
index 693629731..000000000
--- a/kpilot/lib/actionQueue.cc
+++ /dev/null
@@ -1,172 +0,0 @@
-/* KPilot
-**
-** Copyright (C) 1998-2001 by Dan Pilone
-** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
-**
-** This defines the "ActionQueue", which is the pile of actions
-** that will occur during a HotSync.
-*/
-
-/*
-** 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 in a file called COPYING; if not, write to
-** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-** MA 02110-1301, USA.
-*/
-
-/*
-** Bug reports and questions can be sent to kde-pim@kde.org
-*/
-#include "options.h"
-
-#include <tqtimer.h>
-
-#include "actions.h"
-#include "plugin.h"
-
-#include "actionQueue.moc"
-
-
-
-
-ActionQueue::ActionQueue(KPilotLink *d) :
- SyncAction(d,"ActionQueue")
- // The string lists have default constructors
-{
- FUNCTIONSETUP;
-}
-
-ActionQueue::~ActionQueue()
-{
- FUNCTIONSETUP;
- clear();
-}
-
-void ActionQueue::clear()
-{
- SyncAction *del = 0L;
- while ( (del = nextAction()) )
- {
- delete del;
- }
-
- Q_ASSERT(isEmpty());
-}
-
-void ActionQueue::queueInit()
-{
- FUNCTIONSETUP;
-
- addAction(new WelcomeAction(fHandle));
-}
-
-void ActionQueue::queueConduits(const TQStringList &l,
- const SyncAction::SyncMode &m)
-{
- FUNCTIONSETUP;
-
- // Add conduits here ...
- //
- //
- for (TQStringList::ConstIterator it = l.begin();
- it != l.end();
- ++it)
- {
- if ((*it).startsWith(CSL1("internal_")))
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname <<
- ": Ignoring conduit " << *it << endl;
-#endif
- continue;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Creating proxy with mode=" << m.name() << endl;
-#endif
- ConduitProxy *cp = new ConduitProxy(fHandle,*it,m);
- addAction(cp);
- }
-}
-
-void ActionQueue::queueCleanup()
-{
- addAction(new CleanupAction(fHandle));
-}
-
-bool ActionQueue::exec()
-{
- actionCompleted(0L);
- return true;
-}
-
-void ActionQueue::actionCompleted(SyncAction *b)
-{
- FUNCTIONSETUP;
-
- if (b)
- {
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Completed action "
- << b->name()
- << endl;
-#endif
- delete b;
- }
-
- if (isEmpty())
- {
- delayDone();
- return;
- }
- if ( deviceLink() && (!deviceLink()->tickle()) )
- {
- emit logError(i18n("The connection to the handheld "
- "was lost. Synchronization cannot continue."));
- clear();
- delayDone();
- return;
- }
-
- SyncAction *a = nextAction();
-
- if (!a)
- {
- WARNINGKPILOT << "NULL action on stack."
- << endl;
- return;
- }
-
-#ifdef DEBUG
- DEBUGKPILOT << fname
- << ": Will run action "
- << a->name()
- << endl;
-#endif
-
- TQObject::connect(a, TQT_SIGNAL(logMessage(const TQString &)),
- this, TQT_SIGNAL(logMessage(const TQString &)));
- TQObject::connect(a, TQT_SIGNAL(logError(const TQString &)),
- this, TQT_SIGNAL(logMessage(const TQString &)));
- TQObject::connect(a, TQT_SIGNAL(logProgress(const TQString &, int)),
- this, TQT_SIGNAL(logProgress(const TQString &, int)));
- TQObject::connect(a, TQT_SIGNAL(syncDone(SyncAction *)),
- this, TQT_SLOT(actionCompleted(SyncAction *)));
-
- // Run the action picked from the queue when we get back
- // to the event loop.
- TQTimer::singleShot(0,a,TQT_SLOT(execConduit()));
-}
-