From 4812cdb245fee471edd87f685a3833aeead705b7 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 25 Jan 2013 00:11:45 -0600 Subject: [PATCH] Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4 --- ChangeLog | 14 +++++++------- .../ConduitProgrammingTutorial/index.tex | 16 ++++++++-------- .../ConduitProgrammingTutorial/mal-factory.h | 2 +- conduits/abbrowserconduit/abbrowser-conduit.cc | 8 ++++---- conduits/knotes/knotes-action.cc | 2 +- conduits/popmail/popmail-conduit.h | 2 +- conduits/vcalconduit/cleanupstate.cc | 4 ++-- conduits/vcalconduit/vcal-conduitbase.cc | 6 +++--- kpilot/CMakeLists.txt | 2 +- kpilot/conduitConfigDialog.cc | 4 ++-- kpilot/conduitConfigDialog.h | 2 +- kpilot/fileInstaller.cc | 4 ++-- kpilot/kpilotConfig.cc | 2 +- kpilot/kpilotConfigDialog.cc | 2 +- kpilot/kpilot_config.desktop | 2 +- kpilot/kroupware.cc | 12 ++++++------ lib/kpilotlocallink.cc | 4 ++-- lib/plugin.h | 2 +- tests/exportdatebook.cc | 2 +- 19 files changed, 46 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index 679007b..3fa0b44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -798,7 +798,7 @@ TODO: only re-write a local database if it is changed. * Implemented the kontact plugin for KPilot (showing status information) * Added three DCOP functions to the daemon for querying status information * Hotsync log is written out to a file (~/.kde/share/apps/kpilot/lastsync.log) -* Converted all conduits to KConfig XT (mail und kroupware still missing) +* Converted all conduits to TDEConfig XT (mail und kroupware still missing) * Converted the config dialog to a KCM module * KPilot plugin for contact: shows status in summary and makes config available * kpilotDaemon sends a DCOP signal when its settings/state are changed @@ -808,7 +808,7 @@ TODO: only re-write a local database if it is changed. * implemented the kconf_update scripts to move groupless entries to the [General] group * Still missing: - o) KConfig sync between the three processes working on the + o) TDEConfig sync between the three processes working on the kpilot config: kpilot, kpilotDaemon and possibly kontact with the kpilot plugin o) Wizard to setup kpilot correctly for kontact (the defaults @@ -2524,7 +2524,7 @@ In these complex modern final days, (to quote Pogo), what's up? * conduits/knotes/* - Ditto; it configures and syncs, although the sync is rather sparse. I discovered that const char * const is a useful type, though. It saves - an accessor function for KConfig entry keys. + an accessor function for TDEConfig entry keys. The bad conduits: @@ -2594,7 +2594,7 @@ sync part which has not been tested at all. - Fixed up includes, removed old PISOCK_INCLUDE. * abbrowser-conduit.cc - Changed kdDebug() to DEBUGCONDUIT, applied indent style, #ifdef DEBUGs - - Replaced static QString objects by const char * (KConfig keys) + - Replaced static QString objects by const char * (TDEConfig keys) - Removed old files - Assume FirstTime is always *true*, this is at least partly broken, but it makes the conduit compile at least. @@ -3005,7 +3005,7 @@ KPilot dialogs with something sensible made with designer. of bugs in the other code. Added some documentation explaining possible crashes due to missing TDEApplication instance. FINALLY did something sensible about code duplication -- added get and - set methods to a subclass of KConfig for all KPilot settings. + set methods to a subclass of TDEConfig for all KPilot settings. * kpilot/kpilotOptions.{h,cc} Is deprecated and removed. Say hello to the new world of .ui files. * kpilot/kpilot.{h,cc} @@ -3178,7 +3178,7 @@ there, though. somewhere that there is a direct correlation between shoddy indenting style and bug density. * kpilot/pilotDaemon.h - Added a missing class declaration for KServerSocket. + Added a missing class declaration for TDEServerSocket. * kpilot/kpilot.{h,cc} Removed all remaining KPilotLink cruft. KPilot now communicates with the daemon through DCOP only. @@ -4201,7 +4201,7 @@ Some questions: * Do we really want to be new() and delete()ing the config file so often? Perhaps getConfig() should do some caching. * Should we add icons for the other menu items? -* Is there an entry iterator in KConfig so that you can iterate over +* Is there an entry iterator in TDEConfig so that you can iterate over entries in a certain group (and possibly delete them?) Some philosophical stuff: diff --git a/Documentation/ConduitProgrammingTutorial/index.tex b/Documentation/ConduitProgrammingTutorial/index.tex index 8f22471..8095a43 100644 --- a/Documentation/ConduitProgrammingTutorial/index.tex +++ b/Documentation/ConduitProgrammingTutorial/index.tex @@ -363,7 +363,7 @@ kpilotdaemon: somefunction: Value of i=5 In this section I will shortly describe how you can implement a configuration dialog for your conduit. There is nothing Palm- or KPilot-specific about this. All the configuration dialog does is to read the -configuration settings from the config file (using the \class{KConfig} class from tdelibs), and let +configuration settings from the config file (using the \class{TDEConfig} class from tdelibs), and let the user change them in the dialog. If the user exists the dialog by pressing OK, the new values are read from the dialog controls and written back to the configuration file. @@ -461,7 +461,7 @@ to retrieve the settings from the configuration file. We then use the methods of FUNCTIONSETUP; if (!fConfig) return; - KConfigGroupSaver s(fConfig,MALConduitFactory::group()); + TDEConfigGroupSaver s(fConfig,MALConduitFactory::group()); fConfigWidget->syncTime->setButton(fConfig->readNumEntry(MALConduitFactory::syncTime(), 0)); @@ -488,7 +488,7 @@ to retrieve the settings from the configuration file. We then use the methods of In this example, we don't store to the configuration file if a custom proxy port should be used. Instead, we just store a port number, and if the port number is 0 this means to use the default port. In this case, the custom port CheckBox needs to stay unchecked, and the port NumEntry control will stay disabled as it is in the dialog template. In all other cases, however, the custom port CheckBox should be checked, and the port NumEntry control will be enabled and filled with the correct custom port. -The KPilot user can then change all the settings in the dialogbox without any intervention from KPilot, so we don't need to write any code for that. Only the \code{commitChanges()} method remains to be done, which does the opposite of the readSettings() method. It reads the values of the controls and stores them to the configuration file. The \class{KConfig} class (the \code{fConfig} variable, resp.) has only one method \code{KConfig::writeEntry("entryname", valueOfWhateverType)} to write a value to the configuration file. However, this method has several overloaded implementations so that you can write numeric, string, boolean, date and many more variable types with the same syntax. First, we need to set the correct configuration group again, and then we just read each of the settings and write it out immediately using the \code{writeEntry} method: +The KPilot user can then change all the settings in the dialogbox without any intervention from KPilot, so we don't need to write any code for that. Only the \code{commitChanges()} method remains to be done, which does the opposite of the readSettings() method. It reads the values of the controls and stores them to the configuration file. The \class{TDEConfig} class (the \code{fConfig} variable, resp.) has only one method \code{TDEConfig::writeEntry("entryname", valueOfWhateverType)} to write a value to the configuration file. However, this method has several overloaded implementations so that you can write numeric, string, boolean, date and many more variable types with the same syntax. First, we need to set the correct configuration group again, and then we just read each of the settings and write it out immediately using the \code{writeEntry} method: {\footnotesize\begin{verbatim} /* virtual */ void MALWidgetSetup::commitChanges() @@ -496,7 +496,7 @@ The KPilot user can then change all the settings in the dialogbox without any in FUNCTIONSETUP; if (!fConfig) return; - KConfigGroupSaver s(fConfig,MALConduitFactory::group()); + TDEConfigGroupSaver s(fConfig,MALConduitFactory::group()); fConfig->writeEntry(MALConduitFactory::syncTime(), fConfigWidget->syncTime->id(fConfigWidget->syncTime->selected())); @@ -828,7 +828,7 @@ When using the libmal library, all we have to do is to make some proxy settings, void MALConduit::readConfig() { FUNCTIONSETUP; QDateTime dt; - KConfigGroupSaver g(fConfig, MALConduitFactory::group()); + TDEConfigGroupSaver g(fConfig, MALConduitFactory::group()); fLastSync = fConfig->readDateTimeEntry(MALConduitFactory::lastSync(), &dt); DEBUGCONDUIT<<"Last sync was "<writeEntry(MALConduitFactory::lastSync(), QDateTime::currentDateTime()); } @@ -1352,7 +1352,7 @@ bool DOCConduit::doSync(docSyncInfo &sinfo) { // Now calculate the md5 checksum of the PC text and write it to the config file { - KConfigGroupSaver g(fConfig, DOCConduitFactory::fGroup); + TDEConfigGroupSaver g(fConfig, DOCConduitFactory::fGroup); KMD5 docmd5; QFile docfile(docconverter.docFilename()); if (docfile.open(IO_ReadOnly)) { @@ -1392,7 +1392,7 @@ After the sync is done, just call cleanup and emit the \code{syncDone} signal: void DOCConduit::cleanup() { FUNCTIONSETUP; - KConfigGroupSaver g(fConfig, DOCConduitFactory::fGroup); + TDEConfigGroupSaver g(fConfig, DOCConduitFactory::fGroup); fConfig->writeEntry(DOCConduitFactory::fDOCList, fDBNames); fConfig->sync(); diff --git a/Documentation/ConduitProgrammingTutorial/mal-factory.h b/Documentation/ConduitProgrammingTutorial/mal-factory.h index dac91d0..ff9727c 100644 --- a/Documentation/ConduitProgrammingTutorial/mal-factory.h +++ b/Documentation/ConduitProgrammingTutorial/mal-factory.h @@ -41,7 +41,7 @@ protected: private: TDEInstance *fInstance; static TDEAboutData *fAbout; - // KConfig entry keys. + // TDEConfig entry keys. static const char *fGroup; static const char *fLastSync, *fSyncTime, *fProxyType, *fProxyServer, *fProxyPort, *fProxyUser, *fProxyPassword; diff --git a/conduits/abbrowserconduit/abbrowser-conduit.cc b/conduits/abbrowserconduit/abbrowser-conduit.cc index 8ccb9a2..9e677d0 100644 --- a/conduits/abbrowserconduit/abbrowser-conduit.cc +++ b/conduits/abbrowserconduit/abbrowser-conduit.cc @@ -285,14 +285,14 @@ bool AbbrowserConduit::_loadAddressBook() { // initialize the abook with the given file DEBUGKPILOT<<"Loading custom addressbook"<(fCalendar)->save( fCalendarFile ); if(!kurl.isLocalFile()) { - if( !KIO::NetAccess::upload( fCalendarFile + if( !TDEIO::NetAccess::upload( fCalendarFile , vccb->config()->calendarFile(), 0L) ) { vccb->addLogError( i18n( "An error occurred while uploading" @@ -94,7 +94,7 @@ void CleanUpState::startSync( ConduitAction *ca ) .arg(vccb->config()->calendarFile()).arg(fCalendarFile)); } else { - KIO::NetAccess::removeTempFile( fCalendarFile ); + TDEIO::NetAccess::removeTempFile( fCalendarFile ); } TQFile backup( fCalendarFile + CSL1( "~" ) ); backup.remove(); diff --git a/conduits/vcalconduit/vcal-conduitbase.cc b/conduits/vcalconduit/vcal-conduitbase.cc index 19b6790..a6cc86f 100644 --- a/conduits/vcalconduit/vcal-conduitbase.cc +++ b/conduits/vcalconduit/vcal-conduitbase.cc @@ -241,7 +241,7 @@ static void listResources( KCal::CalendarResources *p ) { FUNCTIONSETUP; - KConfig korgcfg( locate( "config", CSL1("korganizerrc") ) ); + TDEConfig korgcfg( locate( "config", CSL1("korganizerrc") ) ); // this part taken from adcalendarbase.cpp: korgcfg.setGroup( "Time & Date" ); @@ -292,14 +292,14 @@ static void listResources( KCal::CalendarResources *p ) i18n( "Using non-local time zone: %1" ).arg( tz ) ); KURL kurl( config()->calendarFile() ); - if( !KIO::NetAccess::download( config()->calendarFile(), + if( !TDEIO::NetAccess::download( config()->calendarFile(), fCalendarFile, 0L ) && !kurl.isLocalFile() ) { emit logError(i18n( "You chose to sync with the file \"%1\", which " "cannot be opened. Please make sure to supply a " "valid file name in the conduit's configuration dialog. " "Aborting the conduit." ).arg( config()->calendarFile() ) ); - KIO::NetAccess::removeTempFile( fCalendarFile ); + TDEIO::NetAccess::removeTempFile( fCalendarFile ); return false; } diff --git a/kpilot/CMakeLists.txt b/kpilot/CMakeLists.txt index f0e1fbb..b64378d 100644 --- a/kpilot/CMakeLists.txt +++ b/kpilot/CMakeLists.txt @@ -11,7 +11,7 @@ include_directories( ### # -# Settings (KConfigXT) shared between various parts of KPilot +# Settings (TDEConfigXT) shared between various parts of KPilot # set(settings_SRC kpilotConfig.cc diff --git a/kpilot/conduitConfigDialog.cc b/kpilot/conduitConfigDialog.cc index 2d79624..0f26ea5 100644 --- a/kpilot/conduitConfigDialog.cc +++ b/kpilot/conduitConfigDialog.cc @@ -72,7 +72,7 @@ extern "C" { - KDE_EXPORT KCModule *create_kpilotconfig( TQWidget *parent, const char * ) + KDE_EXPORT TDECModule *create_kpilotconfig( TQWidget *parent, const char * ) { FUNCTIONSETUP; return new ConduitConfigWidget( parent, "kcmkpilotconfig" ); @@ -207,7 +207,7 @@ static void addDescriptionPage(TQWidgetStack *parent, ConduitConfigWidgetBase::ConduitConfigWidgetBase(TQWidget *parent, const char *n) : - KCModule(parent, n), + TDECModule(parent, n), fConduitList(0L), fStack(0L), fConfigureButton(0L), diff --git a/kpilot/conduitConfigDialog.h b/kpilot/conduitConfigDialog.h index c4696ee..30b15ad 100644 --- a/kpilot/conduitConfigDialog.h +++ b/kpilot/conduitConfigDialog.h @@ -42,7 +42,7 @@ class TDEProcess; class ConduitConfigBase; class ConduitConfig; -class ConduitConfigWidgetBase : public KCModule +class ConduitConfigWidgetBase : public TDECModule { Q_OBJECT diff --git a/kpilot/fileInstaller.cc b/kpilot/fileInstaller.cc index 61b0e8c..608879c 100644 --- a/kpilot/fileInstaller.cc +++ b/kpilot/fileInstaller.cc @@ -120,9 +120,9 @@ void FileInstaller::deleteFiles(const TQStringList &files) KURL destDir(fDirName + CSL1("/") + srcName.fileName()); #if KDE_IS_VERSION(3,1,9) - return KIO::NetAccess::copy(srcName, destDir, w); + return TDEIO::NetAccess::copy(srcName, destDir, w); #else - return KIO::NetAccess::copy(srcName,destDir); + return TDEIO::NetAccess::copy(srcName,destDir); #endif } diff --git a/kpilot/kpilotConfig.cc b/kpilot/kpilotConfig.cc index 7fc6133..23c4107 100644 --- a/kpilot/kpilotConfig.cc +++ b/kpilot/kpilotConfig.cc @@ -207,7 +207,7 @@ static void update440() // Try to update conduit list { TQStringList conduits( KPilotSettings::installedConduits() ); - KConfig*c = KPilotSettings::self()->config(); + TDEConfig*c = KPilotSettings::self()->config(); /// c->resetGroup(); c->setGroup( TQString() ); bool installFiles = c->readBoolEntry("SyncFiles",true); diff --git a/kpilot/kpilotConfigDialog.cc b/kpilot/kpilotConfigDialog.cc index 239dfad..cafdcb0 100644 --- a/kpilot/kpilotConfigDialog.cc +++ b/kpilot/kpilotConfigDialog.cc @@ -511,7 +511,7 @@ void StartExitConfigPage::load() src.setPath(location); KURL dst; dst.setPath(autostart+desktopfile); - KIO::NetAccess::file_copy(src,dst,-1 /* 0666? */,true /* overwrite */); + TDEIO::NetAccess::file_copy(src,dst,-1 /* 0666? */,true /* overwrite */); } } else diff --git a/kpilot/kpilot_config.desktop b/kpilot/kpilot_config.desktop index 9debb08..5563e1a 100644 --- a/kpilot/kpilot_config.desktop +++ b/kpilot/kpilot_config.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Icon=kpilot Type=Service -ServiceTypes=KCModule +ServiceTypes=TDECModule X-TDE-ModuleType=Library X-TDE-Library=kpilot diff --git a/kpilot/kroupware.cc b/kpilot/kroupware.cc index 161fda1..0330c2e 100644 --- a/kpilot/kroupware.cc +++ b/kpilot/kroupware.cc @@ -68,7 +68,7 @@ void KroupwareSync::cleanupConfig() { // tempfile check in case app has terminated during sync // TODO!!! Use sensitive groups/keys for the kroupware branch... - KConfig* c = KPilotSettings::self()->config(); + TDEConfig* c = KPilotSettings::self()->config(); c->setGroup("todoOptions"); if ( c->hasKey( "CalFileBackup") ) { TQString fn = c->readPathEntry( "CalFileBackup" ); @@ -100,7 +100,7 @@ void KroupwareSync::start_syncCal_TodosWithKMail( bool cal, bool todos ) { if ( !cal && ! todos ) return; - KConfig*c = KPilotSettings::self()->config(); + TDEConfig*c = KPilotSettings::self()->config(); DCOPClient *client = kapp->dcopClient(); KTempFile tempfile; TQString filename = tempfile.name(); @@ -165,7 +165,7 @@ void KroupwareSync::start_syncAddWithKMail() } else { // TODO!!! better config handling! - KConfig*c = KPilotSettings::self()->config(); + TDEConfig*c = KPilotSettings::self()->config(); logMessage(CSL1("Calling addresses over DCOP succeeded")); c->setGroup("Abbrowser-conduit"); c->writePathEntry( "KMailTempFile" , filename ); @@ -183,7 +183,7 @@ void KroupwareSync::end_syncCal_TodosWithKMail( bool cal, bool todos) if ( !cal && ! todos ) return; TQString filename; - KConfig*c=KPilotSettings::self()->config(); + TDEConfig*c=KPilotSettings::self()->config(); if ( todos ) { logMessage( i18n("Rewriting to-dos to KMail..." )); c->setGroup("todoOptions"); @@ -229,8 +229,8 @@ void KroupwareSync::end_syncAddWithKMail() { logMessage( i18n("Syncing KMail with Addresses " )); DCOPClient *client = kapp->dcopClient(); - // TODO!! better config handling (KConfig XT) - KConfig*c = KPilotSettings::self()->config(); + // TODO!! better config handling (TDEConfig XT) + TDEConfig*c = KPilotSettings::self()->config(); c->setGroup("Abbrowser-conduit"); TQString filename = c->readPathEntry( "KMailTempFile" ); c->writeEntry( "KMailTempFile" , "empty" ); diff --git a/lib/kpilotlocallink.cc b/lib/kpilotlocallink.cc index c944a53..5f93a47 100644 --- a/lib/kpilotlocallink.cc +++ b/lib/kpilotlocallink.cc @@ -283,11 +283,11 @@ KPilotLocalLink::~KPilotLocalLink() KURL src = KURL::fromPathOrURL( canonicalSrcPath ); KURL dst = KURL::fromPathOrURL( canonicalDstPath ); - KIO::NetAccess::file_copy(src,dst,-1,true); + TDEIO::NetAccess::file_copy(src,dst,-1,true); if (deletefile) { - KIO::NetAccess::del(src, 0L); + TDEIO::NetAccess::del(src, 0L); } return true; diff --git a/lib/plugin.h b/lib/plugin.h index 57761b2..6966a0b 100644 --- a/lib/plugin.h +++ b/lib/plugin.h @@ -108,7 +108,7 @@ public: /** * Load or save the config widget's settings in the given - * KConfig object; leave the group unchanged. load() and + * TDEConfig object; leave the group unchanged. load() and * commit() should both call unmodified() to indicate that * the current settings match the on-disk ones. */ diff --git a/tests/exportdatebook.cc b/tests/exportdatebook.cc index 7034341..11c7879 100644 --- a/tests/exportdatebook.cc +++ b/tests/exportdatebook.cc @@ -87,7 +87,7 @@ int main(int argc, char **argv) } /* - KConfig korgcfg( locate( "config", CSL1("korganizerrc") ) ); + TDEConfig korgcfg( locate( "config", CSL1("korganizerrc") ) ); // this part taken from adcalendarbase.cpp: korgcfg.setGroup( "Time & Date" );