Hello community,

here is the log from the commit of package kdebindings-smokegen for 
openSUSE:Factory checked in at 2013-07-08 07:34:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdebindings-smokegen (Old)
 and      /work/SRC/openSUSE:Factory/.kdebindings-smokegen.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdebindings-smokegen"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/kdebindings-smokegen/kdebindings-smokegen.changes    
    2013-06-11 09:31:23.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.kdebindings-smokegen.new/kdebindings-smokegen.changes
   2013-07-08 07:34:07.000000000 +0200
@@ -1,0 +2,14 @@
+Thu Jun 27 18:10:42 UTC 2013 - [email protected]
+
+- Update to 4.10.90
+   * KDE 4.11 Beta 1 release
+   * See http://www.kde.org/announcements/announce-4.11-beta2.php
+
+-------------------------------------------------------------------
+Thu Jun 13 19:13:56 UTC 2013 - [email protected]
+
+- Update to 4.10.80
+   * KDE 4.11 Beta 1 release
+   * See http://www.kde.org/announcements/announce-4.11-beta1.php
+
+-------------------------------------------------------------------

Old:
----
  smokegen-4.10.4.tar.xz

New:
----
  smokegen-4.10.90.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdebindings-smokegen.spec ++++++
--- /var/tmp/diff_new_pack.33zQnI/_old  2013-07-08 07:34:07.000000000 +0200
+++ /var/tmp/diff_new_pack.33zQnI/_new  2013-07-08 07:34:07.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           kdebindings-smokegen
-Version:        4.10.4
+Version:        4.10.90
 Release:        0
 Summary:        Smoke Generator for kdebindings
 License:        GPL-2.0

++++++ smokegen-4.10.4.tar.xz -> smokegen-4.10.90.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smokegen-4.10.4/cmake/SmokeConfig.cmake.in 
new/smokegen-4.10.90/cmake/SmokeConfig.cmake.in
--- old/smokegen-4.10.4/cmake/SmokeConfig.cmake.in      2013-05-28 
20:42:27.000000000 +0200
+++ new/smokegen-4.10.90/cmake/SmokeConfig.cmake.in     2013-06-10 
20:51:33.000000000 +0200
@@ -34,7 +34,7 @@
 
 ##############################
 # find individual smoke libs #
-##############################Smoke_FIND_REQUIRED
+##############################
 
 macro (find_smoke_component name)
     string(TOUPPER ${name} uppercase)
@@ -45,21 +45,12 @@
 
         find_path(SMOKE_${uppercase}_INCLUDE_DIR 
             ${lowercase}_smoke.h 
-            PATH ${SMOKE_INCLUDE_DIR}
-            NO_DEFAULT_PATH
-            )
-        if(WIN32)
-                   # DLLs are in the bin directory.
-            find_library(SMOKE_${uppercase}_LIBRARY
-                smoke${lowercase}
-                PATHS "@CMAKE_INSTALL_PREFIX@/bin"
-                NO_DEFAULT_PATH)
-        else(WIN32)
-            find_library(SMOKE_${uppercase}_LIBRARY
-                smoke${lowercase}
-                PATHS "@SMOKE_LIBRARY_PREFIX@"
-                NO_DEFAULT_PATH)
-        endif(WIN32)
+            HINTS ${SMOKE_INCLUDE_DIR}
+           PATH_SUFFIXES smoke)
+
+        find_library(SMOKE_${uppercase}_LIBRARY
+            smoke${lowercase}
+           HINTS "@SMOKE_LIBRARY_PREFIX@")
 
         if (NOT SMOKE_${uppercase}_INCLUDE_DIR OR NOT 
SMOKE_${uppercase}_LIBRARY)
             if (Smoke_FIND_REQUIRED)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smokegen-4.10.4/generators/smoke/CMakeLists.txt 
new/smokegen-4.10.90/generators/smoke/CMakeLists.txt
--- old/smokegen-4.10.4/generators/smoke/CMakeLists.txt 2013-05-28 
20:42:27.000000000 +0200
+++ new/smokegen-4.10.90/generators/smoke/CMakeLists.txt        2013-06-10 
20:51:33.000000000 +0200
@@ -7,7 +7,7 @@
     helpers.cpp)
 
 add_library(generator_smoke MODULE ${generator_smoke_SRC})
