summaryrefslogtreecommitdiffstats
path: root/sip
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2023-01-03 15:29:41 +0900
committerMichele Calgaro <[email protected]>2023-01-07 22:14:56 +0900
commit4ce11cc30df1805459a615960fdec204a975548a (patch)
tree084f1e1fa404bdf0d082b1a58acf392b5d177326 /sip
parent065f41b4908b11278d4334e8c85150ec0fd4a9f6 (diff)
downloadpytde-4ce11cc30df1805459a615960fdec204a975548a.tar.gz
pytde-4ce11cc30df1805459a615960fdec204a975548a.zip
Drop python2 support.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'sip')
-rw-r--r--sip/dcop/dcopclient.sip8
-rw-r--r--sip/tdecore/bytearray.sip14
-rw-r--r--sip/tdecore/kcalendarsystemfactory.sip2
-rw-r--r--sip/tdecore/kcompletion.sip6
-rw-r--r--sip/tdecore/klockfile.sip2
-rw-r--r--sip/tdecore/kmacroexpander.sip4
-rw-r--r--sip/tdecore/kmountpoint.sip2
-rw-r--r--sip/tdecore/kprocess.sip2
-rw-r--r--sip/tdecore/ksavefile.sip2
-rw-r--r--sip/tdecore/ktimezones.sip2
-rw-r--r--sip/tdecore/kurl.sip58
-rw-r--r--sip/tdecore/kuser.sip2
-rw-r--r--sip/tdecore/netwm.sip12
-rw-r--r--sip/tdecore/tdeaccel.sip6
-rw-r--r--sip/tdecore/tdeapplication.sip37
-rw-r--r--sip/tdecore/tdecmdlineargs.sip46
-rw-r--r--sip/tdecore/tdeconfig.sip2
-rw-r--r--sip/tdecore/tdeconfigbase.sip8
-rw-r--r--sip/tdecore/tdeconfigskeleton.sip10
-rw-r--r--sip/tdecore/twinmodule.sip4
-rw-r--r--sip/tdeio/authinfo.sip2
-rw-r--r--sip/tdeio/kacl.sip2
-rw-r--r--sip/tdeio/kservicetype.sip6
-rw-r--r--sip/tdemdi/tdemdichildfrm.sip6
-rw-r--r--sip/tdeparts/browserextension.sip6
-rw-r--r--sip/tdeui/keditlistbox.sip9
-rw-r--r--sip/tdeui/kkeydialog.sip6
-rw-r--r--sip/tdeui/tdemainwindow.sip2
28 files changed, 148 insertions, 120 deletions
diff --git a/sip/dcop/dcopclient.sip b/sip/dcop/dcopclient.sip
index 35503d2..3edba91 100644
--- a/sip/dcop/dcopclient.sip
+++ b/sip/dcop/dcopclient.sip
@@ -88,7 +88,7 @@ public:
virtual bool process (const TQCString&, const TQByteArray&, TQCString&, TQByteArray&);
DCOPClientTransaction* beginTransaction ();
void endTransaction (DCOPClientTransaction*, TQCString&, TQByteArray&);
- TQ_INT32 transactionId ();
+ TQ_INT32 transactionId ();
bool isApplicationRegistered (const TQCString&);
QCStringList registeredApplications ();
QCStringList remoteObjects (const TQCString&, bool* = 0);
@@ -96,10 +96,10 @@ public:
QCStringList remoteFunctions (const TQCString&, const TQCString&, bool* = 0);
bool receive (const TQCString&, const TQCString&, const TQCString&, const TQByteArray&, TQCString& /Out/, TQByteArray& /Out/);
bool find (const TQCString&, const TQCString&, const TQCString&, const TQByteArray&, TQCString& /Out/, TQByteArray& /Out/);
- static TQCString normalizeFunctionSignature (const TQCString&);
- TQCString senderId () const;
+ static TQCString normalizeFunctionSignature (const TQCString&);
+ TQCString senderId () const;
void setDefaultObject (const TQCString&);
- TQCString defaultObject () const;
+ TQCString defaultObject () const;
void setNotifications (bool);
void setDaemonMode (bool);
diff --git a/sip/tdecore/bytearray.sip b/sip/tdecore/bytearray.sip
index 743aff6..046939b 100644
--- a/sip/tdecore/bytearray.sip
+++ b/sip/tdecore/bytearray.sip
@@ -141,7 +141,7 @@ void dcop_next (TQDataStream&, TQCString&);
{
TQ_INT8 res;
*a0 >> res;
- return PyInt_FromLong ((long)res);
+ return PyLong_FromLong ((long)res);
}
else if (*a1 == "bool")
{
@@ -153,7 +153,7 @@ void dcop_next (TQDataStream&, TQCString&);
{
int res;
*a0 >> res;
- return PyInt_FromLong ((long)res);
+ return PyLong_FromLong ((long)res);
}
else if (*a1 == "long")
{
@@ -165,19 +165,19 @@ void dcop_next (TQDataStream&, TQCString&);
{
short res;
*a0 >> res;
- return PyInt_FromLong ((long)res);
+ return PyLong_FromLong ((long)res);
}
if (*a1 == "uchar" || *a1 == "unsigned char")
{
TQ_UINT8 res;
*a0 >> res;
- return PyInt_FromLong ((long)res);
+ return PyLong_FromLong ((long)res);
}
else if (*a1 == "uint" || *a1 == "unsigned int")
{
unsigned int res;
*a0 >> res;
- return PyInt_FromLong ((long)res);
+ return PyLong_FromLong ((long)res);
}
else if (*a1 == "ulong" || *a1 == "unsigned long")
{
@@ -201,7 +201,7 @@ void dcop_next (TQDataStream&, TQCString&);
{
unsigned short res;
*a0 >> res;
- return PyInt_FromLong ((long)res);
+ return PyLong_FromLong ((long)res);
}
else if (*a1 == "float")
{
@@ -315,7 +315,7 @@ void dcop_next (TQDataStream&, TQCString&);
{
unsigned int res;
*a0 >> res;
- return PyInt_FromLong ((long)res);
+ return PyLong_FromLong ((long)res);
}
else if (*a1 == "DCOPRef")
{
diff --git a/sip/tdecore/kcalendarsystemfactory.sip b/sip/tdecore/kcalendarsystemfactory.sip
index 1146e5f..665b6b1 100644
--- a/sip/tdecore/kcalendarsystemfactory.sip
+++ b/sip/tdecore/kcalendarsystemfactory.sip
@@ -35,7 +35,7 @@ class KCalendarSystemFactory
public:
KCalendarSystemFactory ();
- static KCalendarSystem* create (const TQString& = TQString ::fromLatin1 ("gregorian" ), const TDELocale* = 0);
+ static KCalendarSystem* create (const TQString& = TQString ::fromUtf8 ("gregorian" ), const TDELocale* = 0);
static TQStringList calendarSystems ();
}; // class KCalendarSystemFactory
diff --git a/sip/tdecore/kcompletion.sip b/sip/tdecore/kcompletion.sip
index 223e230..a19fc24 100644
--- a/sip/tdecore/kcompletion.sip
+++ b/sip/tdecore/kcompletion.sip
@@ -175,7 +175,7 @@ protected:
for (it = map.begin (); it != map.end (); ++it)
{
- key = PyInt_FromLong ((int) it.key ());
+ key = PyLong_FromLong ((int) it.key ());
value = sipConvertFromInstance ((void *)&(it.data ()), sipClass_TDEShortcut, sipTransferObj);
if ((value == NULL) || (PyDict_SetItem (dict, key, value) < 0))
{
@@ -208,14 +208,14 @@ protected:
{
cValue = (TDEShortcut *)sipForceConvertToType(value, sipType_TDEShortcut, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr);
- if (iserr || !PyInt_Check (key))
+ if (iserr || !PyLong_Check (key))
{
*sipIsErr = 1;
delete kbmap;
return 0;
}
- kbmap->insert ((TDECompletionBase::KeyBindingType)PyInt_AS_LONG (key), *cValue);
+ kbmap->insert ((TDECompletionBase::KeyBindingType)PyLong_AS_LONG (key), *cValue);
}
*sipCppPtr = kbmap;
diff --git a/sip/tdecore/klockfile.sip b/sip/tdecore/klockfile.sip
index fe3bc95..2e067ee 100644
--- a/sip/tdecore/klockfile.sip
+++ b/sip/tdecore/klockfile.sip
@@ -91,7 +91,7 @@ public:
// Convert a Python instance to a Ptr on the heap.
if (sipIsErr == NULL)
- return PyInstance_Check(sipPy);
+ return PyType_Check(sipPy);
int iserr = 0;
TDELockFile *cpp = (TDELockFile *)sipForceConvertToType(sipPy, sipType_TDELockFile, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
diff --git a/sip/tdecore/kmacroexpander.sip b/sip/tdecore/kmacroexpander.sip
index 7f2b3d2..bb3a39d 100644
--- a/sip/tdecore/kmacroexpander.sip
+++ b/sip/tdecore/kmacroexpander.sip
@@ -143,7 +143,7 @@ TQString expandMacrosShellQuote (const TQString&, const TQMap<TQStr
for (it = map.begin (); it != map.end (); ++it)
{
TQChar acpp = it.key ();
- PyObject *binst = PyString_FromString ((char *)((TQString *)&it.data ()));
+ PyObject *binst = SIPBytes_FromString ((char *)((TQString *)&it.data ()));
PyObject *ainst;
if (((ainst = sipConvertFromNewType(new TQChar(acpp), sipType_TQChar, sipTransferObj)) == NULL)
|| (binst == NULL)
@@ -232,7 +232,7 @@ TQString expandMacrosShellQuote (const TQString&, const TQMap<TQStr
for (it = map.begin (); it != map.end (); ++it)
{
TQStringList bcpp = it.data ();
- PyObject *ainst = PyString_FromString ((char *)((TQString *)&it.key ()));
+ PyObject *ainst = SIPBytes_FromString ((char *)((TQString *)&it.key ()));
PyObject *binst;
if (((binst = sipConvertFromNewType(new TQStringList(bcpp), sipType_TQStringList, sipTransferObj)) == NULL)
|| (ainst == NULL)
diff --git a/sip/tdecore/kmountpoint.sip b/sip/tdecore/kmountpoint.sip
index 76a6c85..066b1e6 100644
--- a/sip/tdecore/kmountpoint.sip
+++ b/sip/tdecore/kmountpoint.sip
@@ -92,7 +92,7 @@ private:
// Convert a Python instance to a Ptr on the heap.
if (sipIsErr == NULL)
- return PyInstance_Check(sipPy);
+ return PyType_Check(sipPy);
int iserr = 0;
KMountPoint *cpp = (KMountPoint *)sipForceConvertToType(sipPy, sipType_KMountPoint, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
diff --git a/sip/tdecore/kprocess.sip b/sip/tdecore/kprocess.sip
index e60abd4..a728539 100644
--- a/sip/tdecore/kprocess.sip
+++ b/sip/tdecore/kprocess.sip
@@ -235,7 +235,7 @@ public:
for (int i = 0; i < PyList_Size (a0); i++)
{
elem = PyList_GET_ITEM (a0, i);
- *sipCpp << PyString_AsString (elem);
+ *sipCpp << sipBytes_AsString (elem);
}
diff --git a/sip/tdecore/ksavefile.sip b/sip/tdecore/ksavefile.sip
index f9e917b..e5e2dc1 100644
--- a/sip/tdecore/ksavefile.sip
+++ b/sip/tdecore/ksavefile.sip
@@ -44,7 +44,7 @@ public:
bool close ();
%If ( KDE_3_2_0 - )
- static bool backupFile (const TQString&, const TQString& = TQString ::null , const TQString& = TQString ::fromLatin1 ("~" ));
+ static bool backupFile (const TQString&, const TQString& = TQString ::null , const TQString& = TQString ::fromUtf8 ("~" ));
%End
diff --git a/sip/tdecore/ktimezones.sip b/sip/tdecore/ktimezones.sip
index 1f9e612..7876587 100644
--- a/sip/tdecore/ktimezones.sip
+++ b/sip/tdecore/ktimezones.sip
@@ -159,7 +159,7 @@ private:
// Convert a Python instance to a Ptr on the heap.
if (sipIsErr == NULL)
- return PyInstance_Check(sipPy);
+ return PyType_Check(sipPy);
int iserr = 0;
KTimezoneSource *cpp = (KTimezoneSource *)sipForceConvertToType(sipPy, sipType_KTimezoneSource, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
diff --git a/sip/tdecore/kurl.sip b/sip/tdecore/kurl.sip
index 495f3f4..652cee1 100644
--- a/sip/tdecore/kurl.sip
+++ b/sip/tdecore/kurl.sip
@@ -60,53 +60,53 @@ public:
KURL (const KURL&);
KURL (const TQUrl&);
KURL (const KURL&, const TQString&, int = 0);
- TQString protocol () const;
+ TQString protocol () const;
void setProtocol (const TQString&);
%If ( KDE_3_2_0 - )
int uriMode () const;
%End
- TQString user () const;
+ TQString user () const;
void setUser (const TQString&);
bool hasUser () const;
- TQString pass () /PyName=pass_/;
+ TQString pass () /PyName=pass_/;
void setPass (const TQString&);
bool hasPass () const;
- TQString host () const;
+ TQString host () const;
void setHost (const TQString&);
bool hasHost () const;
ushort port () const;
void setPort (ushort);
- TQString path () const;
- TQString path (int) const;
+ TQString path () const;
+ TQString path (int) const;
void setPath (const TQString&);
bool hasPath () const;
void cleanPath (bool = 0);
void adjustPath (int);
void setEncodedPathAndQuery (const TQString&, int = 0);
void setEncodedPath (const TQString&, int = 0);
- TQString encodedPathAndQuery (int = 0, bool = 0, int = 0) const;
+ TQString encodedPathAndQuery (int = 0, bool = 0, int = 0) const;
void setQuery (const TQString&, int = 0);
- TQString query () const;
- TQString ref () const;
+ TQString query () const;
+ TQString ref () const;
void setRef (const TQString&);
bool hasRef () const;
- TQString htmlRef () const;
- TQString encodedHtmlRef () const;
+ TQString htmlRef () const;
+ TQString encodedHtmlRef () const;
void setHTMLRef (const TQString&);
bool hasHTMLRef () const;
bool isValid () const;
bool isMalformed () const;
bool isLocalFile () const;
void setFileEncoding (const TQString&);
- TQString fileEncoding () const;
+ TQString fileEncoding () const;
bool hasSubURL () const;
void addPath (const TQString&);
- TQString queryItem (const TQString&) const;
+ TQString queryItem (const TQString&) const;
%If ( KDE_3_2_0 - )
- TQString queryItem (const TQString&, int) const;
+ TQString queryItem (const TQString&, int) const;
%End
@@ -117,10 +117,10 @@ public:
CaseInsensitiveKeys
};
- TQMap<TQString,TQString> queryItems (int = 0) const;
+ TQMap<TQString, TQString> queryItems (int = 0) const;
%If ( KDE_3_2_0 - )
- TQMap<TQString,TQString> queryItems (int, int) const;
+ TQMap<TQString, TQString> queryItems (int, int) const;
%End
void addQueryItem (const TQString&, const TQString&, int = 0);
@@ -128,25 +128,25 @@ public:
%End
void setFileName (const TQString&);
- TQString fileName (bool = 1) const;
- TQString directory (bool = 1, bool = 1) const;
+ TQString fileName (bool = 1) const;
+ TQString directory (bool = 1, bool = 1) const;
%If ( KDE_3_2_0 - )
void setDirectory (const TQString&);
%End
bool cd (const TQString&);
- TQString url (int = 0, int = 0) const;
- TQString prettyURL (int = 0) const;
- TQString prettyURL (int, KURL::AdjustementFlags) const;
+ TQString url (int = 0, int = 0) const;
+ TQString prettyURL (int = 0) const;
+ TQString prettyURL (int, KURL::AdjustementFlags) const;
%If ( KDE_3_4_0 - )
- TQString pathOrURL () const;
+ TQString pathOrURL () const;
%End
%If ( KDE_3_0_1 - )
- TQString htmlURL () const;
+ TQString htmlURL () const;
%End
bool isEmpty () const;
@@ -179,18 +179,18 @@ public:
static KURL fromPathOrURL (const TQString&);
%End
- static TQString encode_string (const TQString&, int = 0);
- static TQString encode_string_no_slash (const TQString&, int = 0);
- static TQString decode_string (const TQString&, int = 0);
+ static TQString encode_string (const TQString&, int = 0);
+ static TQString encode_string_no_slash (const TQString&, int = 0);
+ static TQString decode_string (const TQString&, int = 0);
static bool isRelativeURL (const TQString&);
%If ( KDE_3_2_0 - )
- static TQString relativeURL (const KURL&, const KURL&, int = 0);
- static TQString relativePath (const TQString&, const TQString&, bool* = 0);
+ static TQString relativeURL (const KURL&, const KURL&, int = 0);
+ static TQString relativePath (const TQString&, const TQString&, bool* = 0);
static KURL::URIMode uriModeForProtocol (const TQString&);
%End
- TQString filename (bool = 1) const;
+ TQString filename (bool = 1) const;
protected:
void reset ();
diff --git a/sip/tdecore/kuser.sip b/sip/tdecore/kuser.sip
index e16a93e..4ad5504 100644
--- a/sip/tdecore/kuser.sip
+++ b/sip/tdecore/kuser.sip
@@ -29,7 +29,7 @@
class KUser
{
%TypeHeaderCode
-#include <../extra/kde320/ksharedptr.h>
+#include <../../extra/kde320/ksharedptr.h>
#include <kuser.h>
%End
diff --git a/sip/tdecore/netwm.sip b/sip/tdecore/netwm.sip
index 48dcbbf..ac27f60 100644
--- a/sip/tdecore/netwm.sip
+++ b/sip/tdecore/netwm.sip
@@ -52,7 +52,7 @@ public:
unsigned long *list = new unsigned long [count];
for (int i = 0; i < count; i++)
- list [i] = (unsigned long)PyInt_AS_LONG (PyList_GET_ITEM (a2, i));
+ list [i] = (unsigned long)PyLong_AS_LONG (PyList_GET_ITEM (a2, i));
Py_BEGIN_ALLOW_THREADS
Display *d = tqt_xdisplay ();
@@ -83,7 +83,7 @@ public:
unsigned long *list = new unsigned long [count];
for (int i = 0; i < count; i++)
- list [i] = (unsigned long)PyInt_AS_LONG (PyList_GET_ITEM (a2, i));
+ list [i] = (unsigned long)PyLong_AS_LONG (PyList_GET_ITEM (a2, i));
Py_BEGIN_ALLOW_THREADS
Display *d = tqt_xdisplay ();
@@ -369,7 +369,7 @@ public:
unsigned long *list = new unsigned long [count];
for (int i = 0; i < count; i++)
- list [i] = (unsigned long)PyInt_AS_LONG (PyList_GET_ITEM (a2, i));
+ list [i] = (unsigned long)PyLong_AS_LONG (PyList_GET_ITEM (a2, i));
Py_BEGIN_ALLOW_THREADS
Display *d = tqt_xdisplay ();
@@ -410,7 +410,7 @@ public:
unsigned long *list = new unsigned long [count];
for (int i = 0; i < count; i++)
- list [i] = (unsigned long)PyInt_AS_LONG (PyList_GET_ITEM (a2, i));
+ list [i] = (unsigned long)PyLong_AS_LONG (PyList_GET_ITEM (a2, i));
Py_BEGIN_ALLOW_THREADS
Display *d = tqt_xdisplay ();
@@ -449,7 +449,7 @@ public:
unsigned long *list = new unsigned long [count];
for (int i = 0; i < count; i++)
- list [i] = (unsigned long)PyInt_AS_LONG (PyList_GET_ITEM (a2, i));
+ list [i] = (unsigned long)PyLong_AS_LONG (PyList_GET_ITEM (a2, i));
Py_BEGIN_ALLOW_THREADS
Display *d = tqt_xdisplay ();
@@ -494,7 +494,7 @@ public:
unsigned long *list = new unsigned long [count];
for (int i = 0; i < count; i++)
- list [i] = (unsigned long)PyInt_AS_LONG (PyList_GET_ITEM (a2, i));
+ list [i] = (unsigned long)PyLong_AS_LONG (PyList_GET_ITEM (a2, i));
Py_BEGIN_ALLOW_THREADS
Display *d = tqt_xdisplay ();
diff --git a/sip/tdecore/tdeaccel.sip b/sip/tdecore/tdeaccel.sip
index 4ad90cf..15875a1 100644
--- a/sip/tdecore/tdeaccel.sip
+++ b/sip/tdecore/tdeaccel.sip
@@ -183,8 +183,8 @@ public:
for (it = map.begin (); it != map.end (); ++it)
{
- PyObject *iKey = PyInt_FromLong (((long) it.key ()));
- PyObject *sData = PyString_FromString ((char *)((TQString *)&it.data ()));
+ PyObject *iKey = PyLong_FromLong (((long) it.key ()));
+ PyObject *sData = SIPBytes_FromString ((char *)((TQString *)&it.data ()));
if ((iKey == NULL) || (sData == NULL) || (PyDict_SetItem (dict, iKey, sData) < 0))
{
@@ -216,7 +216,7 @@ public:
{
int iserr = 0, sData_state;
- iKey = PyInt_AS_LONG (key);
+ iKey = PyLong_AS_LONG (key);
sData = (TQString *)sipForceConvertToType(value, sipType_TQString, sipTransferObj, SIP_NOT_NONE, &sData_state, &iserr);
if (iserr)
diff --git a/sip/tdecore/tdeapplication.sip b/sip/tdecore/tdeapplication.sip
index 1f568a8..4f167b4 100644
--- a/sip/tdecore/tdeapplication.sip
+++ b/sip/tdecore/tdeapplication.sip
@@ -400,10 +400,9 @@ typedef ulong Atom;
// Convert a Python argv list to a conventional C argc count and argv array.
char **pyArgvToC(PyObject *argvlist,int *argcp)
{
- int argc;
char **argv;
- argc = PyList_Size(argvlist);
+ int argc = PyList_Size(argvlist);
// Allocate space for two copies of the argument pointers, plus the
// terminating NULL.
@@ -413,22 +412,30 @@ char **pyArgvToC(PyObject *argvlist,int *argcp)
// Convert the list.
for (int a = 0; a < argc; ++a)
{
- char *arg;
-
- // Get the argument and allocate memory for it.
- if ((arg = PyString_AsString(PyList_GetItem(argvlist,a))) == NULL ||
- (argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL)
- return NULL;
+ PyObject *argObject = PyList_GET_ITEM(argvlist, a);
+ char *arg;
+
+ if (PyUnicode_Check(argObject))
+ {
+ arg = tqstrdup(sipString_AsUTF8String(&argObject));
+ }
+ else if (SIPBytes_Check(argObject))
+ {
+ arg = tqstrdup(SIPBytes_AS_STRING(argObject));
+ }
+ else
+ {
+ return NULL;
+ }
- // Copy the argument and save a pointer to it.
- strcpy(argv[a],arg);
- argv[a + argc + 1] = argv[a];
+ argv[a] = argv[a + argc + 1] = arg;
}
- argv[argc + argc + 1] = argv[argc] = NULL;
-
- *argcp = argc;
-
+ argv[argc] = argv[argc + argc + 1] = NULL;
+ if (argcp)
+ {
+ *argcp = argc;
+ }
return argv;
}
diff --git a/sip/tdecore/tdecmdlineargs.sip b/sip/tdecore/tdecmdlineargs.sip
index 6b50c7e..954d2d1 100644
--- a/sip/tdecore/tdecmdlineargs.sip
+++ b/sip/tdecore/tdecmdlineargs.sip
@@ -168,18 +168,34 @@ public:
goto errorExit;
member = PyTuple_GET_ITEM (tuple, 0);
- if (PyString_Check (member))
- opts [i].name = PyString_AS_STRING (member);
+ if (PyUnicode_Check(member))
+ {
+ opts[i].name= tqstrdup(sipString_AsUTF8String(&member));
+ }
+ else if (SIPBytes_Check(member))
+ {
+ opts[i].name= tqstrdup(SIPBytes_AS_STRING(member));
+ }
else
+ {
goto errorExit;
+ }
if (tsz > 1)
{
member = PyTuple_GET_ITEM (tuple, 1);
- if PyString_Check (member)
- opts [i].description = PyString_AS_STRING (member);
+ if (PyUnicode_Check(member))
+ {
+ opts[i].description= tqstrdup(sipString_AsUTF8String(&member));
+ }
+ else if (SIPBytes_Check(member))
+ {
+ opts[i].description= tqstrdup(SIPBytes_AS_STRING(member));
+ }
else
- goto errorExit;
+ {
+ goto errorExit;
+ }
}
else
opts [i].description = NULL;
@@ -188,10 +204,18 @@ public:
if (tsz > 2)
{
member = PyTuple_GET_ITEM (tuple, 2);
- if PyString_Check (member)
- opts [i].def = PyString_AS_STRING (member);
+ if (PyUnicode_Check(member))
+ {
+ opts[i].def= tqstrdup(sipString_AsUTF8String(&member));
+ }
+ else if (SIPBytes_Check(member))
+ {
+ opts[i].def= tqstrdup(SIPBytes_AS_STRING(member));
+ }
else
- goto errorExit;
+ {
+ goto errorExit;
+ }
}
else
opts [i].def = NULL;
@@ -201,9 +225,9 @@ public:
}
// mark the end of the list
- opts [n].name = NULL;
- opts [n].description = NULL;
- opts [n].def = NULL;
+ opts[n].name = NULL;
+ opts[n].description = NULL;
+ opts[n].def = NULL;
Py_BEGIN_ALLOW_THREADS
TDECmdLineArgs::addCmdLineOptions (opts, a1, a2, a3);
diff --git a/sip/tdecore/tdeconfig.sip b/sip/tdecore/tdeconfig.sip
index f93133f..c955aaa 100644
--- a/sip/tdecore/tdeconfig.sip
+++ b/sip/tdecore/tdeconfig.sip
@@ -217,7 +217,7 @@ private:
// Convert a Python instance to a Ptr on the heap.
if (sipIsErr == NULL)
- return PyInstance_Check(sipPy);
+ return PyType_Check(sipPy);
int iserr = 0;
TDESharedConfig *cpp = (TDESharedConfig *)sipForceConvertToType(sipPy, sipType_TDESharedConfig, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
diff --git a/sip/tdecore/tdeconfigbase.sip b/sip/tdecore/tdeconfigbase.sip
index 53b36a2..8b0d147 100644
--- a/sip/tdecore/tdeconfigbase.sip
+++ b/sip/tdecore/tdeconfigbase.sip
@@ -277,15 +277,13 @@ protected:
%ConvertToTypeCode
if (sipIsErr == NULL)
- return PyLong_Check (sipPy) || PyInt_Check (sipPy);
+ return PyLong_Check (sipPy);
long long *ll = new long long;
*ll = 0;
if (PyLong_Check (sipPy))
*ll = PyLong_AsLongLong (sipPy);
- else if (PyInt_Check (sipPy))
- *ll = (long long)PyInt_AS_LONG (sipPy);
*sipCppPtr = ll;
@@ -313,15 +311,13 @@ protected:
%ConvertToTypeCode
if (sipIsErr == NULL)
- return PyLong_Check (sipPy) || PyInt_Check (sipPy);
+ return PyLong_Check (sipPy);
unsigned long long *ul = new unsigned long long;
*ul = 0;
if (PyLong_Check (sipPy))
*ul = PyLong_AsUnsignedLongLong (sipPy);
- else if (PyInt_Check (sipPy))
- *ul = (unsigned long long)PyInt_AS_LONG (sipPy);
*sipCppPtr = ul;
diff --git a/sip/tdecore/tdeconfigskeleton.sip b/sip/tdecore/tdeconfigskeleton.sip
index c36e13c..4ebd337 100644
--- a/sip/tdecore/tdeconfigskeleton.sip
+++ b/sip/tdecore/tdeconfigskeleton.sip
@@ -133,7 +133,7 @@ public:
{
public:
- ItemPassword (const TQString&, const TQString&, TQString&, const TQString& = TQString ::fromLatin1 ("" ));
+ ItemPassword (const TQString&, const TQString&, TQString&, const TQString& = TQString ::fromUtf8 ("" ));
}; // class ItemPassword
@@ -234,9 +234,9 @@ public:
void setCurrentGroup (const TQString&);
TQString currentGroup ();
void addItem (TDEConfigSkeletonItem*, const TQString& = TQString ::null );
- ItemString* addItemString (const TQString&, TQString&, const TQString& = TQString ::fromLatin1 ("" ), const TQString& = TQString ::null );
- TDEConfigSkeleton::ItemPassword* addItemPassword (const TQString&, TQString&, const TQString& = TQString ::fromLatin1 ("" ), const TQString& = TQString ::null );
- TDEConfigSkeleton::ItemPath* addItemPath (const TQString&, TQString&, const TQString& = TQString ::fromLatin1 ("" ), const TQString& = TQString ::null );
+ ItemString* addItemString (const TQString&, TQString&, const TQString& = TQString ::fromUtf8 ("" ), const TQString& = TQString ::null );
+ TDEConfigSkeleton::ItemPassword* addItemPassword (const TQString&, TQString&, const TQString& = TQString ::fromUtf8 ("" ), const TQString& = TQString ::null );
+ TDEConfigSkeleton::ItemPath* addItemPath (const TQString&, TQString&, const TQString& = TQString ::fromUtf8 ("" ), const TQString& = TQString ::null );
ItemProperty* addItemProperty (const TQString&, TQVariant&, const TQVariant& = TQVariant (), const TQString& = TQString ::null );
ItemBool* addItemBool (const TQString&, bool&, bool = 0, const TQString& = TQString ::null );
%MethodCode
@@ -437,7 +437,7 @@ public:
Path
};
- ItemString (const TQString&, const TQString&, TQString&, const TQString& = TQString ::fromLatin1 ("" ), TDEConfigSkeleton::ItemString::Type = TDEConfigSkeleton ::ItemString ::Normal );
+ ItemString (const TQString&, const TQString&, TQString&, const TQString& = TQString ::fromUtf8 ("" ), TDEConfigSkeleton::ItemString::Type = TDEConfigSkeleton ::ItemString ::Normal );
void setValue (const TQString&);
TQString& value ();
virtual void setDefaultValue (const TQString&);
diff --git a/sip/tdecore/twinmodule.sip b/sip/tdecore/twinmodule.sip
index 43bf79f..46de544 100644
--- a/sip/tdecore/twinmodule.sip
+++ b/sip/tdecore/twinmodule.sip
@@ -114,7 +114,7 @@ protected:
for( it = cpplist->begin(); it != cpplist->end(); ++it )
{
WId cpp = *it;
- if (PyList_Append (pylist, PyInt_FromLong ((int) cpp)) < 0)
+ if (PyList_Append (pylist, PyLong_FromLong ((int) cpp)) < 0)
{
Py_DECREF (pylist);
return NULL;
@@ -138,7 +138,7 @@ protected:
for (int i = 0; i < PyList_Size (sipPy); i++)
{
elem = PyList_GET_ITEM (sipPy, i);
- cpp = (WId) PyInt_AS_LONG (elem);
+ cpp = (WId) PyLong_AS_LONG (elem);
if (iserr)
{
*sipIsErr = 1;
diff --git a/sip/tdeio/authinfo.sip b/sip/tdeio/authinfo.sip
index e4f3a97..95ff7da 100644
--- a/sip/tdeio/authinfo.sip
+++ b/sip/tdeio/authinfo.sip
@@ -151,7 +151,7 @@ typedef TQMap<TQString, TQStringList> KStringListMap;
for (it = map.begin (); it != map.end (); ++it)
{
- PyObject *sKey = PyString_FromString ((const char *)((TQString)it.key ()));
+ PyObject *sKey = SIPBytes_FromString ((const char *)((TQString)it.key ()));
PyObject *sData = sipConvertFromInstance ((void *)&it.data (), sipClass_TQStringList, sipTransferObj);
if ((sKey == NULL) || (sData == NULL) || (PyDict_SetItem (dict, sKey, sData) < 0))
diff --git a/sip/tdeio/kacl.sip b/sip/tdeio/kacl.sip
index 2156e3b..31059f0 100644
--- a/sip/tdeio/kacl.sip
+++ b/sip/tdeio/kacl.sip
@@ -152,7 +152,7 @@ typedef ACLUserPermissionsList ACLGroupPermissionsList;
delete cpplist;
return 0;
}
- ushort p2 = (ushort)(PyInt_AS_LONG (PyTuple_GET_ITEM (elem, 1)));
+ ushort p2 = (ushort)(PyLong_AS_LONG (PyTuple_GET_ITEM (elem, 1)));
cpplist->append (ACLUserPermissions (*p1, p2));
diff --git a/sip/tdeio/kservicetype.sip b/sip/tdeio/kservicetype.sip
index 7d261b8..5d093e7 100644
--- a/sip/tdeio/kservicetype.sip
+++ b/sip/tdeio/kservicetype.sip
@@ -155,7 +155,7 @@ protected:
TQString acpp = it.key ();
int bcpp = (int) it.data ();
PyObject *ainst;
- PyObject *binst = PyInt_FromLong (bcpp);
+ PyObject *binst = PyLong_FromLong (bcpp);
if (((ainst = sipConvertFromNewType(new TQString (acpp), sipType_TQString, sipTransferObj)) == NULL)
|| (PyDict_SetItem (dict, ainst, binst) < 0))
{
@@ -189,7 +189,7 @@ protected:
acpp = (TQString *)sipForceConvertToType(aelem, sipType_TQString, sipTransferObj, SIP_NOT_NONE, &acpp_state, &iserr);
- if (iserr || !PyInt_Check(belem))
+ if (iserr || !PyLong_Check(belem))
{
if (acpp_state)
sipReleaseType(acpp, sipType_TQString, acpp_state);
@@ -199,7 +199,7 @@ protected:
return 0;
}
- bcpp = (TQVariant::Type) PyInt_AS_LONG(belem);
+ bcpp = (TQVariant::Type) PyLong_AS_LONG(belem);
cppmap->insert (*acpp, bcpp);
diff --git a/sip/tdemdi/tdemdichildfrm.sip b/sip/tdemdi/tdemdichildfrm.sip
index bd3c674..e55ac41 100644
--- a/sip/tdemdi/tdemdichildfrm.sip
+++ b/sip/tdemdi/tdemdichildfrm.sip
@@ -220,7 +220,7 @@ protected:
{
TQString current_key = it.currentKey ();
PyObject *a0 = sipConvertFromInstance (&current_key, sipClass_TQString, sipTransferObj);
- PyObject *a1 = PyInt_FromLong ((long) it.current ());
+ PyObject *a1 = PyLong_FromLong ((long) it.current ());
if ((a0 == NULL) || (a1 == NULL) || (PyDict_SetItem (dict, a0, a1) < 0))
{
@@ -254,7 +254,7 @@ protected:
a0 = (TQString *)sipForceConvertToType(key, sipType_TQString, sipTransferObj, SIP_NOT_NONE, &a0_state, &iserr);
- if (iserr || !PyInt_Check(value))
+ if (iserr || !PyLong_Check(value))
{
if (a0)
sipReleaseType(a0, sipType_TQString, a0_state);
@@ -264,7 +264,7 @@ protected:
return 0;
}
- a1 = (TQWidget::FocusPolicy) PyInt_AS_LONG (value);
+ a1 = (TQWidget::FocusPolicy) PyLong_AS_LONG (value);
qdict->insert (*a0, &a1);
diff --git a/sip/tdeparts/browserextension.sip b/sip/tdeparts/browserextension.sip
index a9d47a3..88e3f4c 100644
--- a/sip/tdeparts/browserextension.sip
+++ b/sip/tdeparts/browserextension.sip
@@ -477,7 +477,7 @@ TQMap<TQCString,int> testTQMapTQCStringInt (TQMap<TQCString,int>);
PyObject *ainst;
PyObject *binst = NULL;
if (((ainst = sipConvertFromNewType(new TQCString (acpp), sipType_TQCString, NULL)) == NULL)
- || ((binst = PyInt_FromLong (bcpp)) == NULL)
+ || ((binst = PyLong_FromLong (bcpp)) == NULL)
|| (PyDict_SetItem (dict, ainst, binst) < 0))
{
Py_XDECREF (ainst);
@@ -510,14 +510,14 @@ TQMap<TQCString,int> testTQMapTQCStringInt (TQMap<TQCString,int>);
acpp = (TQCString *)sipForceConvertToType(aelem, sipType_TQCString, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr);
- if (iserr || !PyInt_Check (belem))
+ if (iserr || !PyLong_Check (belem))
{
*sipIsErr = 1;
delete cppmap;
return 0;
}
- bcpp = PyInt_AS_LONG (belem);
+ bcpp = PyLong_AS_LONG (belem);
cppmap->insert (*acpp, bcpp);
}
diff --git a/sip/tdeui/keditlistbox.sip b/sip/tdeui/keditlistbox.sip
index 6fd3391..526db68 100644
--- a/sip/tdeui/keditlistbox.sip
+++ b/sip/tdeui/keditlistbox.sip
@@ -176,7 +176,7 @@ public:
const char **PyTQtListToArray(PyObject *lst)
{
- int nstr;
+ SIP_SSIZE_T nstr;
const char **str, **sp;
nstr = PyList_Size(lst);
@@ -190,15 +190,16 @@ const char **PyTQtListToArray(PyObject *lst)
for (int i = 0; i < nstr; ++i)
{
- char *s;
+ PyObject *item = PyList_GetItem(lst, i);
+ const char *item_ascii = sipString_AsASCIIString(&item);
- if ((s = PyString_AsString(PyList_GetItem(lst,i))) == NULL)
+ if (item_ascii == NULL)
{
sipFree((void *)str);
return NULL;
}
- *sp++ = s;
+ *sp++ = item_ascii;
}
return str;
diff --git a/sip/tdeui/kkeydialog.sip b/sip/tdeui/kkeydialog.sip
index 41d8b3a..60e9c28 100644
--- a/sip/tdeui/kkeydialog.sip
+++ b/sip/tdeui/kkeydialog.sip
@@ -206,7 +206,7 @@ typedef TQDict<int> IntDict;
{
TQString current_key = it.currentKey ();
PyObject *a0 = sipConvertFromInstance (&current_key, sipClass_TQCString, sipTransferObj);
- PyObject *a1 = PyInt_FromLong ((long) it.current ());
+ PyObject *a1 = PyLong_FromLong ((long) it.current ());
if ((a0 == NULL) || (a1 == NULL) || (PyDict_SetItem (dict, a0, a1) < 0))
{
@@ -240,7 +240,7 @@ typedef TQDict<int> IntDict;
a0 = (TQString *)sipForceConvertToType(key, sipType_TQString, sipTransferObj, SIP_NOT_NONE, &a0_state, &iserr);
- if ((iserr) || (!PyInt_Check (value)))
+ if ((iserr) || (!PyLong_Check (value)))
{
if (a0)
sipReleaseType(a0, sipType_TQString, a0_state);
@@ -250,7 +250,7 @@ typedef TQDict<int> IntDict;
return 0;
}
- a1 = (int) PyInt_AS_LONG (value);
+ a1 = (int) PyLong_AS_LONG (value);
qdict->insert (*a0, &a1);
diff --git a/sip/tdeui/tdemainwindow.sip b/sip/tdeui/tdemainwindow.sip
index ea9635a..02e19ed 100644
--- a/sip/tdeui/tdemainwindow.sip
+++ b/sip/tdeui/tdemainwindow.sip
@@ -76,7 +76,7 @@ public:
//ig TQPtrListIterator<TDEToolBar> toolBarIterator ();
TDEAccel* accel ();
void setFrameBorderWidth (int);
- void setAutoSaveSettings (const TQString& = TQString ::fromLatin1 ("MainWindow" ), bool = 1);
+ void setAutoSaveSettings (const TQString& = TQString ::fromUtf8 ("MainWindow" ), bool = 1);
void resetAutoSaveSettings ();
%If ( KDE_3_1_0 - )