null-conduit.cc
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "options.h"
00035
00036
00037
00038
00039
00040 static const char *null_conduit_id=
00041 "$Id: null-conduit.cc,v 1.28.4.4 2003/03/12 23:31:11 adridg Exp $";
00042
00043
00044
00045
00046
00047
00048 #include <time.h>
00049
00050 #include <kconfig.h>
00051 #include <kdebug.h>
00052
00053 #include "pilotSerialDatabase.h"
00054 #include "null-factory.h"
00055 #include "null-conduit.h"
00056
00057
00058
00059
00060
00061
00062 NullConduit::NullConduit(KPilotDeviceLink *d,
00063 const char *n,
00064 const QStringList &l) :
00065 ConduitAction(d,n,l),
00066 fDatabase(0L)
00067 {
00068 FUNCTIONSETUP;
00069 #ifdef DEBUG
00070 DEBUGCONDUIT<<null_conduit_id<<endl;
00071 #endif
00072 }
00073
00074 NullConduit::~NullConduit()
00075 {
00076 FUNCTIONSETUP;
00077 KPILOT_DELETE(fDatabase);
00078 }
00079
00080 bool NullConduit::exec()
00081 {
00082 FUNCTIONSETUP;
00083 DEBUGCONDUIT<<null_conduit_id<<endl;
00084
00085 if (!fConfig)
00086 {
00087 kdWarning() << k_funcinfo
00088 << ": No configuration set for NULL conduit."
00089 << endl;
00090 return false;
00091 }
00092
00093 fConfig->setGroup(NullConduitFactory::group);
00094
00095 bool r = fConfig->readBoolEntry(NullConduitFactory::failImmediately);
00096 if (r)
00097 {
00098 #ifdef DEBUG
00099 DEBUGCONDUIT << fname << ": Config says to fail now." << endl;
00100 #endif
00101 return false;
00102 }
00103
00104 QString m=fConfig->readEntry(NullConduitFactory::message);
00105 addSyncLogEntry(m);
00106 emit logMessage(m);
00107
00108 #ifdef DEBUG
00109 DEBUGCONDUIT << fname
00110 << ": Message from null-conduit: "
00111 << m
00112 << endl;
00113 #endif
00114
00115 emit syncDone(this);
00116 return true;
00117 }
This file is part of the documentation for kdelibs Version 3.1.5.