kpilot Library API Documentation

JPilotProxy-conduit.cc

00001 /* JPilotProxy-conduit.cc  
00002 **
00003 ** Copyright (C) 2002 by Reinhold Kainhofer
00004 **
00005 ** JPilotProxy-Conduit for syncing KPilot and KOrganizer
00006 **
00007 ** This file is part of the JPilotProxy conduit, a conduit for KPilot that
00008 ** synchronises the Pilot's JPilotProxy application with the outside world,
00009 ** which currently means KOrganizer.
00010 */
00011 
00012 /*
00013 ** This program is free software; you can redistribute it and/or modify
00014 ** it under the terms of the GNU General Public License as published by
00015 ** the Free Software Foundation; either version 2 of the License, or
00016 ** (at your option) any later version.
00017 **
00018 ** This program is distributed in the hope that it will be useful,
00019 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021 ** GNU General Public License for more details.
00022 **
00023 ** You should have received a copy of the GNU General Public License
00024 ** along with this program in a file called COPYING; if not, write to
00025 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00026 ** MA 02111-1307, USA.
00027 */
00028  
00029 /*
00030 ** Bug reports and questions can be sent to kde-pim@kde.org
00031 */
00032 
00033 #include "options.h"
00034 
00035 #if QT_VERSION < 300
00036 #include <qmsgbox.h>
00037 #else
00038 #include <qmessagebox.h>
00039 #endif
00040 
00041 #include <kconfig.h>
00042 
00043 #include "pilotRecord.h"
00044 #include "pilotSerialDatabase.h"
00045 #include "JPilotProxy-conduit.h"
00046 #include "JPilotProxy-factory.h"
00047 #include "jplugin.h"
00048 
00049 
00050 static const char *JPilotProxy_conduit_id = "$Id: JPilotProxy-conduit.cc,v 1.6 2003/03/08 01:43:04 waba Exp $";
00051 
00052 
00053 
00054 JPilotProxyConduit::JPilotProxyConduit(KPilotDeviceLink *d, const char *n, const QStringList &l) : ConduitAction(d,n,l) {
00055     FUNCTIONSETUP;
00056 #ifdef DEBUG
00057     DEBUGCONDUIT<<JPilotProxy_conduit_id<<endl;
00058 #endif
00059 }
00060 
00061 
00062 
00063 
00064 /* virtual */ bool JPilotProxyConduit::exec() {
00065     FUNCTIONSETUP;
00066     DEBUGCONDUIT<<JPilotProxy_conduit_id<<endl;
00067 
00068     if (!fConfig) return false;
00069 
00070     KConfigGroupSaver cfgs(fConfig, conduitSettingsGroup());
00071     
00072     if (!JPilotProxyConduitFactory::pluginsloaded) 
00073         JPilotProxyConduitFactory::loadPlugins(fConfig);
00074         
00075     if (JPilotProxyConduitFactory::pluginsloaded) {
00076         PluginIterator_t it(*JPilotProxyConduitFactory::plugins); // iterator for plugin list
00077         for ( ; it.current(); ++it ) {
00078             JPlugin*plug=it.current();
00079             if (plug->info.sync_on) {
00080                 #ifdef DEBUG
00081                 DEBUGCONDUIT<<"syncing "<<plug->info.name<<endl;
00082                 #endif
00083                 plug->pre_sync();
00084                 //TODO: first sync the db as defined by plug->info.db_name
00085                 
00086                 // then call the plugin's sync routine
00087                 plug->sync(pilotSocket());
00088                 plug->post_sync();
00089             }
00090         }
00091     }
00092 
00093     
00094 //  emit syncDone(this);
00095     return;
00096 }
00097 
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:47 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003