vcal-factory.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 #include "options.h"
00030
00031 #include <kinstance.h>
00032 #include <kaboutdata.h>
00033
00034 #include "vcal-setup.h"
00035 #include "vcal-conduit.h"
00036 #include "vcal-factory.moc"
00037
00038
00039 extern "C"
00040 {
00041
00042 void *init_libvcalconduit()
00043 {
00044 return new VCalConduitFactory;
00045 }
00046
00047 } ;
00048
00049
00050
00051
00052 const char * const VCalConduitFactory::group = "vcalOptions" ;
00053
00054
00055 KAboutData *VCalConduitFactory::fAbout = 0L;
00056 VCalConduitFactory::VCalConduitFactory(QObject *p, const char *n) :
00057 VCalConduitFactoryBase(p,n)
00058 {
00059 FUNCTIONSETUP;
00060
00061 fInstance = new KInstance("vcalconduit");
00062 fAbout = new KAboutData("vcalConduit",
00063 I18N_NOOP("VCal Conduit for KPilot"),
00064 KPILOT_VERSION,
00065 I18N_NOOP("Configures the VCal Conduit for KPilot"),
00066 KAboutData::License_GPL,
00067 "(C) 2001, Adriaan de Groot");
00068 fAbout->addAuthor("Adriaan de Groot",
00069 I18N_NOOP("Maintainer"),
00070 "groot@kde.org",
00071 "http://www.cs.kun.nl/~adridg/kpilot");
00072 fAbout->addAuthor("Reinhold Kainhofer",
00073 I18N_NOOP("Maintainer"),
00074 "reinhold@kainhofer.com",
00075 "http://reinhold.kainhofer.com/Linux/");
00076 fAbout->addAuthor("Dan Pilone",
00077 I18N_NOOP("Original Author"));
00078 fAbout->addAuthor("Preston Brown",
00079 I18N_NOOP("Original Author"));
00080 fAbout->addAuthor("Herwin-Jan Steehouwer",
00081 I18N_NOOP("Original Author"));
00082 fAbout->addAuthor("Cornelius Schumacher",
00083 I18N_NOOP("iCalendar port"));
00084 fAbout->addCredit("Philipp Hullmann",
00085 I18N_NOOP("Bugfixer"));
00086 }
00087
00088 VCalConduitFactory::~VCalConduitFactory()
00089 {
00090 FUNCTIONSETUP;
00091
00092 KPILOT_DELETE(fInstance);
00093 KPILOT_DELETE(fAbout);
00094 }
00095
00096 QObject *VCalConduitFactory::createObject( QObject *p,
00097 const char *n,
00098 const char *c,
00099 const QStringList &a)
00100 {
00101 FUNCTIONSETUP;
00102
00103 #ifdef DEBUG
00104 DEBUGCONDUIT << fname
00105 << ": Creating object of class "
00106 << c
00107 << endl;
00108 #endif
00109
00110 if (qstrcmp(c,"ConduitConfig")==0)
00111 {
00112 QWidget *w = dynamic_cast<QWidget *>(p);
00113
00114 if (w)
00115 {
00116 return new VCalWidgetSetup(w,n,a);
00117 }
00118 else
00119 {
00120 #ifdef DEBUG
00121 DEBUGCONDUIT << fname
00122 << ": Couldn't cast parent to widget."
00123 << endl;
00124 #endif
00125 return 0L;
00126 }
00127 }
00128
00129 if (qstrcmp(c,"SyncAction")==0)
00130 {
00131 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00132
00133 if (d)
00134 {
00135 return new VCalConduit(d,n,a);
00136 }
00137 else
00138 {
00139 kdError() << k_funcinfo
00140 << ": Couldn't cast to KPilotDeviceLink."
00141 << endl;
00142 }
00143 }
00144
00145 return 0L;
00146 }
This file is part of the documentation for kdelibs Version 3.1.5.