From 66abbed5e08370412b81be1628590898ceeeb604 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 29 May 2021 19:05:31 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro --- Documentation/ConduitProgrammingTutorial/index.tex | 16 +-- .../ConduitProgrammingTutorial/mal-factory.cc | 123 --------------------- .../ConduitProgrammingTutorial/mal-factory.cpp | 123 +++++++++++++++++++++ 3 files changed, 131 insertions(+), 131 deletions(-) delete mode 100644 Documentation/ConduitProgrammingTutorial/mal-factory.cc create mode 100644 Documentation/ConduitProgrammingTutorial/mal-factory.cpp (limited to 'Documentation/ConduitProgrammingTutorial') diff --git a/Documentation/ConduitProgrammingTutorial/index.tex b/Documentation/ConduitProgrammingTutorial/index.tex index 35bdc00..909df86 100644 --- a/Documentation/ConduitProgrammingTutorial/index.tex +++ b/Documentation/ConduitProgrammingTutorial/index.tex @@ -217,9 +217,9 @@ service_DATA = mal_conduit.desktop kde_module_LTLIBRARIES = libmalconduit.la libmalconduit_la_SOURCES = \ - mal-factory.cc \ - mal-setup.cc \ - mal-conduit.cc \ + mal-factory.cpp \ + mal-setup.cpp \ + mal-conduit.cpp \ mal-setup_dialog.ui libmalconduit_la_LDFLAGS = $(KDE_RPATH) -L../../lib libmalconduit_la_LIBADD = -lkpilot $(MAL_LIB) @@ -281,7 +281,7 @@ always returns a pointer to a \class{KLibFactory} instance. Whenever a program n the conduit, it calls the \code{createObject} of the \class{KLibFactory} to get an appropriate object. Furthermore, the conduit factory initializes the about dialog of the conduit. -The factories of all conduits are very similar, so you best just copy the .h and .cc file of an existing conduit +The factories of all conduits are very similar, so you best just copy the .h and .cpp file of an existing conduit for your conduit. All you need to do is to change the copyright notices for the about dialog, and change the class names of the \class{ConduitAction} and \class{ConduitSetup} to your own class names. Also, the factory is a good place to define the strings for the config settings' entries to the config file. @@ -297,7 +297,7 @@ private: } ; \end{verbatim} } -and in the .cc file +and in the .cpp file {\small\begin{verbatim} const char*MALConduitFactory::fConfigSetting1="NameOfSetting"; \end{verbatim} @@ -311,7 +311,7 @@ Everything else in the factory can stay as it is. Here is an example of the malsync's factory: \begin{htmlonly} \htmladdnormallink{Source code of mal-factory.h}{mal-factory.h} - \htmladdnormallink{Source code of mal-factory.cc}{mal-factory.cc} + \htmladdnormallink{Source code of mal-factory.cpp}{mal-factory.cpp} \end{htmlonly} @@ -320,9 +320,9 @@ Here is an example of the malsync's factory: {\scriptsize \verbatiminput{mal-factory.h} } -\subsubsection{mal-factory.cc} +\subsubsection{mal-factory.cpp} {\scriptsize - \verbatiminput{mal-factory.cc} + \verbatiminput{mal-factory.cpp} } \end{latexonly} diff --git a/Documentation/ConduitProgrammingTutorial/mal-factory.cc b/Documentation/ConduitProgrammingTutorial/mal-factory.cc deleted file mode 100644 index dcbfdd8..0000000 --- a/Documentation/ConduitProgrammingTutorial/mal-factory.cc +++ /dev/null @@ -1,123 +0,0 @@ -/* Time-factory.cc KPilot -** -** Copyright (C) 2002 by Reinhold Kainhofer -** -** This file defines the factory for the MAL-conduit plugin. -*/ - -#include "options.h" - -#include -#include -#include - -#include // Needed by pilot-link include -#include "mal-conduit.h" -#include "mal-setup.h" - -#include "mal-factory.moc" - - -extern "C" -{ - -void *init_libmalconduit() -{ - return new MALConduitFactory; -} - -} ; - - -// A number of static variables -TDEAboutData *MALConduitFactory::fAbout = 0L; -const char *MALConduitFactory::fGroup = "MAL-conduit"; -const char *MALConduitFactory::fLastSync = "Last MAL Sync"; -const char *MALConduitFactory::fSyncTime = "Sync Frequency"; -const char *MALConduitFactory::fProxyType = "Proxy Type"; -const char *MALConduitFactory::fProxyServer = "Proxy Server"; -const char *MALConduitFactory::fProxyPort = "Proxy Port"; -const char *MALConduitFactory::fProxyUser = "Proxy User"; -const char *MALConduitFactory::fProxyPassword = "Proxy Password"; - -MALConduitFactory::MALConduitFactory(TQObject *p, const char *n) : - KLibFactory(p,n) -{ - FUNCTIONSETUP; - - fInstance = new TDEInstance("MALconduit"); - fAbout = new TDEAboutData("MALconduit", - I18N_NOOP("MAL Synchronization Conduit for KPilot"), - KPILOT_VERSION, - I18N_NOOP("Synchronizes the content from MAL Servers like AvantGo to the Handheld"), - TDEAboutData::License_GPL, - "(C) 2002, Reinhold Kainhofer"); - fAbout->addAuthor("Reinhold Kainhofer", - I18N_NOOP("Primary Author"), "reinhold@kainhofer.com", "http://reinhold.kainhofer.com/"); - fAbout->addAuthor("Jason Day", - I18N_NOOP("Author of libmal and the JPilot AvantGo conduit"), "jasonday@worldnet.att.net"); - fAbout->addAuthor("Tom Whittaker", - I18N_NOOP("Author of syncmal"), "tom@tomw.org", "http://www.tomw.org/"); - fAbout->addAuthor("AvantGo, Inc.", - I18N_NOOP("Authors of the malsync library (c) 1997-1999"), "www.avantgo.com", "http://www.avantgo.com/"); -} - -MALConduitFactory::~MALConduitFactory() -{ - FUNCTIONSETUP; - - KPILOT_DELETE(fInstance); - KPILOT_DELETE(fAbout); -} - -/* virtual */ TQObject *MALConduitFactory::createObject( TQObject *p, - const char *n, - const char *c, - const TQStringList &a) -{ - FUNCTIONSETUP; - -#ifdef DEBUG - DEBUGKPILOT << fname - << ": Creating object of class " - << c - << endl; -#endif - - if (qstrcmp(c,"ConduitConfig")==0) - { - TQWidget *w = dynamic_cast(p); - - if (w) - { - return new MALWidgetSetup(w,n,a); - } - else - { - kdError() << k_funcinfo - << ": Couldn't cast parent to widget." - << endl; - return 0L; - } - } - - if (qstrcmp(c,"SyncAction")==0) - { - KPilotDeviceLink *d = dynamic_cast(p); - - if (d) - { - return new MALConduit(d,n,a); - } - else - { - kdError() << k_funcinfo - << ": Couldn't cast parent to KPilotDeviceLink" - << endl; - return 0L; - } - } - - return 0L; -} - diff --git a/Documentation/ConduitProgrammingTutorial/mal-factory.cpp b/Documentation/ConduitProgrammingTutorial/mal-factory.cpp new file mode 100644 index 0000000..b7392ae --- /dev/null +++ b/Documentation/ConduitProgrammingTutorial/mal-factory.cpp @@ -0,0 +1,123 @@ +/* Time-factory.cpp KPilot +** +** Copyright (C) 2002 by Reinhold Kainhofer +** +** This file defines the factory for the MAL-conduit plugin. +*/ + +#include "options.h" + +#include +#include +#include + +#include // Needed by pilot-link include +#include "mal-conduit.h" +#include "mal-setup.h" + +#include "mal-factory.moc" + + +extern "C" +{ + +void *init_libmalconduit() +{ + return new MALConduitFactory; +} + +} ; + + +// A number of static variables +TDEAboutData *MALConduitFactory::fAbout = 0L; +const char *MALConduitFactory::fGroup = "MAL-conduit"; +const char *MALConduitFactory::fLastSync = "Last MAL Sync"; +const char *MALConduitFactory::fSyncTime = "Sync Frequency"; +const char *MALConduitFactory::fProxyType = "Proxy Type"; +const char *MALConduitFactory::fProxyServer = "Proxy Server"; +const char *MALConduitFactory::fProxyPort = "Proxy Port"; +const char *MALConduitFactory::fProxyUser = "Proxy User"; +const char *MALConduitFactory::fProxyPassword = "Proxy Password"; + +MALConduitFactory::MALConduitFactory(TQObject *p, const char *n) : + KLibFactory(p,n) +{ + FUNCTIONSETUP; + + fInstance = new TDEInstance("MALconduit"); + fAbout = new TDEAboutData("MALconduit", + I18N_NOOP("MAL Synchronization Conduit for KPilot"), + KPILOT_VERSION, + I18N_NOOP("Synchronizes the content from MAL Servers like AvantGo to the Handheld"), + TDEAboutData::License_GPL, + "(C) 2002, Reinhold Kainhofer"); + fAbout->addAuthor("Reinhold Kainhofer", + I18N_NOOP("Primary Author"), "reinhold@kainhofer.com", "http://reinhold.kainhofer.com/"); + fAbout->addAuthor("Jason Day", + I18N_NOOP("Author of libmal and the JPilot AvantGo conduit"), "jasonday@worldnet.att.net"); + fAbout->addAuthor("Tom Whittaker", + I18N_NOOP("Author of syncmal"), "tom@tomw.org", "http://www.tomw.org/"); + fAbout->addAuthor("AvantGo, Inc.", + I18N_NOOP("Authors of the malsync library (c) 1997-1999"), "www.avantgo.com", "http://www.avantgo.com/"); +} + +MALConduitFactory::~MALConduitFactory() +{ + FUNCTIONSETUP; + + KPILOT_DELETE(fInstance); + KPILOT_DELETE(fAbout); +} + +/* virtual */ TQObject *MALConduitFactory::createObject( TQObject *p, + const char *n, + const char *c, + const TQStringList &a) +{ + FUNCTIONSETUP; + +#ifdef DEBUG + DEBUGKPILOT << fname + << ": Creating object of class " + << c + << endl; +#endif + + if (qstrcmp(c,"ConduitConfig")==0) + { + TQWidget *w = dynamic_cast(p); + + if (w) + { + return new MALWidgetSetup(w,n,a); + } + else + { + kdError() << k_funcinfo + << ": Couldn't cast parent to widget." + << endl; + return 0L; + } + } + + if (qstrcmp(c,"SyncAction")==0) + { + KPilotDeviceLink *d = dynamic_cast(p); + + if (d) + { + return new MALConduit(d,n,a); + } + else + { + kdError() << k_funcinfo + << ": Couldn't cast parent to KPilotDeviceLink" + << endl; + return 0L; + } + } + + return 0L; +} + -- cgit v1.2.1