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