diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kross/python/pythonsecurity.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kross/python/pythonsecurity.cpp')
-rw-r--r-- | lib/kross/python/pythonsecurity.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/kross/python/pythonsecurity.cpp b/lib/kross/python/pythonsecurity.cpp index 86be0092..941ed0c6 100644 --- a/lib/kross/python/pythonsecurity.cpp +++ b/lib/kross/python/pythonsecurity.cpp @@ -88,9 +88,9 @@ void PythonSecurity::initRestrictedPython() krossdebug("PythonSecurity::PythonSecurity SUCCESSFULLY LOADED"); } catch(Py::Exception& e) { - QString err = Py::value(e).as_string().c_str(); + TQString err = Py::value(e).as_string().c_str(); e.clear(); - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to initialize PythonSecurity module: %1").arg(err) ) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to initialize PythonSecurity module: %1").tqarg(err) ) ); } } @@ -104,7 +104,7 @@ Py::Object PythonSecurity::_getattr_(const Py::Tuple& args) return Py::None(); } -PyObject* PythonSecurity::compile_restricted(const QString& source, const QString& filename, const QString& mode) +PyObject* PythonSecurity::compile_restricted(const TQString& source, const TQString& filename, const TQString& mode) { krossdebug("PythonSecurity::compile_restricted"); if(! m_pymodule) @@ -115,12 +115,12 @@ PyObject* PythonSecurity::compile_restricted(const QString& source, const QStrin PyObject* func = PyDict_GetItemString(m_pymodule->getDict().ptr(), "compile_restricted"); if(! func) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("No such function '%1'.").arg("compile_restricted")) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such function '%1'.").tqarg("compile_restricted")) ); Py::Callable funcobject(func, true); // the funcobject takes care of freeing our func pyobject. if(! funcobject.isCallable()) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Function '%1' is not callable.").arg("compile_restricted")) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Function '%1' is not callable.").tqarg("compile_restricted")) ); Py::Tuple args(3); args[0] = Py::String(source.utf8()); @@ -140,40 +140,40 @@ PyObject* PythonSecurity::compile_restricted(const QString& source, const QStrin /* Py::List ml = mainmoduledict; for(Py::List::size_type mi = 0; mi < ml.length(); ++mi) { - krossdebug( QString("dir() = %1").arg( ml[mi].str().as_string().c_str() ) ); - //krossdebug( QString("dir().dir() = %1").arg( Py::Object(ml[mi]).dir().as_string().c_str() ) ); + krossdebug( TQString("dir() = %1").tqarg( ml[mi].str().as_string().c_str() ) ); + //krossdebug( TQString("dir().dir() = %1").tqarg( Py::Object(ml[mi]).dir().as_string().c_str() ) ); } */ Py::Object code(pycode); - krossdebug( QString("%1 callable=%2").arg(code.as_string().c_str()).arg(PyCallable_Check(code.ptr())) ); + krossdebug( TQString("%1 callable=%2").tqarg(code.as_string().c_str()).tqarg(PyCallable_Check(code.ptr())) ); Py::List l = code.dir(); for(Py::List::size_type i = 0; i < l.length(); ++i) { - krossdebug( QString("dir() = %1").arg( l[i].str().as_string().c_str() ) ); - //krossdebug( QString("dir().dir() = %1").arg( Py::Object(l[i]).dir().as_string().c_str() ) ); + krossdebug( TQString("dir() = %1").tqarg( l[i].str().as_string().c_str() ) ); + //krossdebug( TQString("dir().dir() = %1").tqarg( Py::Object(l[i]).dir().as_string().c_str() ) ); } return pycode; } catch(Py::Exception& e) { - QString err = Py::value(e).as_string().c_str(); + TQString err = Py::value(e).as_string().c_str(); e.clear(); - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Function '%1' failed with python exception: %2").arg("compile_restricted").arg(err) ) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Function '%1' failed with python exception: %2").tqarg("compile_restricted").tqarg(err) ) ); } } #if 0 -void PythonSecurity::compile_restricted_function(const Py::Tuple& /*args*/, const QString& /*body*/, const QString& /*name*/, const QString& /*filename*/, const Py::Object& /*globalize*/) +void PythonSecurity::compile_restricted_function(const Py::Tuple& /*args*/, const TQString& /*body*/, const TQString& /*name*/, const TQString& /*filename*/, const Py::Object& /*globalize*/) { //TODO } -void PythonSecurity::compile_restricted_exec(const QString& /*source*/, const QString& /*filename*/) +void PythonSecurity::compile_restricted_exec(const TQString& /*source*/, const TQString& /*filename*/) { //TODO } -void PythonSecurity::compile_restricted_eval(const QString& /*source*/, const QString& /*filename*/) +void PythonSecurity::compile_restricted_eval(const TQString& /*source*/, const TQString& /*filename*/) { //TODO } |