-target_link_libraries(generator_smoke ${QT_QTCORE_LIBRARY} ${QT_QTXML_LIBRARY} 
smokegen)
+target_link_libraries(generator_smoke smokebase ${QT_QTCORE_LIBRARY} 
${QT_QTXML_LIBRARY} smokegen)
 set_target_properties(generator_smoke PROPERTIES PREFIX "")
 
 if (WIN32)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smokegen-4.10.4/generators/smoke/generator_smoke.cpp 
new/smokegen-4.10.90/generators/smoke/generator_smoke.cpp
--- old/smokegen-4.10.4/generators/smoke/generator_smoke.cpp    2013-05-28 
20:42:27.000000000 +0200
+++ new/smokegen-4.10.90/generators/smoke/generator_smoke.cpp   2013-06-10 
20:51:33.000000000 +0200
@@ -41,6 +41,7 @@
 int Options::parts = 20;
 QString Options::module = "qt";
 QStringList Options::parentModules;
+QDir Options::libDir;
 QStringList Options::scalarTypes;
 QStringList Options::voidpTypes;
 bool Options::qtMode = false;
@@ -56,7 +57,8 @@
     "    -p <parts> (default: 20)" << std::endl <<
     "    -pm <comma-seperated list of parent modules>" << std::endl <<
     "    -st <comma-seperated list of types that should be munged to scalars>" 
<< std::endl <<
-    "    -vt <comma-seperated list of types that should be mapped to 
Smoke::t_voidp>" << std::endl;
+    "    -vt <comma-seperated list of types that should be mapped to 
Smoke::t_voidp>" << std::endl <<
+    "    -L <directory containing parent libs> (parent smoke libs can be 
located in a <modulename> subdirectory>)" << std::endl;
 }
 
 extern "C" Q_DECL_EXPORT
