• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kpilot

actions.cc

Go to the documentation of this file.
00001 /* KPilot
00002 **
00003 ** Copyright (C) 1998-2001 by Dan Pilone <dan@kpilot.org>
00004 ** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00005 ** Copyright (C) 2006 Adriaan de Groot <groot@kde.org>
00006 **
00007 */
00008 
00009 /*
00010 ** This program is free software; you can redistribute it and/or modify
00011 ** it under the terms of the GNU General Public License as published by
00012 ** the Free Software Foundation; either version 2 of the License, or
00013 ** (at your option) any later version.
00014 **
00015 ** This program is distributed in the hope that it will be useful,
00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018 ** GNU General Public License for more details.
00019 **
00020 ** You should have received a copy of the GNU General Public License
00021 ** along with this program in a file called COPYING; if not, write to
00022 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00023 ** MA 02110-1301, USA.
00024 */
00025 
00026 /*
00027 ** Bug reports and questions can be sent to kde-pim@kde.org
00028 */
00029 #include "actions.h"
00030 
00031 #include <QtCore/QDir>
00032 #include <QtCore/QFile>
00033 #include <QtGui/QApplication>
00034 
00035 #include <ksavefile.h>
00036 
00037 #include "options.h"
00038 #include "pilot.h"
00039 #include "pilotUser.h"
00040 
00041 WelcomeAction::WelcomeAction(KPilotLink *p) :
00042     SyncAction(p, "welcomeAction")
00043 {
00044     FUNCTIONSETUP;
00045 }
00046 
00047 /* virtual */ bool WelcomeAction::exec()
00048 {
00049     FUNCTIONSETUP;
00050 
00051     addSyncLogEntry(i18n("KPilot %1 HotSync starting...\n",
00052         QString::fromLatin1(KPILOT_VERSION)));
00053     emit logMessage( i18n("Using encoding %1 on the handheld.",Pilot::codecName()) );
00054     return delayDone();
00055 }
00056 
00057 SorryAction::SorryAction(KPilotLink *p, const QString &s) :
00058     SyncAction(p, "sorryAction"),
00059     fMessage(s)
00060 {
00061     if (fMessage.isEmpty())
00062     {
00063         fMessage = i18n("KPilot is busy and cannot process the "
00064             "HotSync right now.");
00065     }
00066 }
00067 
00068 bool SorryAction::exec()
00069 {
00070     FUNCTIONSETUP;
00071 
00072     addSyncLogEntry(fMessage);
00073     return delayDone();
00074 }
00075 
00076 CleanupAction::CleanupAction(KPilotLink *p)  : SyncAction(p, "cleanupAction")
00077 {
00078     FUNCTIONSETUP;
00079 }
00080 
00081 /* virtual */ bool CleanupAction::exec()
00082 {
00083     FUNCTIONSETUP;
00084 
00085     if (deviceLink())
00086     {
00087         deviceLink()->endSync( KPilotLink::UpdateUserInfo );
00088     }
00089     return delayDone();
00090 }
00091 
00092 
00093 TestLink::TestLink(KPilotLink * p) :
00094     SyncAction(p, "testLink")
00095 {
00096     FUNCTIONSETUP;
00097 
00098 }
00099 
00100 /* virtual */ bool TestLink::exec()
00101 {
00102     FUNCTIONSETUP;
00103 
00104     int i;
00105     int dbindex = 0;
00106     int count = 0;
00107     struct DBInfo db;
00108 
00109     addSyncLogEntry(i18n("Testing.\n"));
00110 
00111     while ((i = deviceLink()->getNextDatabase(dbindex,&db)) > 0)
00112     {
00113         count++;
00114         dbindex = db.index + 1;
00115 
00116         DEBUGKPILOT << ": Read database " << db.name
00117             << " with index " << db.index;
00118 
00119         // Let the Pilot User know what's happening
00120         openConduit();
00121         // Let the KDE User know what's happening
00122         // Pretty sure all database names are in latin1.
00123         emit logMessage(i18n("Syncing database %1...",Pilot::fromPilot(db.name)));
00124     }
00125 
00126     emit logMessage(i18n("HotSync finished."));
00127     return delayDone();
00128 }

kpilot

Skip menu "kpilot"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal