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

List:       kde-bindings
Subject:    Re: [Kde-bindings] twine2 (PyKDE5 code generator) parsing issues
From:       Luca <gluca86 () gmail ! com>
Date:       2015-04-17 19:24:13
Message-ID: 2900016.nkZ6gh7r0X () chakra-pc
[Download RAW message or body]

Hello Scott,
I did some tests and I was able to build easily kconfig.

The KCOREADDONS_DEPRECATED must be added to the qtkde5macros script. I 
attached a patch I created, so you have an idea what I did.

For the other errors are very specific.
I found for instance that pointer are not handled correctly, and throw an 
error.

Also this line is problematic:
typedef void (QObject::* NotifyFunction)(quint64 arg);

Seems also that also this line is not handled:
#ifndef KDE_NO_DEPRECATED
I looked in pplexer.py but seems that the #ifndef definition is managed, don't 
know why this generates an error.

You are working on the official repository?
I'm personally testing locally, I need this lib to port our SW to kf5 on 
Chakra linux.

Luca

In data giovedì, 16 aprile 2015 20.52:57, Scott Kitterman ha scritto:
> I am running into some errors trying to generate bindings with the current
> twine2 and Kf5 5.9.0 (this is before I dive in and refactor into a separate
> module and possibly break things more).  It would be lovely if someone could
> have a look at what's going on in these cases.
> 
> Parsing Cpp headers:
> ...
>     Parsing .../frameworks/kcoreaddons/src/lib/kaboutdata.h
> File: '.../frameworks/kcoreaddons/src/lib/kaboutdata.h' Line: 570 Syntax
> error in input. Token type: AMPERSAND, token value: &, lex state: variable
> 
> Here's the code that's at Line 570:
> 
>     KCOREADDONS_DEPRECATED KAboutData &setProgramIconName(const QString
> &iconName); // KF6 remove this
> 
> That's the only item marked deprecated, so I assume twine2 isn't handling
> this case.
> 
> If I comment that out of the Kf5 source, I make it to the next error:
> 
> Parsing Cpp headers:
> ...
>     Parsing .../frameworks/kcoreaddons/src/lib/plugin/kpluginloader.h
> File: '.../frameworks/kcoreaddons/src/lib/plugin/kpluginloader.h' Line: 310
> Syntax error in input. Token type: LPAREN, token value: (, lex state:
> function
> 
> Line 310 is the middle two of these four lines due to line wrapping in
> email:
> 
>     static QList<QObject *> instantiatePlugins(const QString &directory,
>             std::function<bool(const KPluginMetaData &)> filter =
> std::function<bool(const KPluginMetaData &)>(),
>             QObject* parent = Q_NULLPTR);
> 
> The same error happens at Line 330 in the same file the second two of the
> three:
> 
>     static QVector<KPluginMetaData> findPlugins(const QString &directory,
>             std::function<bool(const KPluginMetaData &)> filter =
>  std::function<bool(const KPluginMetaData &)>());
> 
> and again at line 352 (again the second/third lines):
> 
>     static void forEachPlugin(const QString &directory,
>             std::function<void(const QString &)> callback =
> std::function<void(const QString &)>());
> 
> If I comment all those out, I at least get to the end of header parsing. 
> I'm unlikely to be able to sort these out on my own, so it would be really
> good if someone else could take a look.
> 
> Scott K
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings@kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings

["qtkde5macros.patch" (qtkde5macros.patch)]

diff --git a/qtkde5macros.py b/qtkde5macros.py
index 4edb434..2c7b5ab 100644
--- a/qtkde5macros.py
+++ b/qtkde5macros.py
@@ -36,7 +36,8 @@ __QtMacros = [
         "Q_DECLARE_BUILTIN_METATYPE", "Q_OBJECT_CHECK", "Q_DECLARE_PRIVATE_MI",\
         "KDEUI_DECLARE_PRIVATE", "KPARTS_DECLARE_PRIVATE", "Q_INTERFACES",\
         '__attribute__', 'Q_DISABLE_COPY', 'K_SYCOCATYPE', 'Q_DECLARE_TR_FUNCTIONS',\
-        'Q_DECLARE_TYPEINFO']
+        'Q_DECLARE_TYPEINFO' 'Q_REQUIRED_RESULT' 'KCONFIGCORE_DEPRECATED'
+        'KCONFIGGUI_EXPORT']
 
 
 def QtMacros(extraMacros=[]):
@@ -56,7 +57,10 @@ __QtPreprocessSubstitutionMacros = [
         ("KITEMVIEWS_DEPRECATED",""),
         ("Q_DECL_OVERRIDE", ""),
         ("Q_DECL_FINAL", ""),
-        ("Q_DECL_IMPORT", "")
+        ("Q_DECL_IMPORT", ""),
+        ("Q_REQUIRED_RESULT", ""),
+        ("KCONFIGCORE_DEPRECATED", ""),
+        ("KCONFIGGUI_EXPORT", "")
         ]
 def QtPreprocessSubstitutionMacros(extraMacros=[]):
     macros = __QtPreprocessSubstitutionMacros[:]

[Attachment #4 (text/plain)]

_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings


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

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