Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4

pull/2/head
Timothy Pearson 12 years ago
parent 4066d7fb18
commit 2d5b7ef7c2

@ -387,7 +387,7 @@ class MonitorDialog(KDialogBase):
if standalone: if standalone:
programbase = KDialogBase programbase = KDialogBase
else: else:
programbase = KCModule programbase = TDECModule
############################################################################ ############################################################################
class DisplayApp(programbase): class DisplayApp(programbase):
@ -402,8 +402,8 @@ class DisplayApp(programbase):
self.setButtonText(KDialogBase.User1,i18n("Reset")) self.setButtonText(KDialogBase.User1,i18n("Reset"))
self.setButtonText(KDialogBase.User2,i18n("About")) self.setButtonText(KDialogBase.User2,i18n("About"))
else: else:
KCModule.__init__(self,parent,name) TDECModule.__init__(self,parent,name)
self.setButtons(KCModule.Apply|KCModule.Reset) self.setButtons(TDECModule.Apply|TDECModule.Reset)
self.aboutdata = MakeAboutData() self.aboutdata = MakeAboutData()
# This line has the effect of hiding the "Admin only" message and also forcing # This line has the effect of hiding the "Admin only" message and also forcing
@ -412,7 +412,7 @@ class DisplayApp(programbase):
self.setUseRootOnlyMsg(False) self.setUseRootOnlyMsg(False)
# Create a configuration object. # Create a configuration object.
self.config = KConfig("displayconfigrc") self.config = TDEConfig("displayconfigrc")
# Compact mode means that we have to make the GUI # Compact mode means that we have to make the GUI
# much smaller to fit on low resolution screens. # much smaller to fit on low resolution screens.
@ -713,7 +713,7 @@ class DisplayApp(programbase):
if not standalone: if not standalone:
tabcontrol.addTab(self.dpmspage,tabname) tabcontrol.addTab(self.dpmspage,tabname)
def save(self): # KCModule def save(self): # TDECModule
xorg_config_changed = self.xsetup.isXorgConfigChanged() xorg_config_changed = self.xsetup.isXorgConfigChanged()
restart_recommended = self.xsetup.getRestartHint() restart_recommended = self.xsetup.getRestartHint()
@ -819,7 +819,7 @@ class DisplayApp(programbase):
print "Live gamma change not supported" print "Live gamma change not supported"
KDialogBase.slotClose(self) KDialogBase.slotClose(self)
def load(self): # KCModule def load(self): # TDECModule
self.__reset() self.__reset()
self._sendChangedSignal() self._sendChangedSignal()

@ -37,7 +37,7 @@ standalone = __name__=='__main__'
if standalone: if standalone:
programbase = KDialogBase programbase = KDialogBase
else: else:
programbase = KCModule programbase = TDECModule
parsable = ["default","menu","color","timeout","hiddenmenu","title","root","kernel","initrd"] parsable = ["default","menu","color","timeout","hiddenmenu","title","root","kernel","initrd"]
cat1 = ["default","menu","color","timeout","hiddenmenu","root","initrd"] cat1 = ["default","menu","color","timeout","hiddenmenu","root","initrd"]

