[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: compiling trunk - KoView/QPointer, Kross/Python
From:       Sebastian Sauer <mail () dipe ! org>
Date:       2006-12-19 12:33:55
Message-ID: 200612191333.55564.mail () dipe ! org
[Download RAW message or body]

Raphael Langerhorst wrote:
> There is also another error related to python and kross in the way that at
> least Py::AttributeError() and Py::TypeError() are not understood by the
> compiler. I don't know python, but trying to fix it I came to the
> impression that the parameter should name a type as a string literal, not
> the error message text(??):
> 
> [100%] Building CXX object
> libs/kross/python/CMakeFiles/krosspython.dir/pythonextension.o
> /home/raphael/devel/KDE/trunk/koffice/libs/kross/python/pythonextension.cpp:
> In
>    member function `virtual Py::Object
>    Kross::PythonExtension::getattr(const char*)':
> /home/raphael/devel/KDE/trunk/koffice/libs/kross/python/pythonextension.cpp:203:
> error: parse
>    error before `.' token
> 
> This is with NetBSD 3 (GCC 3.3.3) and Python 2.3.5 as well as latest
> qt-copy, kdelibs, etc. - on amd64
> 
> Any ideas how this can be fixed?
> 
> 
> Attached patch is a suggestion for KoView and a question for the python
> bindings. It is not meant to be committed the way it is (python bindings
> need to be properly fixed first).

Regarding;

if(! property.isReadable()) {
-            Py::AttributeError( QString("Attribute \"%1\" is not 
readable.").arg(n).toLatin1().constData() );
+            QString tstr("Attribute \"");
+            tstr.append(n);
+            tstr.append(" is not readable.");
+            QByteArray ba = tstr.toLatin1();
+            char* string_data = ba.data();
+            Py::AttributeError( string_data /* "Attribute is not 
readable." /* QString("Attribute \"%1\" is not 
readable.").arg(QString::number(n)).toLatin1().constData() */ );
             return Py::None();
         }

That looks interessting. So, it is not possible to do something like
QString().arg(n) where n is a char* ?

-- 
Sebastian Sauer aka dipesh[sebsauer]
http://www.dipe.org/public_key.asc
Fingerprint: 8F1E 219B 16E6 4EC7 29CC F408 E193 65E2 9134 2221
Coder in http://www.koffice.org && http://www.kmldonkey.org
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic