[Kde-bindings] KDE/kdebindings/ruby/korundum
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Thu May 29 11:48:51 UTC 2008
SVN commit 814127 by rdale:
* Fix the KDE::CmdLineArgs.init() method to work with Ruby Strings and
convert them to Qt::ByteArrays.
CCMAIL: kde-bindings at kde.org
M +5 -0 ChangeLog
M +19 -7 src/lib/KDE/korundum4.rb
--- trunk/KDE/kdebindings/ruby/korundum/ChangeLog #814126:814127
@@ -1,3 +1,8 @@
+2008-05-29 Richard Dale <richard.j.dale at gmail.com>
+
+ * Fix the KDE::CmdLineArgs.init() method to work with Ruby Strings and
+ convert them to Qt::ByteArrays.
+
2008-05-22 Arno Rehn <arno at arnorehn.de>
* Remove the remaining soprano parts from korundum.
--- trunk/KDE/kdebindings/ruby/korundum/src/lib/KDE/korundum4.rb #814126:814127
@@ -167,15 +167,27 @@
class CmdLineArgs < Qt::Base
include Enumerable
- def CmdLineArgs.init(*k)
- if k.length > 0
- if k[0].kind_of? Array
+ def CmdLineArgs.init(*args)
+ if args.length > 0
+ if args[0].kind_of? Array
# If init() is passed an array as the first argument, assume it's ARGV.
# Then convert to a pair of args 'ARGV.length+1, [$0]+ARGV'
- array = k.shift
- super(*([array.length+1] + [[$0] + array] + k))
- elsif k[0].kind_of? KDE::AboutData
- super(1, [$0], k[0])
+ array = args.shift
+ if args[0].kind_of? KDE::AboutData
+ super(*([array.length+1] + [[$0] + array] + args))
+ else
+ sargs = []
+ for i in 0...args.length do
+ if [0, 1, 3].include?(i) && (args[i].kind_of?(String) || args[i].nil?)
+ sargs << Qt::ByteArray.new(args[i])
+ else
+ sargs << args[i]
+ end
+ end
+ super(*([array.length+1] + [[$0] + array] + sargs))
+ end
+ elsif args[0].kind_of? KDE::AboutData
+ super(1, [$0], args[0])
end
else
super
More information about the Kde-bindings
mailing list