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

List:       kde-commits
Subject:    KDE/kdelibs/kjsembed
From:       Erik Lloyd Bunce <kde () bunce ! us>
Date:       2006-10-05 12:09:43
Message-ID: 1160050183.164819.27791.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 592691 by bunce:

Make kjscmd use KApplication for non-gui, with kde and print which QCoreApplication \
derived class was used. Fix kjscmd KApplication command line processing.  Don't \
preclude structs from processing by autobind.

 M  +7 -2      autobind/values/generate.js  
 M  +3 -3      autobind/values/generatebinding.js  
 M  +1 -1      autobind/values/generateheader.js  
 M  +12 -3     kjscmd/kjscmd.cpp  


--- trunk/KDE/kdelibs/kjsembed/autobind/values/generate.js #592690:592691
@@ -48,6 +48,9 @@
     // Stores the name the compound object binding will be known by
     compound.binding = compound.name + "Binding";
 
+    // Stores the filename the compound binding will be stored as
+    compound.filebase = compound.name.replace(/::/g, '_');
+
     // Stores a list of elements that define all the members of the object.
     compound.memberList = compound.def.elementsByTagName( "memberdef" );
 
@@ -126,7 +129,9 @@
 {
     var compoundElement = nodeList.item(x).toElement();
     var compoundKind = compoundElement.attribute('kind');
-    if (( compoundKind == 'class' ) || (compoundKind == 'namespace'))
+    if (( compoundKind == 'class' ) ||
+	( compoundKind == 'struct' ) ||
+	( compoundKind == 'namespace' ))
     {
         var classRootElement = process_class( compoundElement );
         var compoundDef = \
classRootElement.firstChildElement('compounddef').toElement(); @@ -164,7 +169,7 @@
     var compound_elem =  nodeList.item(x).toElement();
     var kind = compound_elem.attribute( 'kind' );
 
-    if ( kind == 'class' )
+    if ( ( kind == 'class' ) || ( kind == 'struct' ))
     {
         var classRootElement = process_class( compound_elem );
         process_class_info( classRootElement );
--- trunk/KDE/kdelibs/kjsembed/autobind/values/generatebinding.js #592690:592691
@@ -647,7 +647,7 @@
 
 
 //    println ( "compoundIncludes: " + compoundIncludes );
-    includes += '#include "' + compound.name + '_bind.h"\n';
+    includes += '#include "' + compound.filebase + '_bind.h"\n';
     includes += '#include <' + compoundIncludes + '>\n';
     includes += '#include <object_binding.h>\n';
     if (compound.isVariant)
@@ -690,7 +690,7 @@
 
 
     // Write everything
-    var fileName = output_dir + compound.name + '_bind.cpp';
+    var fileName = output_dir + compound.filebase + '_bind.cpp';
     var bindingFile = new File( fileName );
     if( !bindingFile.open( File.WriteOnly ) )
         throw "Unable to open output binding, " + fileName;
@@ -699,7 +699,7 @@
     for (var i in compound.externalBindings)
     {
         println('    ' + i);
-        includes += '#include "' + i + '_bind.h"\n';
+        includes += '#include "' + i.replace(/::/g, '_') + '_bind.h"\n';
         includes += '#include <' + i + '>\n'; 
     }
 
--- trunk/KDE/kdelibs/kjsembed/autobind/values/generateheader.js #592690:592691
@@ -67,7 +67,7 @@
         '}\n' +
         '#endif // BIND_' + compound.name + '_H\n\n';
 
-    var fileName = output_dir + compound.name + '_bind.h';
+    var fileName = output_dir + compound.filebase + '_bind.h';
     header = new File( fileName );
 
     if( !header.open( File.WriteOnly ) )
--- trunk/KDE/kdelibs/kjsembed/kjscmd/kjscmd.cpp #592690:592691
@@ -45,6 +45,9 @@
                           << "Options:" << endl
                           << "    -e, --exec            execute script without gui \
                support." << endl 
                           << "    -i, --interactive     start interactive kjs \
interpreter." << endl +#ifndef QT_ONLY
+                          << "    -n, --no-kde          start without KDE \
KApplication support." << endl +#endif
                           << endl;
 }
 
@@ -52,6 +55,12 @@
 
 static KCmdLineOptions options[] =
 {
+    {"e", I18N_NOOP("Execute script without gui support"), 0 },
+    {"exec", I18N_NOOP("Execute script without gui support"), 0 },
+    {"i", I18N_NOOP("start interactive kjs interpreter"), 0 },
+    {"interactive", I18N_NOOP("start interactive kjs interpreter"), 0 },
+    {"n", I18N_NOOP("start without KDE KApplication support."), 0 },
+    {"no-kde", I18N_NOOP("start without KDE KApplication support."), 0 },
     { "!+command", I18N_NOOP("Script to execute"), 0 },
     KCmdLineLastOption
 };
@@ -135,7 +144,7 @@
     QCoreApplication *app;
 
 #ifndef QT_ONLY
-    if (kde && gui)
+    if (kde)
     {
         KAboutData aboutData( "kjscmd", I18N_NOOP("KJSCmd"), "0.2",
             I18N_NOOP(""
@@ -146,7 +155,7 @@
         KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
         KCmdLineArgs::init( argc, argv, &aboutData );
 
-        app = new KApplication();
+        app = new KApplication(gui);
     }
     else
 #endif
@@ -161,7 +170,7 @@
 	qDebug("no GUI");
         app = new QCoreApplication(argc, argv);
     }
-    qDebug(" New QApplication %dms", time.elapsed());
+    qDebug(" New %s %dms", app->metaObject()->className(), time.elapsed());
 
     app->setApplicationName( appName );
     


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

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