diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-25 00:18:25 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-25 00:18:25 -0600 |
commit | 84fba9037b6e998250f30968b0d9c79a6af4637a (patch) | |
tree | 0baefd17473cdfe4aeeffe5b471ee1c50c67462a | |
parent | 58229b7f2f011bb94adadea107eff15e929ccb3c (diff) | |
download | pytdeextensions-84fba9037b6e998250f30968b0d9c79a6af4637a.tar.gz pytdeextensions-84fba9037b6e998250f30968b0d9c79a6af4637a.zip |
Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4
-rwxr-xr-x | app_templates/kcontrol_module/src/kcontrol_module.py | 8 | ||||
-rw-r--r-- | doc/en/index.docbook | 2 | ||||
-rw-r--r-- | src/kdedistutils.py | 28 |
3 files changed, 19 insertions, 19 deletions
diff --git a/app_templates/kcontrol_module/src/kcontrol_module.py b/app_templates/kcontrol_module/src/kcontrol_module.py index 423b029..f1bf186 100755 --- a/app_templates/kcontrol_module/src/kcontrol_module.py +++ b/app_templates/kcontrol_module/src/kcontrol_module.py @@ -51,7 +51,7 @@ standalone = __name__=='__main__' if standalone: programbase = KDialogBase else: - programbase = KCModule + programbase = TDECModule class KcontrolModuleApp(programbase): ######################################################################## @@ -61,9 +61,9 @@ class KcontrolModuleApp(programbase): KDialogBase.__init__(self,KJanusWidget.Plain,"Kcontrol module",KDialogBase.User1|KDialogBase.Close, KDialogBase.Close) self.setButtonText(KDialogBase.User1,"About") else: - KCModule.__init__(self,parent,name) + TDECModule.__init__(self,parent,name) # Create a configuration object. - self.config = KConfig("kcontrol_module") + self.config = TDEConfig("kcontrol_module") self.setButtons(0) self.aboutdata = AboutData() @@ -142,7 +142,7 @@ class KcontrolModuleApp(programbase): def buttons(self): # Only supply a Help button. Other choices are Default and Apply. - return KCModule.Help + return TDECModule.Help ############################################################################ # This is the entry point used when running this module outside of kcontrol. diff --git a/doc/en/index.docbook b/doc/en/index.docbook index a425de2..be40854 100644 --- a/doc/en/index.docbook +++ b/doc/en/index.docbook @@ -376,7 +376,7 @@ C++ glue code is needed when writing in module in Python. Fortunately </para> <para> The best way to start learning about creating modules is to read the -<ulink url="http://developer.kde.org/documentation/other/kcm_howto.html">KConfig +<ulink url="http://developer.kde.org/documentation/other/kcm_howto.html">TDEConfig Module HOWTO</ulink>. It is written for C++, but the concepts are the same for Python. </para> diff --git a/src/kdedistutils.py b/src/kdedistutils.py index c9749c0..7af6a21 100644 --- a/src/kdedistutils.py +++ b/src/kdedistutils.py @@ -886,15 +886,15 @@ class BuildKControlModule(Command): #define LIB_PYTHON "libpython%(python_version)s.so" #define debug 1 -static KCModule *report_error(char *msg) { +static TDECModule *report_error(char *msg) { if (debug) printf ("error: %%s\n", msg); return NULL; } -static KCModule* return_instance( QWidget *parent, const char *name ) { - KCModule* kcmodule; - PyObject *pyKCModuleTuple; - PyObject *pyKCModule; +static TDECModule* return_instance( QWidget *parent, const char *name ) { + TDECModule* kcmodule; + PyObject *pyTDECModuleTuple; + PyObject *pyTDECModule; Pythonize *pyize; // Pythonize object to manage the Python interpreter. int isErr; @@ -957,8 +957,8 @@ static KCModule* return_instance( QWidget *parent, const char *name ) { PyObject *args = Py_BuildValue ("NN", pyParent, pyName); if(pyName && pyParent && args) { // run the factory function - pyKCModuleTuple = pyize->runFunction(kcmFactory, args); - if(!pyKCModuleTuple) { + pyTDECModuleTuple = pyize->runFunction(kcmFactory, args); + if(!pyTDECModuleTuple) { PyErr_Print(); return report_error ("*** runFunction failure\n;"); } @@ -970,16 +970,16 @@ static KCModule* return_instance( QWidget *parent, const char *name ) { pyize->decref(kcmFactory); // Stop this from getting garbage collected. - Py_INCREF(PyTuple_GET_ITEM(pyKCModuleTuple,0)); + Py_INCREF(PyTuple_GET_ITEM(pyTDECModuleTuple,0)); - // convert the KCModule PyObject to a real C++ KCModule *. + // convert the TDECModule PyObject to a real C++ TDECModule *. isErr = 0; - pyKCModule = PyTuple_GET_ITEM(pyKCModuleTuple,1); - kcmodule = (KCModule *)PyLong_AsVoidPtr(pyKCModule); + pyTDECModule = PyTuple_GET_ITEM(pyTDECModuleTuple,1); + kcmodule = (TDECModule *)PyLong_AsVoidPtr(pyTDECModule); if(!kcmodule) { return report_error ("***failed sip conversion to C++ pointer\n"); } - pyize->decref(pyKCModuleTuple); + pyize->decref(pyTDECModuleTuple); // PyTDE can't run the module without this - Pythonize // grabs the lock at initialization and we have to give @@ -990,13 +990,13 @@ static KCModule* return_instance( QWidget *parent, const char *name ) { // take care of any translation info TDEGlobal::locale()->insertCatalogue(script); - // Return the pointer to our new KCModule + // Return the pointer to our new TDECModule return kcmodule; } extern "C" { // Factory function that kcontrol will call. - KCModule* CPP_FACTORY(QWidget *parent, const char *name) { + TDECModule* CPP_FACTORY(QWidget *parent, const char *name) { return return_instance(parent, name); } } |