@ -2851,7 +2851,7 @@ class MountGroupListViewItem(KListViewItem):
if standalone: if standalone:
programbase = KDialogBase programbase = KDialogBase
else: else:
programbase = KCModule programbase = TDECModule
class MountConfigApp(programbase): class MountConfigApp(programbase):
######################################################################## ########################################################################
@ -2865,13 +2865,13 @@ class MountConfigApp(programbase):
self.setButtonText(KDialogBase.User1,i18n("About")) self.setButtonText(KDialogBase.User1,i18n("About"))
topwidget = self.plainPage() topwidget = self.plainPage()
else: else:
KCModule.__init__(self,parent,name) TDECModule.__init__(self,parent,name)
self.setButtons(0) self.setButtons(0)
self.aboutdata = MakeAboutData() self.aboutdata = MakeAboutData()
topwidget = self topwidget = self
# Create a configuration object. # Create a configuration object.
self.config = KConfig("mountconfigrc") self.config = TDEConfig("mountconfigrc")
TDEGlobal.iconLoader().addAppDir("guidance") TDEGlobal.iconLoader().addAppDir("guidance")
self.updatingGUI = False self.updatingGUI = False
@ -3274,7 +3274,7 @@ class MountConfigApp(programbase):
return self.aboutdata return self.aboutdata
def buttons(self): def buttons(self):
# Only supply a Help button. Other choices are Default and Apply. # Only supply a Help button. Other choices are Default and Apply.
return KCModule.Help return TDECModule.Help
############################################################################ ############################################################################
# Factory function for KControl # Factory function for KControl

@ -91,7 +91,7 @@ class PowerManager(PowerManagerUI):
self.connect(self.systray, SIGNAL("quitSelected()"), self.quit) self.connect(self.systray, SIGNAL("quitSelected()"), self.quit)
# Configuration filename # Configuration filename
self.config = KConfig("power-managerrc") self.config = TDEConfig("power-managerrc")
self.powermanager = PowerManage() self.powermanager = PowerManage()

@ -930,7 +930,7 @@ class GentooRunLevel(SysVRunLevel):
if standalone: if standalone:
programbase = KDialogBase programbase = KDialogBase
else: else:
programbase = KCModule programbase = TDECModule
# is_shown exists to prevent loadDescriptions from running two times, which is # is_shown exists to prevent loadDescriptions from running two times, which is
# the case when we're running inside kcontrol. Yes, this is an ugly hack. :( # the case when we're running inside kcontrol. Yes, this is an ugly hack. :(
@ -950,12 +950,12 @@ class SysVInitApp(programbase):
KDialogBase.User1|KDialogBase.Close, KDialogBase.Close) KDialogBase.User1|KDialogBase.Close, KDialogBase.Close)
self.setButtonText(KDialogBase.User1,i18n("About")) self.setButtonText(KDialogBase.User1,i18n("About"))
else: else:
KCModule.__init__(self,parent,name) TDECModule.__init__(self,parent,name)
self.setButtons(1) self.setButtons(1)
self.aboutdata = MakeAboutData() self.aboutdata = MakeAboutData()
# Create a configuration object. # Create a configuration object.
self.config = KConfig("serviceconfigrc") self.config = TDEConfig("serviceconfigrc")
TDEGlobal.iconLoader().addAppDir("guidance") TDEGlobal.iconLoader().addAppDir("guidance")
self.updatingGUI = False self.updatingGUI = False
@ -1367,7 +1367,7 @@ class SysVInitApp(programbase):
def buttons(self): def buttons(self):
# Only supply a Help button. Other choices are Default and Apply. # Only supply a Help button. Other choices are Default and Apply.
return KCModule.Help return TDECModule.Help
############################################################################ ############################################################################
class CommandRunner(KDialogBase): class CommandRunner(KDialogBase):