@@ -68,8 +70,9 @@
     
     const QStringList& args = QCoreApplication::arguments();
     for (int i = 0; i < args.count(); i++) {
-        if ((args[i] == "-m" || args[i] == "-p" || args[i] == "-pm" || args[i] 
== "-o" ||
-             args[i] == "-st" || args[i] == "-vt" || args[i] == 
"-smokeconfig") && i + 1 >= args.count())
+        if (  (args[i] == "-m" || args[i] == "-p" || args[i] == "-pm" || 
args[i] == "-o" ||
+               args[i] == "-st" || args[i] == "-vt" || args[i] == 
"-smokeconfig" || args[i] == "-L")
+            && i + 1 >= args.count())
         {
             qCritical() << "generator_smoke: not enough parameters for option" 
<< args[i];
             return EXIT_FAILURE;
@@ -92,6 +95,8 @@
             smokeConfig = QFileInfo(args[++i]);
         } else if (args[i] == "-o") {
             Options::outputDir = QDir(args[++i]);
+        } else if (args[i] == "-L") {
+            Options::libDir = QDir(args[++i]);
         } else if (args[i] == "-h" || args[i] == "--help") {
             showUsage();
             return EXIT_SUCCESS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smokegen-4.10.4/generators/smoke/globals.h 
new/smokegen-4.10.90/generators/smoke/globals.h
--- old/smokegen-4.10.4/generators/smoke/globals.h      2013-05-28 
20:42:27.000000000 +0200
+++ new/smokegen-4.10.90/generators/smoke/globals.h     2013-06-10 
20:51:33.000000000 +0200
@@ -47,6 +47,7 @@
     static int parts;
     static QString module;
     static QStringList parentModules;
+    static QDir libDir;
     static QStringList scalarTypes;
     static QStringList voidpTypes;
     static QList<QFileInfo> headerList;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smokegen-4.10.4/generators/smoke/helpers.cpp 
new/smokegen-4.10.90/generators/smoke/helpers.cpp
--- old/smokegen-4.10.4/generators/smoke/helpers.cpp    2013-05-28 
20:42:27.000000000 +0200
+++ new/smokegen-4.10.90/generators/smoke/helpers.cpp   2013-06-10 
20:51:33.000000000 +0200
@@ -17,15 +17,21 @@
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
+#include <QFileInfo>
 #include <QHash>
 #include <QList>
+#include <QLibrary>
 #include <QStack>
+#include <QDir>
 
 #include <type.h>
+#include <smoke.h>
 
 #include "globals.h"
 #include "../../options.h"
 
+typedef void (*InitSmokeFn)();
+
 QHash<QString, QString> Util::typeMap;
 QHash<const Method*, const Function*> Util::globalFunctionMap;
 QHash<const Method*, const Field*> Util::fieldAccessors;
@@ -92,13 +98,116 @@
     return (lhs.name() == rhs.name() && lhs.declaringType() == 
rhs.declaringType() && lhs.type() == rhs.type());
 }
 
+static Smoke* loadSmokeModule(QString moduleName) {
+    QLibrary lib;
+#if defined(Q_OS_WIN32)
+    QString libName = QLatin1String("smoke") + moduleName;
+#else
+    QString libName = QLatin1String("libsmoke") + moduleName;
+#endif
+
+    // first, try <libdir>/moduleName/libsmokemoduleName
+    lib.setFileName(Options::libDir.filePath(moduleName + '/' + libName));
+
+    // then <libdir>/libsmokemoduleName
+    if (!lib.load()) {
+        lib.setFileName(Options::libDir.filePath(libName));
+    }
+
+    // use the plain library name if everything else fails
+    if (!lib.load()) {
+        lib.setFileName(libName);
+    }
+
+    lib.load();
+
+    QString init_name = "init_" + moduleName + "_Smoke";
+    InitSmokeFn init = (InitSmokeFn) lib.resolve(init_name.toLatin1());
+
+    if (!init) {
+        qWarning("Couldn't resolve %s: %s", qPrintable(init_name), 
qPrintable(lib.errorString()));
+        return 0;
+    }
+
+    (*init)();
+
+    QString smoke_name = moduleName + "_Smoke";
+    Smoke** smoke = (Smoke**) lib.resolve(smoke_name.toLatin1());
+    if (!smoke) {
+        qWarning("Couldn't resolve %s: %s", qPrintable(smoke_name), 
qPrintable(lib.errorString()));
+        return 0;
+    }
+
+    return *smoke;
+}
+
+static bool compareArgs(const Method& method, const Smoke::Method& 
smokeMethod, Smoke* smoke) {
+    if (method.parameters().count() != smokeMethod.numArgs) {
+        return false;
+    }
+    for (int i = 0; i < method.parameters().count(); i++) {
+        const Parameter& p = method.parameters()[i];
+        if (p.type()->toString() != 
QLatin1String(smoke->types[smoke->argumentList[smokeMethod.args + i]].name)) {
+            return false;
+        }
+    }
+    return true;
+}
+
+static bool isRepeating(const QList<Smoke*>& parentModules, const char* 
className, const Method& method) {
+    QString mungedName = Util::mungedName(method).toLatin1();
+    foreach (Smoke* smoke, parentModules) {
+        Smoke::ModuleIndex methodIndex = smoke->findMethod(className, 
mungedName.toLatin1().constData());
+        if (methodIndex.index) {
+            Smoke::Index index = 
methodIndex.smoke->methodMaps[methodIndex.index].method;
+            if (index >= 0) {
+                if (compareArgs(method, methodIndex.smoke->methods[index], 
methodIndex.smoke)) {
+                    return true;
+                }
+                continue;
+            }
+            index = -index;
+            Smoke::Index i;
+            while ((i = methodIndex.smoke->ambiguousMethodList[index++]) != 0) 
{
+                if (compareArgs(method, methodIndex.smoke->methods[i], 
methodIndex.smoke)) {
+                    return true;
+                }
+            }
+        }
+    }
+    return false;
+}
+
+// assuming that enums don't change between modules, checking for the first 
member only is sufficient
+static bool isRepeating(const QList<Smoke*>& parentModules, const char* 
className, const Enum& eNum) {
+    if (eNum.members().isEmpty())
+        return false;
+
+    const EnumMember& firstMember = eNum.members().first();
+
+    foreach(Smoke *smoke, parentModules) {
+        Smoke::ModuleIndex methodIndex = smoke->findMethod(className, 
firstMember.name().toLatin1().constData());
+        if (methodIndex.index)
+            return true;
+    }
+    return false;
+}
+
 void Util::preparse(QSet<Type*> *usedTypes, QSet<const Class*> *superClasses, 
const QList<QString>& keys)
 {
     Class& globalSpace = classes["QGlobalSpace"];
     globalSpace.setName("QGlobalSpace");
     globalSpace.setKind(Class::Kind_Class);
     globalSpace.setIsNameSpace(true);
-    
+
+    QList<Smoke*> parentModules;
+    foreach (QString module, Options::parentModules) {
+        Smoke *smoke = loadSmokeModule(module);
+        if (smoke) {
+            parentModules << smoke;
+        }
+    }
+
     // add all functions as methods to a class called 'QGlobalSpace' or a 
class that represents a namespace
     for (QHash<QString, Function>::const_iterator it = functions.constBegin(); 
it != functions.constEnd(); it++) {
         const Function& fn = it.value();
@@ -127,6 +236,9 @@
         
         Method meth = Method(parent, fn.name(), fn.type(), Access_public, 
fn.parameters());
         meth.setFlag(Method::Static);
+        if (isRepeating(parentModules, parent->name().toLatin1(), meth)) {
+            continue;
+        }
         parent->appendMethod(meth);
         // map this method to the function, so we can later retrieve the 
header it was defined in
         globalFunctionMap[&parent->methods().last()] = &fn;
@@ -141,12 +253,13 @@
         foreach (const Parameter& param, meth.parameters())
             (*usedTypes) << param.type();
     }
-    
+
     // all enums that don't have a parent are put under QGlobalSpace, too
     for (QHash<QString, Enum>::iterator it = enums.begin(); it != enums.end(); 
it++) {
         Enum& e = it.value();
         if (!e.parent()) {
             Class* parent = &globalSpace;
+            // if the enum is defined in a namespace, make that the enum's 
parent
             if (!e.nameSpace().isEmpty()) {
                 parent = &classes[e.nameSpace()];
                 if (parent->name().isEmpty()) {
@@ -154,6 +267,9 @@
                     parent->setKind(Class::Kind_Class);
                     parent->setIsNameSpace(true);
                 }
+            // else, see if it is already defined in a parent module
+            } else if (isRepeating(parentModules, parent->name().toLatin1(), 
e)) {
+                continue;
             }
 
             Type *t = 0;
@@ -169,7 +285,11 @@
             parent->appendChild(&e);
         }
     }
-    
+
+    foreach (Smoke* smoke, parentModules) {
+        delete smoke;
+    }
+
     foreach (const QString& key, keys) {
         Class& klass = classes[key];
         foreach (const Class::BaseClassSpecifier base, klass.baseClasses()) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/smokegen-4.10.4/generators/smoke/writeSmokeDataFile.cpp 
new/smokegen-4.10.90/generators/smoke/writeSmokeDataFile.cpp
--- old/smokegen-4.10.4/generators/smoke/writeSmokeDataFile.cpp 2013-05-28 
20:42:27.000000000 +0200
+++ new/smokegen-4.10.90/generators/smoke/writeSmokeDataFile.cpp        
2013-06-10 20:51:33.000000000 +0200
@@ -296,7 +296,9 @@
         inheritanceIndex[&klass] = idx;
     }
     out << "};\n\n";
-    
+
+    Class& globalSpace = classes["QGlobalSpace"];
+
     // xenum functions
     out << "// These are the xenum functions for manipulating enum pointers\n";
     QSet<QString> enumClassesHandled;
@@ -318,8 +320,13 @@
             smokeClassName.replace("::", "__");
             out << "void xenum_" << smokeClassName << "(Smoke::EnumOperation, 
Smoke::Index, void*&, long&);\n";
         } else if (smokeClassName.isEmpty() && it.value().access() != 
Access_private) {
-            if (enumClassesHandled.contains("QGlobalSpace"))
+            // see if we have actually put the enum into QGlobalSpace (might 
not be the case if it's already handled
+            // in a parent module)
+            if (   enumClassesHandled.contains("QGlobalSpace")
+                || 
!globalSpace.children().contains(const_cast<Enum*>(&it.value())))
+            {
                 continue;
+            }
             out << "void xenum_QGlobalSpace(Smoke::EnumOperation, 
Smoke::Index, void*&, long&);\n";
             enumClassesHandled << "QGlobalSpace";
         }

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to