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

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Aug 7 18:19:32 UTC 2008


SVN commit 843738 by rdale:

2008-08-07  Richard Dale  <richard.j.dale at gmail.com>
* The marshaller for Plasma::DataEngine::Data was creating Qt::Variants with
  the wrong smoke pointer in the smokeruby_object struct, and this was causing
  a crash in the GC marking function.
* In PlasmaScripting::Applet, if a constant such as NoBackground is referenced
  and found to be missing, then look for it in Plasma::Applet.
* Fix bugs in the PlasmaScripting::Applet#showConfigurationInterface method
* Special case Plasma::Applet#id so it doesn't get a Ruby warning.
* In PlasmaScriptengineRuby::Applet the module name wasn't being derived 
  correctly from the Package path

CCMAIL: kde-bindings at kde.org


 M  +6 -0      ChangeLog  
 M  +1 -1      src/applet.rb  
 M  +14 -2     src/lib/KDE/plasma.rb  


--- trunk/KDE/kdebindings/ruby/plasma/ChangeLog #843737:843738
@@ -2,6 +2,12 @@
 * The marshaller for Plasma::DataEngine::Data was creating Qt::Variants with
   the wrong smoke pointer in the smokeruby_object struct, and this was causing
   a crash in the GC marking function.
+* In PlasmaScripting::Applet, if a constant such as NoBackground is referenced
+  and found to be missing, then look for it in Plasma::Applet.
+* Fix bugs in the PlasmaScripting::Applet#showConfigurationInterface method
+* Special case Plasma::Applet#id so it doesn't get a Ruby warning.
+* In PlasmaScriptengineRuby::Applet the module name wasn't being derived 
+  correctly from the Package path
 
 2008-08-06  Richard Dale  <richard.j.dale at gmail.com>
 * Add some fixes for the new Plasma::Frame and Plasma::Slider widgets
--- trunk/KDE/kdebindings/ruby/plasma/src/applet.rb #843737:843738
@@ -36,7 +36,7 @@
       program = Qt::FileInfo.new(mainScript)
       $: << program.path
       load Qt::File.encodeName(program.filePath).to_s
-      moduleName = camelize(package.metadata.name)
+      moduleName = camelize(Qt::Dir.new(package.path).dirName)
       className = camelize(program.baseName)
       puts "RubyAppletScript::Applet#init instantiating: #{moduleName}::#{className}"
       klass = Object.const_get(moduleName.to_sym).const_get(className.to_sym)
--- trunk/KDE/kdebindings/ruby/plasma/src/lib/KDE/plasma.rb #843737:843738
@@ -45,6 +45,10 @@
     def type(*args)
       method_missing(:type, *args)
     end
+
+    def id(*args)
+      method_missing(:id, *args)
+    end
   end
 
   class Containment < Qt::Base
@@ -113,6 +117,14 @@
       end
     end
 
+    def self.const_missing(name)
+      begin
+        super(name)
+      rescue
+        Plasma::Applet.const_missing(name)
+      end
+    end
+
     def paintInterface(painter, option, contentsRect)
     end
 
@@ -135,8 +147,8 @@
     end
 
     def showConfigurationInterface
-        dialogId = "#{applet.id}settings#{applet.name}"
-        windowTitle = KDE::i18nc("@title:window", "%s Settings" % applet.name)
+        dialogId = "#{@applet_script.applet.id}settings#{@applet_script.applet.name}"
+        windowTitle = KDE::i18nc("@title:window", "%s Settings" % @applet_script.applet.name)
         @nullManager = KDE::ConfigSkeleton.new(nil)
         dialog = KDE::ConfigDialog.new(nil, dialogId, @nullManager)
         dialog.faceType = KDE::PageDialog::Auto



More information about the Kde-bindings mailing list