@ -52,7 +52,7 @@ def QDateToSptime(qdate):
if standalone: if standalone:
programbase = KDialogBase programbase = KDialogBase
else: else:
programbase = KCModule programbase = TDECModule
class UserConfigApp(programbase): class UserConfigApp(programbase):
def __init__(self,parent=None,name=None): def __init__(self,parent=None,name=None):
@ -64,7 +64,7 @@ class UserConfigApp(programbase):
KDialogBase.User1|KDialogBase.Close, KDialogBase.Close) KDialogBase.User1|KDialogBase.Close, KDialogBase.Close)
self.setButtonText(KDialogBase.User1,i18n("About")) self.setButtonText(KDialogBase.User1,i18n("About"))
else: else:
KCModule.__init__(self,parent,name) TDECModule.__init__(self,parent,name)
self.setButtons(0) self.setButtons(0)
self.aboutdata = MakeAboutData() self.aboutdata = MakeAboutData()
@ -74,7 +74,7 @@ class UserConfigApp(programbase):
toplayout.setStretchFactor(tabcontrol,1) toplayout.setStretchFactor(tabcontrol,1)
# Create a configuration object. # Create a configuration object.
self.config = KConfig("userconfigrc") self.config = TDEConfig("userconfigrc")
TDEGlobal.iconLoader().addAppDir("guidance") TDEGlobal.iconLoader().addAppDir("guidance")
@ -572,7 +572,7 @@ class UserConfigApp(programbase):
return self.aboutdata return self.aboutdata
def buttons(self): def buttons(self):
# Only supply a Help button. Other choices are Default and Apply. # Only supply a Help button. Other choices are Default and Apply.
return KCModule.Help return TDECModule.Help
########################################################################### ###########################################################################

