[Kde-bindings] KDE/kdebindings/ruby/korundum

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Apr 22 10:26:12 UTC 2008


SVN commit 799785 by rdale:

* Made the krubyapplication executable work with args to be passed to the
  KDE ruby app. 
* Changed the dbpedia_references example to use a .desktop file and be 
  installed by a CMakeLists.txt file

CCMAIL: kde-bindings at kde.org


 M  +1 -1      CMakeLists.txt  
 M  +7 -0      ChangeLog  
 A             examples/CMakeLists.txt  
 A             examples/dbpedia_references (directory)  
 D             examples/dbpedia_references.rb  
 A             examples/dbpedia_references/CMakeLists.txt  
 A             examples/dbpedia_references/dbpedia_references.desktop  
 A             examples/dbpedia_references/dbpedia_references.rb   examples/dbpedia_references.rb#799346
 M  +9 -8      src/krubyapplication.cpp  


--- trunk/KDE/kdebindings/ruby/korundum/CMakeLists.txt #799784:799785
@@ -1,4 +1,4 @@
-
+add_subdirectory( examples )
 add_subdirectory( src )
 add_subdirectory( tools )
 
--- trunk/KDE/kdebindings/ruby/korundum/ChangeLog #799784:799785
@@ -1,3 +1,10 @@
+2008-04-22  Richard Dale  <rdale at foton.es>
+
+	* Made the krubyapplication executable work with args to be passed to the
+	  KDE ruby app. 
+	* Changed the dbpedia_references example to use a .desktop file and be 
+	  installed by a CMakeLists.txt file
+
 2008-04-21  Richard Dale  <rdale at foton.es>
 
     * Add a krubyapplication executable for starting ruby KDE apps. It takes
--- trunk/KDE/kdebindings/ruby/korundum/src/krubyapplication.cpp #799784:799785
@@ -28,7 +28,7 @@
 
 int main(int argc, char **argv) {
     if (argc < 3) {
-        fprintf(stderr, "Usage: %s application_name ruby_script\n", argv[0]);
+        fprintf(stderr, "Usage: %s application_name directory/ruby_script [Qt-options] [KDE-options]\n", argv[0]);
         return 1;
     }
 
@@ -36,24 +36,25 @@
     QString path = componentData.dirs()->locate("data", argv[2]);
 
     if (path.isEmpty()) {
-        kWarning() << "Ruby script" << argv[1] << "missing";
+        kWarning() << "Ruby script" << argv[2] << "missing";
         return 1;
     }
 
     QFileInfo program(path);
      
-    char ** rubyargs = (char **) calloc(argc-1, sizeof(char *));
-    rubyargs[0] = strdup(program.fileName().latin1());
-    rubyargs[1] = strdup(program.fileName().latin1());
+    char ** rubyargs = (char **) calloc(argc, sizeof(char *));
+    rubyargs[0] = strdup(argv[1]);
+    rubyargs[1] = strdup("-KU");
+    rubyargs[2] = strdup(QFile::encodeName(program.filePath()));
     for (int i = 3; i < argc; i++) {
-        rubyargs[i-1] = argv[i];
+        rubyargs[i] = strdup(argv[i]);
     }
 
     RUBY_INIT_STACK
     ruby_init();
-    ruby_options(argc-1, rubyargs); 
     ruby_init_loadpath();
     ruby_incpush(QFile::encodeName(program.path()));
-    rb_gv_set("$KCODE", rb_str_new2("u"));
+    ruby_options(argc, rubyargs); 
+    ruby_script(argv[1]);
     ruby_run();
 }



More information about the Kde-bindings mailing list