@ -28,15 +28,15 @@
#define LIB_PYTHON "libpython2.5.so" #define LIB_PYTHON "libpython2.5.so"
#define debug 1 #define debug 1
static KCModule *report_error(char *msg) { static TDECModule *report_error(char *msg) {
if (debug) printf ("error: %s\n", msg); if (debug) printf ("error: %s\n", msg);
return NULL; return NULL;
} }
static KCModule* return_instance( QWidget *parent, const char *name ) { static TDECModule* return_instance( QWidget *parent, const char *name ) {
KCModule* kcmodule; TDECModule* kcmodule;
PyObject *pyKCModuleTuple; PyObject *pyTDECModuleTuple;
PyObject *pyKCModule; PyObject *pyTDECModule;
Pythonize *pyize; // Pythonize object to manage the Python interpreter. Pythonize *pyize; // Pythonize object to manage the Python interpreter.
int isErr; int isErr;
@ -111,8 +111,8 @@ static KCModule* return_instance( QWidget *parent, const char *name ) {
PyObject *args = Py_BuildValue ("NN", pyParent, pyName); PyObject *args = Py_BuildValue ("NN", pyParent, pyName);
if(pyName && pyParent && args) { if(pyName && pyParent && args) {
// run the factory function // run the factory function
pyKCModuleTuple = pyize->runFunction(kcmFactory, args); pyTDECModuleTuple = pyize->runFunction(kcmFactory, args);
if(!pyKCModuleTuple) { if(!pyTDECModuleTuple) {
PyErr_Print(); PyErr_Print();
return report_error ("*** runFunction failure\n;"); return report_error ("*** runFunction failure\n;");
} }
@ -124,16 +124,16 @@ static KCModule* return_instance( QWidget *parent, const char *name ) {
pyize->decref(kcmFactory); pyize->decref(kcmFactory);
// Stop this from getting garbage collected. // 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; isErr = 0;
pyKCModule = PyTuple_GET_ITEM(pyKCModuleTuple,1); pyTDECModule = PyTuple_GET_ITEM(pyTDECModuleTuple,1);
kcmodule = (KCModule *)PyLong_AsVoidPtr(pyKCModule); kcmodule = (TDECModule *)PyLong_AsVoidPtr(pyTDECModule);
if(!kcmodule) { if(!kcmodule) {
return report_error ("***failed sip conversion to C++ pointer\n"); return report_error ("***failed sip conversion to C++ pointer\n");
} }
pyize->decref(pyKCModuleTuple); pyize->decref(pyTDECModuleTuple);
// PyKDE can't run the module without this - Pythonize // PyKDE can't run the module without this - Pythonize
// grabs the lock at initialization and we have to give // grabs the lock at initialization and we have to give
@ -144,13 +144,13 @@ static KCModule* return_instance( QWidget *parent, const char *name ) {
// take care of any translation info // take care of any translation info
TDEGlobal::locale()->insertCatalogue(script); TDEGlobal::locale()->insertCatalogue(script);
// Return the pointer to our new KCModule // Return the pointer to our new TDECModule
return kcmodule; return kcmodule;
} }
extern "C" { extern "C" {
// Factory function that kcontrol will call. // 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); return return_instance(parent, name);
} }
} }

@ -55,7 +55,7 @@ isroot = os.getuid()==0
if standalone: if standalone:
programbase = KDialogBase programbase = KDialogBase
else: else:
programbase = KCModule programbase = TDECModule
############################################################################ ############################################################################
class WineConfigApp(programbase): class WineConfigApp(programbase):
@ -73,12 +73,12 @@ class WineConfigApp(programbase):
if args.count() > 0: if args.count() > 0:
application = args.arg(0) application = args.arg(0)
else: else:
KCModule.__init__(self,parent,name) TDECModule.__init__(self,parent,name)
self.setButtons(KCModule.Apply|KCModule.Reset) self.setButtons(TDECModule.Apply|TDECModule.Reset)
self.aboutdata = MakeAboutData() self.aboutdata = MakeAboutData()
# Create a configuration object. # Create a configuration object.
self.config = KConfig("wineconfigrc") self.config = TDEConfig("wineconfigrc")
# Compact mode means that we have to make the GUI # Compact mode means that we have to make the GUI
# much smaller to fit on low resolution screens. # much smaller to fit on low resolution screens.
@ -356,7 +356,7 @@ class WineConfigApp(programbase):
else: else:
programbase.exec_loop(self) programbase.exec_loop(self)
def save(self): # KCModule def save(self): # TDECModule
# Find out what's changed # Find out what's changed
generalchanged = self.generalpage.isChanged() generalchanged = self.generalpage.isChanged()
driveschanged = not application and self.drivespage.isChanged() driveschanged = not application and self.drivespage.isChanged()
@ -390,7 +390,7 @@ class WineConfigApp(programbase):
def slotClose(self): # KDialogBase def slotClose(self): # KDialogBase
KDialogBase.slotClose(self) KDialogBase.slotClose(self)
def load(self): # KCModule def load(self): # TDECModule
self.__reset() self.__reset()
self._sendChangedSignal() self._sendChangedSignal()
@ -1812,7 +1812,7 @@ class AppearancePage(QWidget):
appearance_tab_layout.addItem(bottomspacer) appearance_tab_layout.addItem(bottomspacer)
self.selecteditem = None self.selecteditem = None
self.config = KConfig("wineconfigrc",False,False) self.config = TDEConfig("wineconfigrc",False,False)
self.reset() self.reset()
self.clearWState(Qt.WState_Polished) self.clearWState(Qt.WState_Polished)
@ -2111,7 +2111,7 @@ class AppearancePage(QWidget):
def GetKdeColorScheme(self): def GetKdeColorScheme(self):
""" Sets the current color scheme settings to those currently set in KDE """ """ Sets the current color scheme settings to those currently set in KDE """
# Create a configuration object. # Create a configuration object.
config = KConfig("kdesktoprc") config = TDEConfig("kdesktoprc")
config.setGroup("General") config.setGroup("General")
self.customizableitems["Application Workspace"][0]["AppWorkSpace"][1] =\ self.customizableitems["Application Workspace"][0]["AppWorkSpace"][1] =\
@ -3306,7 +3306,7 @@ class ApplicationsPage(QWidget):
def GetKdeDefaultBrowser(self): def GetKdeDefaultBrowser(self):
""" Returns the default browser set in KDE """ """ Returns the default browser set in KDE """
# Create a configuration object. # Create a configuration object.
config = KConfig("wineconfigrc") config = TDEConfig("wineconfigrc")
return str(config.lookupData(KEntryKey("General","BrowserApplication")).mValue).strip('!') return str(config.lookupData(KEntryKey("General","BrowserApplication")).mValue).strip('!')
def setMargin(self,margin): def setMargin(self,margin):

Loading…
Cancel
Save