[Kde-bindings] [qtruby] /: * Rename rb_str_catf() as qtruby_str_catf() as it clashes with a function

Richard Dale richard.dale at codethink.co.uk
Mon Apr 9 18:56:45 UTC 2012


Git commit 6855967bf1578367fe3c4154e1c31ee8bfa9d8fa by Richard Dale.
Committed on 09/04/2012 at 20:55.
Pushed by rdale into branch 'master'.

* Rename rb_str_catf() as qtruby_str_catf() as it clashes with a function
 in Ruby 1.9.2 with the same name

CCMAIL: kde-bindings at kde.org

M  +197  -192  ChangeLog
M  +115  -115  src/Qt.cpp
M  +150  -150  src/qtruby.cpp
M  +3    -3    src/qtruby.h

http://commits.kde.org/qtruby/6855967bf1578367fe3c4154e1c31ee8bfa9d8fa

diff --git a/ChangeLog b/ChangeLog
index 5db081b..103a0b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-09  Richard Dale  <richard.j.dale at gmail.com>
+
+    * Rename rb_str_catf() as qtruby_str_catf() as it clashes with a function
+    in Ruby 1.9.2 with the same name
+
 2011-05-30  Richard Dale  <richard.j.dale at gmail.com>
 
     * 'long long' types were no longer being marshalled correctly
@@ -9,7 +14,7 @@
 
 2011-04-23  Richard Dale  <richard.j.dale at gmail.com>
 
-    * Apply a patch from David Palacio which fixes a crash when creating a 
+    * Apply a patch from David Palacio which fixes a crash when creating a
       Qt::Variant from a list or a hash
 
 2010-06-22  Richard Dale  <richard.j.dale at gmail.com>
@@ -26,9 +31,9 @@
 	  idea IMHO.
 
 2010-03-14  Richard Dale  <richard.j.dale at gmail.com>
-	
-	* The QtDBus classes weren't being correctly initialized as the count of 
-	  classes was being taken from the QtSvg smoke lib. Thanks to Paulo 
+
+	* The QtDBus classes weren't being correctly initialized as the count of
+	  classes was being taken from the QtSvg smoke lib. Thanks to Paulo
 	  Capriotti for finding the bug.
 
 2010-03-07  Richard Dale  <richard.j.dale at gmail.com>
@@ -36,7 +41,7 @@
 	  reported by ruby.twiddler
 	* Drag and drop events in Plasma applets weren't being handled correctly.
 	  Fixes problem reported by Robert Riemann
-	* QtRuby overrides public_methods(), singleton_methods() and 
+	* QtRuby overrides public_methods(), singleton_methods() and
 	  protected_methods(), but omitted the optional 'all' argument. Thanks to
 	  Paolo Capriotti for the fix and bug report.
 
@@ -51,7 +56,7 @@
       in QtRuby, so add a 'private_slots' method to declare them. For example:
 
         class MyFirstTest < Qt::Object
-            private_slots   :initTestCase, :myFirstTest, 
+            private_slots   :initTestCase, :myFirstTest,
                             :mySecondTest, :cleanupTestCase
 
 2009-11-12  Richard Dale  <richard.j.dale at gmail.com>
@@ -89,7 +94,7 @@
         This makes a difference between being and being not able to run
         with GC.stress= true. Reason unclear, comments appreciated.
 
-        2) Extended typename =~ /^(?:u?char\*)$/ checks to support 
+        2) Extended typename =~ /^(?:u?char\*)$/ checks to support
         unsigned char.
 
         3) Skip "def instance_exec" if it is already defined
@@ -119,8 +124,8 @@
 	  primitive types to be passed as arguments where the expected arg type
 	  was a Qt::Variant. However, it subverts the 'munged method name' scheme
 	  of fast overloaded method resolution because for every method argument of
-	  type '#' (a class), it adds another of type '$' (a primitive type). So 
-	  with that scheme we might as well have only two of the munged method 
+	  type '#' (a class), it adds another of type '$' (a primitive type). So
+	  with that scheme we might as well have only two of the munged method
 	  types instead of three. Sometime we need to add support for C++ implicit
 	  constructors in resolving overloaded methods at runtime, but that is a
 	  really hard problem. In the meantime I think it is best to add support
@@ -128,7 +133,7 @@
 	  such as was done for the QtDBus and Plasma Data Engine apis.
 
 2009-06-23  Richard Dale  <richard.j.dale at gmail.com>
-	* In smokeruby_mark() layouts owned by QWidgets or QGraphicsWidgets are 
+	* In smokeruby_mark() layouts owned by QWidgets or QGraphicsWidgets are
 	  now marked. Items owned by QLayouts or QGraphicsLayouts are also marked.
 	  This fixes some premature garbage collection problems in Plasma Applets,
 	  reported by David Palacio.
@@ -143,24 +148,24 @@
 	  a Plasma::PopupApplet to match the underlying C++ type.
 
 2009-04-17  Richard Dale  <richard.j.dale at gmail.com>
-	* When Qt::StandardItemModel#setItemPrototype was used with a 
-      Qt::StandardItem it crashed because the clone() method was using 
+	* When Qt::StandardItemModel#setItemPrototype was used with a
+      Qt::StandardItem it crashed because the clone() method was using
       Object#clone. So special case the clone() method. Thanks to Stefano Crocco
       for reporting the bug.
 
 2009-04-07  Richard Dale  <richard.j.dale at gmail.com>
-	* The ActiveRecord based model classes were setting changed values in the 
+	* The ActiveRecord based model classes were setting changed values in the
 	  'attributes' and then saving the changed instance, like this
- 
+
 	  foo.attributes['my_att'] = value
 	  foo.save
 
-	  However, this no longer works with ActiveRecord, and the instance can 
+	  However, this no longer works with ActiveRecord, and the instance can
 	  be changed more directly like this
-	  
+
 	  foo['my_att'] = value
 	  foo.save
-	* QtRuby wasn't building on Mac OS X with a version of Qt built without 
+	* QtRuby wasn't building on Mac OS X with a version of Qt built without
 	  QtDBus support, so add some #ifdefs to fix that
 
 2009-03-24  Richard Dale  <richard.j.dale at gmail.com>
@@ -169,8 +174,8 @@
 2009-03-20  Richard Dale  <richard.j.dale at gmail.com>
 	* Remove 'LIBRARY' from this line in qtruby/src/CMakeLists.txt:
 
-	  install(TARGETS qtruby4shared 
-	          LIBRARY DESTINATION 
+	  install(TARGETS qtruby4shared
+	          LIBRARY DESTINATION
 	          ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} )
 
 	  It was causing problems with a configuration error when building QtRuby
@@ -190,9 +195,9 @@
 	  to Stefano Crocco for finding the problem.
 	* A problem has been found with QtRuby when it is run with Ruby 1.9.1
 	  and GC.stess is true. Thanks to Davor Ocelic for reporting it.
-	  In the smokeruby_mark() function called during garbage collection, 
-	  any virtual methods which are called on the instances being checked 
-	  could have overriden by Ruby methods.  So the Wt::Ruby runtime uses 
+	  In the smokeruby_mark() function called during garbage collection,
+	  any virtual methods which are called on the instances being checked
+	  could have overriden by Ruby methods.  So the Wt::Ruby runtime uses
 	  'respond_to()' to find out whether they have been overriden.
 	  However, this involves calling 'rb_intern()' on the method name,
 	  which means memory could be allocated, giving an error when running under
@@ -208,7 +213,7 @@
 		  This means that there is no longer a need for different sym links to
 		  the script for each QtRuby extension.
 		- One or more class names can be specifed. If no class name is given
-		  it means that all of the classes in the loaded QtRuby extensions 
+		  it means that all of the classes in the loaded QtRuby extensions
 		  should be searched
 		- A '-s' option attempts to show matching methods with Ruby types
 	* Removed the rbqtsh program as it was never really very useful
@@ -223,20 +228,20 @@
 	  as Soprano
 
 2009-02-25  Richard Dale  <richard.j.dale at gmail.com>
-	* Restored the note in the COPYING file about having permission from 
+	* Restored the note in the COPYING file about having permission from
 	  Trolltech, now Qt Software, to use the 'Qt' in QtRuby.
 
 2009-02-07  Richard Dale  <richard.j.dale at gmail.com>
-	* Add a Qt::dynamic_cast method as a synonym with a less clunky name for 
+	* Add a Qt::dynamic_cast method as a synonym with a less clunky name for
 	  Qt::Internal.cast_object_to
 
 2009-02-04  Richard Dale  <richard.j.dale at gmail.com>
-	* In Ruby 1.9.1 the arity of a block with no arguments is 0, whereas in 
-	  Ruby 1.8.x it is -1. This meant that blocks passed to QtRuby 
+	* In Ruby 1.9.1 the arity of a block with no arguments is 0, whereas in
+	  Ruby 1.8.x it is -1. This meant that blocks passed to QtRuby
 	  constructors with no args weren't working with Ruby 1.9.1
 
 2009-02-02  Richard Dale  <richard.j.dale at gmail.com>
-	* Set up a RUBY_VERSION macro to use to test for whether QtRuby is being 
+	* Set up a RUBY_VERSION macro to use to test for whether QtRuby is being
 	  built for Ruby 1.9 or not. Add patches from Mr Napalm for building with
 	  Ruby 1.9, for the new 'per string' encoding. Also add conditional code
 	  for whether to use the new rb_frame_callee() function or the old
@@ -247,7 +252,7 @@
 	  to construct which meant that it didn't work with classnames containing
 	  '::' scope operators. So strip out the scope part of the classname to
 	  create the consructor name.
-	* Make Qt::Internal#try_initialize catch a ':newqt' symbol rather than a 
+	* Make Qt::Internal#try_initialize catch a ':newqt' symbol rather than a
 	  string.
 
 2009-01-14  Richard Dale  <richard.j.dale at gmail.com>
@@ -256,7 +261,7 @@
 
 2009-01-13  Richard Dale  <richard.j.dale at gmail.com>
 	* Upped the QtRuby version number to 2.0.0
-	* Special cased some constants whose names clashed with Ruby classes. 
+	* Special cased some constants whose names clashed with Ruby classes.
 
 2008-12-19  Richard Dale  <richard.j.dale at gmail.com>
 	* When the construct_copy() function was used to copy and instance, it
@@ -266,7 +271,7 @@
 	  Palacio
 
 2008-12-18  Richard Dale  <richard.j.dale at gmail.com>
-	* Added another patch from Davor Ocelic for Ruby 1.9 compatible RSTRING 
+	* Added another patch from Davor Ocelic for Ruby 1.9 compatible RSTRING
 	  usage - thanks Davor
 
 2008-12-12  Richard Dale  <richard.j.dale at gmail.com>
@@ -289,7 +294,7 @@
 	  report.
 
 2008-12-11  Richard Dale  <richard.j.dale at gmail.com>
-	* Make some changes from the patch at 
+	* Make some changes from the patch at
       http://napalm.sf.cz/qt4-qtruby-ruby1.9.patch to make it easier to port
 	  qtruby to Ruby 1.9. Thanks to Davor Ocelic and Mr Napalm.
 
@@ -320,7 +325,7 @@
 
 	* From Bartosz Wadolowski (thanks for the patch):
 
-	unsigned char* marshalling in qtruby didn't work. The patch works as char* 
+	unsigned char* marshalling in qtruby didn't work. The patch works as char*
 	case does - I simply copied code and added one casting.
 	It also fixes method matching with string argument in qtruby4.rb. In
 	cases when method could take constant or regular (unsigned)char
@@ -332,7 +337,7 @@
 
 	  QImage ( uchar * data, int width, int height, Format format )
 	  QImage ( const uchar * data, int width, int height, Format format )
-	  QImage ( uchar * data, int width, int height, int bytesPerLine, Format 
+	  QImage ( uchar * data, int width, int height, int bytesPerLine, Format
                format )
 	  QImage ( const uchar * data, int width, int height, int bytesPerLine,
 			  Format format )
@@ -367,7 +372,7 @@
 
 2008-08-22  Richard Dale  <richard.j.dale at gmail.com>
 
-	* Argument types of 'unsigned short' were not being matched in the 
+	* Argument types of 'unsigned short' were not being matched in the
 	  overloaded method resolution code which was causing a Qt::KeyEvent
 	  constructor to fail. Fixes a problem reported by Stefano Crocco.
 
@@ -385,8 +390,8 @@
 
 2008-08-11  Richard Dale  <richard.j.dale at gmail.com>
 
-	* Added a qobject_cast() method that uses qt_metacast() to cast one 
-	  instance of QObject to another. This allow the KTextEditor:: 
+	* Added a qobject_cast() method that uses qt_metacast() to cast one
+	  instance of QObject to another. This allow the KTextEditor::
 	  interface classes to be used. Fixes a problem reported by Stefano
 	  Crocco. Example usage:
 
@@ -417,8 +422,8 @@
 2008-07-21  Richard Dale  <richard.j.dale at gmail.com>
 
 	* Qt::Variant.fromValue() and Qt::Variant.value() now both work correctly
-	  with custom types, after a regression in the change to modular smoke. 
-	  It should no longer be necessary to use qVariantValue() or 
+	  with custom types, after a regression in the change to modular smoke.
+	  It should no longer be necessary to use qVariantValue() or
 	  qVariantFromValue().
 	* In the smoke library method calls for pure virtual methods were not
 	  being generated, only callbacks to override them. However, that
@@ -444,7 +449,7 @@
 2008-07-13  Richard Dale  <richard.j.dale at gmail.com>
 
 	* Remove the smoke2kross() function as it isn't needed anymore. Change
-	  the kross2smoke() function so that it assumes Kross will return a 
+	  the kross2smoke() function so that it assumes Kross will return a
 	  pointer to a pointer, instead of just a pointer to the C++ instance.
 
 2008-07-12  Richard Dale  <richard.j.dale at gmail.com>
@@ -453,7 +458,7 @@
       the C++ instance is at the start. This should make it easier for
 	  QtRuby to interoperate with Kross
 	* The type of a slot arg should always be in the smoke module of the slot
-	  being invoked. However, that isn't true for a dataUpdated() slot in a 
+	  being invoked. However, that isn't true for a dataUpdated() slot in a
       PlasmaScripting::Applet. So make GetMocArguments search through all the
 	  loaded smoke modules if the arg type isn't found at first.
 	* In the GC mark function the tests for a QObject type had gone missing, so
@@ -504,7 +509,7 @@
 2008-06-22  Richard Dale  <richard.j.dale at gmail.com>
 
 	* Fix bug in resolve_classname_qt() caused by missing break statments
-	* Move list marshaller macro definitions to the top of the 
+	* Move list marshaller macro definitions to the top of the
 	  marshall_macros.h header, and add a DEF_HASH_MARSHALLER macro
 	* Add a set_qtruby_embedded() function to qtruby for use with plugins
 	  like plasma
@@ -524,7 +529,7 @@
 2008-06-13  Richard Dale  <richard.j.dale at gmail.com>
 
 	* Remove unnecessary special casing for Qt::TextEdit::ExtraSelection,
-      just make it an ording QtRuby class instead of a Struct, and add a 
+      just make it an ording QtRuby class instead of a Struct, and add a
 	  marshaller for QList<QTextEdit::ExtraSelection>
 
 2008-06-14  Arno Rehn  <arno at arnorehn.de>
@@ -545,7 +550,7 @@
 	  library, such as KAction, it was failing to resolve it. This was
 	  because it was only looking in the smoke library of the arg type
 	  declared in the method. Hence, an arg type of 'QAction' was not
-	  being resolved to 'KAction'. Thanks to Stefano Crocco for reporting 
+	  being resolved to 'KAction'. Thanks to Stefano Crocco for reporting
 	  the bug.
 
 2008-06-09  Richard Dale  <richard.j.dale at gmail.com>
@@ -582,7 +587,7 @@
 2008-05-28  Richard Dale  <richard.j.dale at gmail.com>
 
 	* The enum Qt::Process::StandardError was clashing with the exception of
-	  the same name, so add a constant to the Qt::Process class instead. 
+	  the same name, so add a constant to the Qt::Process class instead.
 	  Thanks to Stefano Crocco for reporting the bug.
 
 2008-05-22  Arno Rehn  <arno at arnorehn.de>
@@ -596,9 +601,9 @@
 	  was. This caused a crash. Why such a major problem hasn't caused any
 	  problems before is a mystery - it wasn't a result of the modular smoke
 	  changes.
-	* qtruby4.rb calls Kernel#y instead of Qt::Point#y on inspect and 
+	* qtruby4.rb calls Kernel#y instead of Qt::Point#y on inspect and
 	  pretty_print when the yaml gem is loaded.
-	  The attached patch fixes the problem by calling Qt::Point#y and 
+	  The attached patch fixes the problem by calling Qt::Point#y and
 	  Qt::PointF#y explicitly. Thanks to Paolo Capriotti for the bug report
 	  and fix.
 
@@ -629,7 +634,7 @@
 2008-04-14  Richard Dale  <richard.j.dale at gmail.com>
 
 	* Special case the KDE::DateTime and KDE::TimeZone classes so that
-	  nested classes, such as KDE::DateTime::Spec work with them. 
+	  nested classes, such as KDE::DateTime::Spec work with them.
 	  TODO: make this work automatically without needing extra code.
 
 2008-04-10  Richard Dale  <richard.j.dale at gmail.com>
@@ -646,7 +651,7 @@
 	  virtual method callbacks and slot invocations in wrapped with
 	  a rb_protect() call. Otherwise, rb_funcall() is called directly
 	  and any uncaught Ruby exceptions will terminate the app.
-	* Borrowed a function from the kross code to put out an error message 
+	* Borrowed a function from the kross code to put out an error message
 	  and stacktrace on stderr for the current exception, when qtruby
 	  has been compiled with the embedded option.
 
@@ -664,8 +669,8 @@
 	  giving sys stackerror exceptions because the stack underflowed
 	  relative to where it was when the krubypluginfactory was loaded.
 	* Add more checking for Qnil in the marshallers for primitive types
-	  to make the runtime more robust. 
-	* Added some more range=(Range) methods as synonyms for 
+	  to make the runtime more robust.
+	* Added some more range=(Range) methods as synonyms for
 	  setRange(Integer, Integer)
 	* Changed the examples to use range=
 	* Added a rbplasmaapi command line tool for introspecting the Ruby api
@@ -719,12 +724,12 @@
 
 	* When a method call began or ended with an underscore, and it
 	  was missing from a qtruby instance, it caused ruby to loop,
-	  rather than report the method as missing. Thanks to Daniel 
+	  rather than report the method as missing. Thanks to Daniel
 	  Brumbaugh Keeney for reporting the bug.
 
 2008-03-04  Richard Dale  <richard.j.dale at gmail.com>
 
-	* Make symbolic links to rbqtapi as rbqt3api, rbqt4api, rbkdeapi 
+	* Make symbolic links to rbqtapi as rbqt3api, rbqt4api, rbkdeapi
 	  and rbkde4api
 
 2008-03-03  Richard Dale  <richard.j.dale at gmail.com>
@@ -796,7 +801,7 @@ value
 
 	* Fixed a regression introduced when slots were made directly
 callable.
-	  It broke the code to invoke remote QtDBus methods because the 
+	  It broke the code to invoke remote QtDBus methods because the
 	  remote methods become slots in the QMetaObject of the
 QDBusInterface
 	  being used as a proxy. The code was trying to invoke those slots
@@ -834,7 +839,7 @@ on
 2007-09-07  Richard Dale  <rdale at foton.es>
 
 	* Added a kross2qtruby method from Cyrille Berger to convert from a
-kross 
+kross
 	  instance to a qtruby instance
 	* Fixed bug in overloaded method resolution where a quint32 was being
 given
@@ -853,7 +858,7 @@ for
 	* Fixed an error in the QGraphicsPixmapItem class which made it
 impossible
 	  to instantiate
-	* Building QtRuby against Qt 4.2 failed because of a reference to 
+	* Building QtRuby against Qt 4.2 failed because of a reference to
 	  the Qt 4.3 QMdiSubWindow class not being #ifdef'd correctly. Thanks
 to
 	  mhlmi on #qtruby irc for reporting these two bugs.
@@ -901,7 +906,7 @@ QXmlStream*
 
 2007-03-17  Richard Dale  <rdale at foton.es>
 
-	* The code to allow the type() method to be used for Qt::GraphicsItem 
+	* The code to allow the type() method to be used for Qt::GraphicsItem
 	  classes had the wrong names for the classes
 	* Improved the resolution of QGraphicsItem classes in
 resolve_classname()
@@ -920,25 +925,25 @@ malloc'd
 with the
 	  small number of methods that 'took ownership' of the string and
 expected
-	  it to stay around after the method call. However, it introduces a 
+	  it to stay around after the method call. However, it introduces a
 	  memory leak for the 95% of methods that don't need it, and also
 means
-	  that if the 'char *' is changed during the method call, the changes 
+	  that if the 'char *' is changed during the method call, the changes
 	  aren't reflected in the ruby string. Thanks to Jan Wedekind for the
-	  discussion leading up to changing the code. Any methods where this 
+	  discussion leading up to changing the code. Any methods where this
 	  behaviour is wrong will now need to be special cased.
 
 2007-03-06  Richard Dale  <rdale at foton.es>
 
 	* Call rb_gc_mark() on the internalPointer VALUE within a
-Qt::ModelIndex 
+Qt::ModelIndex
 	  to prevent it being GC'd too early
 	* Added 'double&' and 'double*' marshallers
 	* Fixed memory leak when creating new Qt::ModelIndexes
 
 2007-02-27  Richard Dale  <rdale at foton.es>
 
-	* Added marshallers for QwtArray<double> and QwtArray<int> 
+	* Added marshallers for QwtArray<double> and QwtArray<int>
 	  (ie QVector<int>)
 	* Added a fix from Knut Franke to make the QVector<double> marshaller
 	  work with any sort of Ruby number. Thanks Knut..
@@ -954,14 +959,14 @@ Qt::ModelIndex
 DateTimes.
 	  Qt::Dates, Qt::Times and Qt::DateTimes can also be constructed from
 	  their ruby equivalents as a single arg. This makes it easier to
-	  integrate Qt::AbstractItemModels with Rails ActiveRecord and 
+	  integrate Qt::AbstractItemModels with Rails ActiveRecord and
 	  ActiveResource
 
 2007-02-17  Richard Dale  <rdale at foton.es>
 
 	* If a new Ruby class is created for a custom C++ QObject derived
 class,
-	  then create Ruby constants in the class for any enums defined via 
+	  then create Ruby constants in the class for any enums defined via
 	  Q_ENUMS which are in the same scope as the new class. For instance:
 
 		class TestObject : public QObject
@@ -1035,7 +1040,7 @@ Qt::DBusVariant
 	* QtRuby was crashing in virtual method callbacks with a memory
 corruption
 	  problem. The stack of ruby VALUES for the arguments to the callback
-is 
+is
 	  now allocated via ALLOCA_N, rather than calloc which cures the
 crashes.
 	* Changed tabs to spaces in the pixelator example
@@ -1052,11 +1057,11 @@ camel
 
 	* Added the painting/fontsampler example
 	* There is no way to distinguish between the two constructors:
-	 	 QTreeWidgetItem (const QTreeWidgetItem & other) 
-		 QTreeWidgetItem (QTreeWidgetItem * parent, const QStringList & 
+	 	 QTreeWidgetItem (const QTreeWidgetItem & other)
+		 QTreeWidgetItem (QTreeWidgetItem * parent, const QStringList &
            strings, int type = Type)
 	  when the latter has a single argument. So force the second variant
-to 
+to
       be called
 	* Added the desktop/screenshot example
 	* Added the desktop/systray example
@@ -1070,7 +1075,7 @@ image
 	  from another. This is because the C++ QImage::operator=(const
 QImage&)
 	  method isn't easily called from QtRuby
-	* Fixed do_method_missing() so that 'operator=' methods don't get 
+	* Fixed do_method_missing() so that 'operator=' methods don't get
 	  transformed into setOperator() methods
 
 2006-12-12  Richard Dale  <rdale at foton.es>
@@ -1118,7 +1123,7 @@ qVariantFromValue
 2006-11-30  Richard Dale  <rdale at foton.es>
 
 	* The Qt::KeySequence constructor wasn't working when passed a
-	  Qt::Key enum type and it needed to be cast to an Integer via 
+	  Qt::Key enum type and it needed to be cast to an Integer via
 	  a to_i() call.
 	* When a Qt::DBusInterface.call() method was invoked without using
 	  the call() method, but by calling the method directly, and the
@@ -1127,7 +1132,7 @@ method
 	  value was converted to nil.
 	* Fixed some errors in the mainwindows/mdi example, thanks to shirk
 	  and |Vargas| for pointing them out.
-	  
+
 2006-11-23  Richard Dale  <rdale at foton.es>
 
 	* Made Qt::TreeWidgetItem and Qt::TreeWidget Enumerable
@@ -1136,7 +1141,7 @@ method
 	* Added inspect() and pretty_print() methods to Qt::TreeWidgetItem,
 	  Qt::ListWidgetItem and Qt::TableWidgetItem
 	* Removed instructions for creating a 'rubyw' executable in Mac OS X
-	  as it isn't needed anymore with Qt 4.x. Thanks to Hans Fugal for 
+	  as it isn't needed anymore with Qt 4.x. Thanks to Hans Fugal for
 	  pointing that out.
 
 2006-11-21  Richard Dale  <rdale at foton.es>
@@ -1212,7 +1217,7 @@ QGradiantStops
 
 2006-10-05  Richard Dale  <rdale at foton.es>
 
-	* Each rbuic generated class is now wrapped in a Ui module so that as 
+	* Each rbuic generated class is now wrapped in a Ui module so that as
 	  well as class 'Ui_Foobar' there is a 'Ui::Foobar' version.
 
 	* Added the QtDBus chat example
@@ -1230,7 +1235,7 @@ passed
 2006-10-03  Richard Dale  <rdale at foton.es>
 
 	* Added ruby implementations of
-Qt::DBusConnectionInterface.serviceOwner(), 
+Qt::DBusConnectionInterface.serviceOwner(),
 	  registeredServiceNames(), isServiceRegistered(), servicePid(),
 serviceUid()
 	  and startService()
@@ -1260,11 +1265,11 @@ like
 
 		app = Qt::Application.new(ARGV)
 		bus = Qt::DBusConnection.sessionBus()
-		proxy = Qt::DBusInterface.new(  "org.freedesktop.DBus", 
-		                                "/org/freedesktop/DBus", 
-		                                "org.freedesktop.DBus", 
+		proxy = Qt::DBusInterface.new(  "org.freedesktop.DBus",
+		                                "/org/freedesktop/DBus",
+		                                "org.freedesktop.DBus",
 		                                bus )
-		
+
 		result = proxy.ListNames()
 
 		# result is
@@ -1277,7 +1282,7 @@ the one for 'String'
 2006-10-01  Richard Dale  <rdale at foton.es>
 
 	* The Qt::DBusMessage.type method now works. Fixes problem reported
-by 
+by
 	  Peter Rullmann.
 
 2006-09-28  Richard Dale  <rdale at foton.es>
@@ -1306,7 +1311,7 @@ installed
 	* Renamed 'qtruby.rb' as qtruby4.rb, and qtruby.so as qtruby4.so
 
 	* Qt4.rb and Qt3.rb files are installed to allow either Qt3 or
-	  Qt4 versions of QtRuby to be used with require 'Qt4' or 
+	  Qt4 versions of QtRuby to be used with require 'Qt4' or
 	  require 'Qt3' statements
 
 	* A Qt.rb symbolic link is created by the install so that by default
@@ -1344,7 +1349,7 @@ channel.
 
 	* Blocks can now be used as slots in Qt::Object.connect() calls.
 There are two
-	  versions, a singleton method and an instance method. 
+	  versions, a singleton method and an instance method.
 
 	* Here is an example of the class method connect() call with a block
 as a target:
@@ -1355,7 +1360,7 @@ as a target:
 clicked' }
 
 	  The block is executed in the context of the target instance, 'app'
-in this 
+in this
 	  case.
 
 	* And the instance method form:
@@ -1368,7 +1373,7 @@ in this
 			...
 
 	  The block is executed in the context of self - the instance making
-the 
+the
 	  connect() call.
 
 	* The Rails version of the Ruby 1.9 method Object#instance_exec was
@@ -1429,14 +1434,14 @@ fix
 2006-07-18  Richard Dale  <rdale at foton.es>
 
 	* The code to change a Ruby 'foo?' method call to a Qt C++ 'setFoo()'
-was 
+was
 	  using QStrings to change the text. However, it then converted the
 result
-	  to a QByteArray via toLatin() and referenced the contents of the 
+	  to a QByteArray via toLatin() and referenced the contents of the
 	  QByteArray via a 'const char *' cast when the QByteArray had gone
 out of
 	  scope and had been deleted. Thanks to Carlto Wang again for
-reporting 
+reporting
       this bug.
 
 	* Some of the code for debug logging of garbage collection wrote
@@ -1490,7 +1495,7 @@ using
 
 2006-06-26  Richard Dale  <rdale at foton.es>
 
-	* Applied a fix from Cvetoslav Ludmiloff to make 
+	* Applied a fix from Cvetoslav Ludmiloff to make
 	  Qt::AbstractItemModel.createIndex() work without conversion errrors
 	  for large Ruby BigNum values.
 
@@ -1516,7 +1521,7 @@ Qt::UiBuilder
 		class Foo < Qt::PushButton
 			slots 'int greeting(QString)'
 			signals 'int doit(QString)'
-		
+
 			def initialize
 				super
 				connect(self, SIGNAL('doit(QString)'), self,
@@ -1529,7 +1534,7 @@ QListWidgetItem
 
 2006-06-07  Richard Dale  <rdale at foton.es>
 
-	* qt_metacall() was returning an incorrect value when called with, 
+	* qt_metacall() was returning an incorrect value when called with,
 	  Ruby slots. This doesn't normally matter, but was causing D-BUS
 	  slot invocations via qt-dbus to fail.
 
@@ -1580,7 +1585,7 @@ an
 	  than staying as a Qt::ByteArray:
 
         block = Qt::ByteArray.new
-    
+
         if comment
             block += "/*\n"
             block += "    " + header + "\n"
@@ -1596,7 +1601,7 @@ causing
 	  a crash.
 	* A list of properties is now returned via
 Qt::MetaObject.propertyNames
-	  for a Qt::Object with properties for the inspect and pretty_print 
+	  for a Qt::Object with properties for the inspect and pretty_print
 	  methods.
 	* Fixed a pile of errors in the itemviews/chart example
 	* Added Qt::ItemSelection.at, [], count and length methods
@@ -1605,7 +1610,7 @@ Qt::MetaObject.propertyNames
 
 	* When an unknown C++ class is found, a corresponding Ruby class is
 now
-	  created. For instance, if a KPresenter KPart is loaded, a 
+	  created. For instance, if a KPresenter KPart is loaded, a
 	  KDE::PresenterDoc class is created.
 	* It is now possible to set and get properties without needing to use
 	  Qt::Object.property() and Qt::Object.setProperty(). For instance:
@@ -1666,7 +1671,7 @@ property
     * Fixed bug where qtruby failed to link on some machines
 	  such as Windows, where the 'char' type defaults to
 	  unsigned, so define them as 'signed char' instead.
- 
+
 2006-04-17  Richard Dale  <rdale at foton.es>
 
 	* Added the network/ftp, broadcastreceiver and broadcastsender
@@ -1686,7 +1691,7 @@ is now split
 
 	* Added xml/saxbookmarks, xml/dombookmarks and widgets/tooltips
 examples
-	* Improved garbage collection marking, Children QTreeWidgets and 
+	* Improved garbage collection marking, Children QTreeWidgets and
 	  QListWidgets are now marked. QObject tree instances are only marked
 	  starting at an instance which has no parent to improved efficiency,
 	  otherwise the same sub trees would be marked several times as a
@@ -1742,7 +1747,7 @@ line
 	* The marshaller for QList<QImageTextKeyLang> was defined wrongly.
 
 2006-04-05  Richard Dale  <rdale at foton.es>
-	
+
 	* Added the itemviews/puzzle example
 	* Added a QModelIndexList marshaller
 	* Added inspect and pretty_print methods for Qt::ModelIndex
@@ -1763,7 +1768,7 @@ line
 	* Added the itemviews/simpledommodel and itemviews/simpletreemodel
 	  examples
 
-	* Special cased the Qt::AbstractItemModel.createIndex() and 
+	* Special cased the Qt::AbstractItemModel.createIndex() and
 	  Qt::ModelIndex.internalPointer() methods so they can save
 	  and restore Ruby VALUE instances.
 
@@ -1782,7 +1787,7 @@ methods, so special case
 	  the overload method resolution for now..
 
 2006-04-03  Richard Dale  <rdale at foton.es>
-	
+
 	* The models used for QTableView and QListView are the private
 classes
 	  QTableModel and QListModel. They are accessed as
@@ -1810,7 +1815,7 @@ called
 	* Added various explicit calls to method_missing() for methods which
 	  are defined in Kernel and Object, such
 as 'exec', 'select', 'format'
-	  etc. Otherwise, the corresponding methods in the Smoke library were 
+	  etc. Otherwise, the corresponding methods in the Smoke library were
 	  not being invoked correctly.
 	* Removed a virtual destructor compile warning
 	* Removed obsolete qtruby-only.patch and kdevelop project file
@@ -1835,16 +1840,16 @@ Array
 2006-02-20  Richard Dale  <rdale at foton.es>
 
 	* After a const value based list such as QVector<QPointF> was passed
-	  to a C++ method, the correspoding Ruby Array was being updating 
+	  to a C++ method, the correspoding Ruby Array was being updating
 	  with the values when it didn't need to be. There is also a bug
 which
 	  meant the the values in the Ruby Array were being set to nil. That
 	  bug still isn't fixed. Partly fixes bug reported by akincisor on
 the
 	  #qtruby irc channel.
-	 
+
 2006-02-16  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
-	
+
 	* In Qt4 when the type signature of a slot or signal argument type is
 	  normalized, any '&' character for a reference type is removed,
 along
@@ -1869,8 +1874,8 @@ widgets/wiggly
 
 2005-12-16  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* The logger_backend() function has been removed and replaced with 
-	  qWarning() calls. This was because of problems with getting the 
+	* The logger_backend() function has been removed and replaced with
+	  qWarning() calls. This was because of problems with getting the
 	  logger_backend() code to work on Windows.
 
 2005-12-08  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -1920,18 +1925,18 @@ Chan-Nui.
 2005-10-05  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* Added network/fortuneserver and fortuneclient examples
-	* The Qt::ByteArray class is now a normal Smoke class, 
+	* The Qt::ByteArray class is now a normal Smoke class,
 	  rather than a special case, as it's easier to make a
 	  Qt::ByteArray look like a ruby String, than the other way
 	  round.
-	* The overloaded method resolution for enum arg types has been 
+	* The overloaded method resolution for enum arg types has been
 	  improved
 	* Added missing relational operators to Qt::Integer
 	* Fixed bug in marshalling unsigned shorts
 
 2005-10-03  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* Ported the RuBoids OpenGL artificial life example to Qt4 and 
+	* Ported the RuBoids OpenGL artificial life example to Qt4 and
 	  added opengl/grabber
 
 2005-10-01  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -1977,7 +1982,7 @@ Chan-Nui.
 
 2005-09-01  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* Added draganddrop/draggabletext, draggableicons, fridgemagnets, 
+	* Added draganddrop/draggabletext, draggableicons, fridgemagnets,
 	  puzzle examples.
 	* Added itemviews/dirview, chart and pixelator Qt4 examples.
 	* Fixed bug in QtByteArray marshalling where an underlying QByteArray
@@ -1995,9 +2000,9 @@ in the
 
 2005-08-24  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* Added dialogs examples; complexwizard, extension,  findfiles,  
+	* Added dialogs examples; complexwizard, extension,  findfiles,
 	  simplewizard,  standarddialogs and  tabdialog
-	* Changed the types of Qt3 long longs and other Q_* types to the 
+	* Changed the types of Qt3 long longs and other Q_* types to the
 	  Qt4 equivalents
 
 2005-08-24  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2009,13 +2014,13 @@ in the
 
 2005-08-23  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* Fixed some code to obtain a Qt::Object's properties for Qt4. Added 
+	* Fixed some code to obtain a Qt::Object's properties for Qt4. Added
 	  property inspecting code for the new QPointF, QRectF etc types
 	* Fixed a missing attr accessor bug in Qt::Enum
 	* Added the sliders, spinboxes and tetrix code examples
 
 2005-08-22  Caleb Tennis <caleb at aei-tech.com>
-        * Started a migration to more template based classes. 
+        * Started a migration to more template based classes.
 Hopefully this is
           just a start, but this *should* reduce redundant code by
 making use of
@@ -2069,8 +2074,8 @@ iterator
 
 	* Add findChild and findChildren methods which attempt to mimic their
 Qt::Object
-          counterparts.  Unit tests included.  e.g.:   
-            object.findChildren(Qt::Widget) 
+          counterparts.  Unit tests included.  e.g.:
+            object.findChildren(Qt::Widget)
             object.findChildren(Qt::Object, "ObjectName")
             object.findChildren(Qt::Object, /SomeName*/)
 
@@ -2090,7 +2095,7 @@ create
         * Modified new_qobject to only add method definitions if the
 kclass
           doesn't respond_to qt_metacall (was a TODO item).
- 
+
         * Prefer using Ruby's ALLOCA_N over calloc in new_qt
 
 2005-08-19  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2120,7 +2125,7 @@ exception
 
 2005-08-17  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* Left some debugging code in. qt_metacall() was not being called 
+	* Left some debugging code in. qt_metacall() was not being called
 	  correctly for non-ruby C++ slots.
 
 2005-08-17  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2139,10 +2144,10 @@ the same way as
 	  before.
 
 2005-08-09  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
-	
+
 	* Caleb Tennis wrote:
 	  One nice feature would be to allow Qt::Object::inherits() to use
-the QtRuby 
+the QtRuby
 	  naming scheme for valid lookups.  For example, right now:
 
 	    irb(main):001:0> w = Qt::Widget.new(nil)
@@ -2173,9 +2178,9 @@ Trolltech's permission,
 2005-07-15  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* Qt::Socket started working correctly when I and regenerated and
-rebuilt 
-	  my Smoke library. Before then it was calling the wrong version of 
-	  QSocket::at() for some reason, and wasn't discarding bytes that had 
+rebuilt
+	  my Smoke library. Before then it was calling the wrong version of
+	  QSocket::at() for some reason, and wasn't discarding bytes that had
 	  already been read.
 	* Removed comment from the client.rb example about
 Qt::Socket.canReadLine
@@ -2198,7 +2203,7 @@ reported
 	* When a Qt method returned a QString value type, such as:
 	       QString QSocket::readLine()
 	  A temporary QString was being created that wasn't deleted and
-caused a 
+caused a
 	  memory leak. Fixes problem reported by Caleb Tennis.
 
 2005-06-28  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2208,14 +2213,14 @@ caused a
 command
 	  shows the type of the underlying C++ enum:
 
-	  (rdb:1) p AlignTop 
+	  (rdb:1) p AlignTop
 	  16
 
-	  (rdb:1) pp AlignTop 
+	  (rdb:1) pp AlignTop
 	  #<Qt::Enum:0x1825db68 @type=Qt::AlignmentFlags, @value=16>
 
 2005-06-04  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
-	
+
 	* Upped the version to 1.0.10
 
 2005-06-04  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2241,7 +2246,7 @@ have
 2005-05-28  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* Added support for the QScintilla text editing widget, including an
-optional 
+optional
 	   '--enable-qscintilla=yes' configure option. The QScintilla classes
 are included in a
 	  Qext:: namespace. Thanks to Blackshack for the idea and configure
@@ -2369,7 +2374,7 @@ runtime
 2005-01-27  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* Made some changes to get code generated by the rbkconfig_compiler
-	  to work. When an argument is a non-const reference to a primitive 
+	  to work. When an argument is a non-const reference to a primitive
 	  type, or a QString or QStringList, then don't delete it after the
 	  method call. This is because a class like KConfigSkeleton takes
 	  references, and then 'squirrels them away' - before the references
@@ -2409,7 +2414,7 @@ Constructors for nested
 
 	* Added a Qt::Integer.coerce method so that Qt::Integers and
 Qt::Enums can be
-	  combined in arithmetic expressions with ruby Integers. 
+	  combined in arithmetic expressions with ruby Integers.
 
 2005-01-04  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
@@ -2423,15 +2428,15 @@ properties
 2004-12-30  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* Fixed an interesting bug reported by Stephan Oehlert. Kernel has a
-method called 
+method called
 	  open() which takes a String as the first argument. But when a call
-is made to an open() 
+is made to an open()
 	  method in the Qt classes, it messes up the method_missing() logic
-to divert it to the 
+to divert it to the
 	  Smoke library. Instead it attempts to call the Kernel method with
 the wrong arg types.
 
-	* The problem is fixed by calling the appropriate method based on the 
+	* The problem is fixed by calling the appropriate method based on the
 	  type of the first arg. However, it is no longer possible to
 override virtual methods
 	  called 'open'.
@@ -2462,7 +2467,7 @@ Before a callcc() call
 	  had been used for the jumping which worked fine. However, it made
 the frame stack
 	  look strange when debugging code with the KDevelop debugger. The
-fix is to use 
+fix is to use
 	  catch and throw instead, as they leave the stack in a more normal
 looking state.
 
@@ -2471,7 +2476,7 @@ looking state.
 	* Added a work round for a bug caused by an incompatibility between
 QtRuby
 	  the 'require time' statement, reported by David Crosby
-	
+
 	CCMAIL: dcrosby42 at gmail.com
 
 2004-12-18  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2479,9 +2484,9 @@ QtRuby
 	* Added a 'receivers' property to the Qt::Object inspector. This
 allows the active signal
 	  connections for a Qt::Object instance to be viewed in the KDevelop
-debugger as a 
+debugger as a
 	  Hash. The hash keys are the signal names, and the hash values are
-arrays of the target 
+arrays of the target
 	  signals/slots as Qt::Connection instances.
 
 2004-12-17  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2531,7 +2536,7 @@ instance
  * Greatly improved the Qt::Object Qt property based inspect() and
 pretty_print()
    methods. Property types such as Qt::Point, Qt::Font and Qt::Rect
-can be 
+can be
    viewed as expandable items in the KDevelop debugger variable tree.
 
 2004-12-09  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2540,13 +2545,13 @@ can be
 improve debugging -
    Qt::Color, Qt::Font, Qt::Point, Qt::Rect, Qt::Size, Qt::Date,
 Qt::DateTime and Qt::Time
-   
+
 2004-12-08  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
  * Added inspect() and pretty_print() methods for Qt::Objects that get
 the QObject properties and
    show them as 'name=value' pairs. This means the KDevelop debugger
-can make Qt::Object 
+can make Qt::Object
    variables expandable and show their properties.
 
 2004-11-29  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2601,11 +2606,11 @@ of it causing a seg fault.
  * If the smokeruby_mark() function was called for an instance of a
 QObject, it should
    mark all the instances below it in the QObject tree, as not needing
-garbage collection. 
+garbage collection.
    However, if a node in the tree didn't have a mapping onto a ruby
-instance the marking 
+instance the marking
    process stopped there, even though the grandchildren and their
-descendants might 
+descendants might
    have a valid mapping onto ruby instances.
  * The solution is to always traverse the entire tree. Fixes problem
 reported by Han Holl.
@@ -2619,7 +2624,7 @@ rb_gc_mark() to
    prevent them being garbage collected
  * The top level widgets are no longer disposed() on Qt::Application
 exit
- * Fixed some bugs in the chart example. 
+ * Fixed some bugs in the chart example.
 
 2004-10-13  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
@@ -2638,7 +2643,7 @@ enums can be compared with
 2004-10-12  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
  * Added Qt::Application.ARGV. It returns the original ruby ARGV array
-with Qt command line 
+with Qt command line
    options removed.
 
 2004-10-11  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2646,7 +2651,7 @@ with Qt command line
  * Added a global flag 'application_terminated'. Once this is set the
 QtRuby runtime will no longer
    delete any C++ instances. This will hopefully fix crash on
-application exit problems reported 
+application exit problems reported
    by Thibauld Favre.
 
  CCMAIL: kde-bindings at kde.org
@@ -2676,7 +2681,7 @@ an integer
                             100
                         end
                      end
- 
+
    Now gives the following error:
 
                qsize.rb:12:in `method_missing': Invalid type,
@@ -2727,7 +2732,7 @@ Qt::MainWindow need to clean up.
  * The layout of the ruby code generated by rbuic has been improved
 with better indenting.
  * attr_reader attribute accessors have been added for the most
-important instance variables 
+important instance variables
    in an rbuic generated class to make them more easily accessed from
 another class.
 
@@ -2739,7 +2744,7 @@ runtime uses the
 the resolution
    of the name. However, the numeric classId into the array of
 classnames in the Smoke
-   runtime was not being updated in line with the more accurate name. 
+   runtime was not being updated in line with the more accurate name.
  * This caused problems with method argument matching which uses the
 numeric classId
    rather than the ruby object's classname, and so QtRuby wrongly
@@ -2762,7 +2767,7 @@ all the ruby
    instances are garbage collected. The problem is that this is done
 in an arbitrary
    order, and Qt::Application was occasionally crashing in its
-destructor because 
+destructor because
    QMetaObject info it still needed was being deleted before then.
 
  * Fixes problem reported by Thibauld Favre
@@ -2801,7 +2806,7 @@ a crash;
    instead of throwing a ruby exception when a programming error is
 made.
    If there is only one method found in the Smoke runtime, it assumes
-that it must 
+that it must
    be the right one and just takes that.
 
  * For example:
@@ -2927,9 +2932,9 @@ following
    character is capitalised. For example, either of these two forms
 can be used
    to call the same method:
-  
+
      create_standard_status_bar_action()
-  
+
      createStandardStatusBarAction()
 
 2004-08-23  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -2973,7 +2978,7 @@ class
    had virtual method callbacks, this meant that the ruby instance
 couldn't
    be found, and the callback couldn't be made.
- 
+
  * Hence, the Qt::ToolTip callback in examples/qt-examples/tooltip
 didn't
    work, as that class doesn't have a virtual destructor.
@@ -2989,7 +2994,7 @@ matching
  * Qt::Enums and Qt::Integers can be marshalled to uints, longs and
 ulongs as
    well as ints.
-   
+
  * Added a '==' operator to Qt::Enums so they can be compared with
 ruby Integers
 
@@ -3006,13 +3011,13 @@ Integer
    type. When they were nested, the Integer didn't know how to convert
 the
    Enum it was being or'd with to an Integer.
- 
+
  * The solution is to add bit operators to the Enum class which return
 Enums
    rather than Integers.
 
  * The following code didn't work:
-     
+
      def initialize(message)
          super(nil, "passivedlg",
                  Qt::WStyle_Customize | Qt::WX11BypassWM |
@@ -3028,14 +3033,14 @@ Qt::WStyle_StaysOnTop |
  * The Qt::Enum class was missing bit operations, so various bit
 methods
    were added to Qt::Enum's superclass, Qt::Integer.
- 
+
  * This was causing this line from examples/uimodules/uidialogs.rb to
 fail:
 
      dlg =   KDE::DialogBase.new(parent, "sample_dialog", false,
 caption,
                                         KDE::DialogBase::Ok |
-KDE::DialogBase::Cancel, 
+KDE::DialogBase::Cancel,
                                  KDE::DialogBase::Ok, true )
 
 2004-07-27  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -3049,7 +3054,7 @@ is
 	  now used when they can't be found in the Smoke library. Removed
 Alex's
 	  comment about the previous approach, now I agree this is the best
-way 
+way
 	  to show errors.
 
 	CCMAIL: me at lypanov.ne
@@ -3080,10 +3085,10 @@ give the
 	* For example, this incorrect line:
 
 	    color_group.setColor( ColorGroup::MyMissingConst, blue )
-	  
+
 	  Gives this error:
 
-	    splitter.rb:16:in `const_missing': unresolved constant 
+	    splitter.rb:16:in `const_missing': unresolved constant
 	        reference MyMissingConst (ArgumentError)
 
 	* Implements suggestion from Jeff on the kdebindings list
@@ -3129,7 +3134,7 @@ localised either.
 2004-07-11  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* Qt eucJP and Shift-JIS codecs used to support ruby $KCODE values
-of 's' 
+of 's'
 	  for SJIS and 'e' for EUC
 
 2004-07-08  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -3150,19 +3155,19 @@ friendly
 	  There is a similar problem for bool arg types as with ints, and the
 mutable
 	  Qt::Boolean class can be used like this:
-		
+
 	    # QFont getFont(bool * ok, const QFont&initial, QWidget* parent =
-0);		
-		
+0);
+
 	    ok = Qt::Boolean.new
 	    font = Qt::FontDialog.getFont(ok, Qt::Font.new("Helvetica
 [Cronyx]", 10), self)
-	    if !ok.nil? 
+	    if !ok.nil?
                 # font is set to the font the user selected
-	    else 
+	    else
                 # the user canceled the dialog
 	    end
-		
+
 	  Use 'nil?' to test the value returned in the Boolean
 	* Signal and slot type signatures are 'normalized' and any unwanted
 white space
@@ -3179,15 +3184,15 @@ when passed to a
 does get updated
 	  when passed as an argument. For example, this C++
 method 'findByFileContent()':
-		
+
 		# static Ptr findByFileContent( const QString &fileName, int
 *accuracy=0 );
 
 		acc = Qt::Integer.new(0)
         	fc = KDE::MimeType.findByFileContent("mimetype.rb", acc)
-		
+
 	  It supports the arithmetic operators, and so expressions such
-as 'acc + 3' 
+as 'acc + 3'
 	  will work.
 
 2004-07-02  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -3199,7 +3204,7 @@ as 'acc + 3'
 	* The internal findAllMethods() method now returns nil rather than an
 empty array
 	  if the given classid is greater than 'smoke->numClasses'.
-Otherwise, it wasn't 
+Otherwise, it wasn't
 	  possible to distinguish between a class with no methods, or
 reaching the end of
 	  the classes array.
@@ -3220,17 +3225,17 @@ garbage collection, and
 	    whether or not it has a parent. Use the dispose() and
 isDisposed() methods like
 	    this:
-		
-		item0.takeItem(item1)  
-		item0.insertItem(item1)  
-		
+
+		item0.takeItem(item1)
+		item0.insertItem(item1)
+
 		item2.dispose
 		if item2.isDisposed
 		    puts "item2 is disposed"
 		end
 
 	  - Fixes problem reported by Hans Fugel
-	
+
 2004-06-26  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* The marshalling TypeHandler function pointers are now looked up in
@@ -3295,7 +3300,7 @@ subclasses using rtti() calls
 
 	* When a mutable, non-const QString, int*, int&, bool* or bool& is
 passed
-	  to a method, the corresponding ruby value is now updated after the 
+	  to a method, the corresponding ruby value is now updated after the
 	  method call.
 	* Some f'ns are no longer static, so that the korundum extension can
 link
@@ -3309,7 +3314,7 @@ korundum
 2004-03-01  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* Fixed bugs in QCString, QString and QByteArray marshalling.
-	  - When a C++ method with a mutable, non-const QCString arg type 
+	  - When a C++ method with a mutable, non-const QCString arg type
 	    is called from ruby, the C++ arg value is copied back into the
 	    corresponding ruby arg VALUE after the call.
 	  - A pointer to a locally allocated QString was being returned,
@@ -3335,8 +3340,8 @@ korundum
 	  of 'Programming with Qt'
 	* Improved classname resolution via the Qt rtti mechanisms in
 	  QObject, QEvent and QCanvasItem. This fixed a problem in the
-	  KillerFilter example when a QMouseEvent was passed to the ruby 
-	  event handler, it was being instantiated as a ruby Qt::Event, 
+	  KillerFilter example when a QMouseEvent was passed to the ruby
+	  event handler, it was being instantiated as a ruby Qt::Event,
 	  rather than a Qt::MouseEvent.
 
 2003-11-11  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -3390,7 +3395,7 @@ QListView
 2003-10-27  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* The smokeruby_mark() f'n was completely wrong, as it is only called
-if 
+if
 	  the current object is already marked. So marking the current object
 	  doesn't make a lot of sense. Instead, if the instance is a kind of
 	  QObject then its childeren are marked.
@@ -3426,7 +3431,7 @@ form 'operator+=',
 	* Fixed serious random crash problem
 	  - qt_invoke() and qt_emit() were not calling super if a ruby signal
 or
-	    slot hadn't been found, which stopped C++ signals from working. 
+	    slot hadn't been found, which stopped C++ signals from working.
 	  - This prevented destroy() signals from invoking event filter list
 clean
 	    up when a QObject was deleted, leaving deleted instances in the
@@ -3453,7 +3458,7 @@ libsmokekde
 
 2003-10-08  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* Korundum KDE ruby extension 
+	* Korundum KDE ruby extension
 	  - made various changes so it can be linked against the QtRuby code
 
 2003-09-18  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -3494,9 +3499,9 @@ marshalling.
 
 2003-09-12  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* More passing blocks to constructors fun! You can now also pass 
+	* More passing blocks to constructors fun! You can now also pass
 	  an arg to the block, and it will be run in the context of the arg:
-		
+
 		w = MyWidget.new { |theWidget| theWidget.setCaption "foobar" }
 
 	I got this idea from the FXRuby bindings, from the ChangeLog:
@@ -3506,7 +3511,7 @@ marshalling.
 	Rich Kilmer for this suggestion."
 
 	If you don't pass an arg to the block, the block is run in the
-context 
+context
 	  of the new instance as before.
 
 	* Debugging left in handlers.cpp (must stop doing this)
@@ -3549,7 +3554,7 @@ works.
 2003-09-08  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
 	* The pointer_map is now a QPtrDict rather than a ruby Hash, and
-	  the entries are weak references. An implementation was tried 
+	  the entries are weak references. An implementation was tried
 	  using the ruby WeakRef class, but it didn't work because
 rb_gc_mark()
 	  didn't prevent them being garbage collected.
@@ -3564,7 +3569,7 @@ rb_gc_mark()
 rb_raise()
 	* Decided changing method calls like foobar? to isFoobar() not a good
 idea,
-	  as the Qt property could just as also be hasFoobar() or foobar() 
+	  as the Qt property could just as also be hasFoobar() or foobar()
 
 2003-09-06  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
@@ -3625,7 +3630,7 @@ the normal target class.
 
 2003-08-25  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
-	* Removed ugly _current_object global variable. 
+	* Removed ugly _current_object global variable.
           The current target object is now passed to the MethodCall
 constructor.
 
@@ -3674,7 +3679,7 @@ name)
 2003-08-12  Alexander Kellett   <lypanov at kde.org>
 
 	* Add several new marshalling types - QCanvasItemList for example,
-	  unfortuantely due to several improvements in Qt 3.2 these 
+	  unfortuantely due to several improvements in Qt 3.2 these
 	  improvements will not be seen when compiling against Qt 3.1.2
 
 2003-08-05  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
@@ -3715,9 +3720,9 @@ string
 
 2003-08-01  Alexander Kellett   <lypanov at kde.org>
 
-	* Slightly improve ease of debugging of qtruby programs 
+	* Slightly improve ease of debugging of qtruby programs
 	  which subclass Qt base classes by print out some useful
-	  debugging informationn when/if method_missing ever 
+	  debugging informationn when/if method_missing ever
 	  fails to find a matching function in the baseclass.
 
 2003-08-01  Alex Zepeda   <zipzippy at sonic.net>
diff --git a/src/Qt.cpp b/src/Qt.cpp
index d9de8e7..427415e 100644
--- a/src/Qt.cpp
+++ b/src/Qt.cpp
@@ -21,28 +21,28 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-#include <QtCore/qabstractitemmodel.h>			
+#include <QtCore/qabstractitemmodel.h>
 #include <QtCore/qglobal.h>
 #include <QtCore/qhash.h>
-#include <QtCore/qline.h>			
+#include <QtCore/qline.h>
 #include <QtCore/qmetaobject.h>
 #include <QtCore/qobject.h>
-#include <QtCore/qrect.h>			
+#include <QtCore/qrect.h>
 #include <QtCore/qregexp.h>
 #include <QtCore/qstring.h>
 #include <QtCore/qvariant.h>
 #include <QtGui/qapplication.h>
-#include <QtGui/qbitmap.h>			
-#include <QtGui/qcolor.h>			
+#include <QtGui/qbitmap.h>
+#include <QtGui/qcolor.h>
 #include <QtGui/qcursor.h>
-#include <QtGui/qfont.h>			
-#include <QtGui/qicon.h>			
+#include <QtGui/qfont.h>
+#include <QtGui/qicon.h>
 #include <QtGui/qitemselectionmodel.h>
-#include <QtGui/qpalette.h>			
-#include <QtGui/qpen.h>			
-#include <QtGui/qpixmap.h>			
-#include <QtGui/qpolygon.h>			
-#include <QtGui/qtextformat.h>			
+#include <QtGui/qpalette.h>
+#include <QtGui/qpen.h>
+#include <QtGui/qpixmap.h>
+#include <QtGui/qpolygon.h>
+#include <QtGui/qtextformat.h>
 #include <QtGui/qwidget.h>
 
 #ifdef QT_QTDBUS
@@ -114,7 +114,7 @@ QHash<Smoke::ModuleIndex, QByteArray*> IdToClassNameMap;
 
 Smoke::ModuleIndex _current_method;
 
-smokeruby_object * 
+smokeruby_object *
 alloc_smokeruby_object(bool allocated, Smoke * smoke, int classId, void * ptr)
 {
     smokeruby_object * o = ALLOC(smokeruby_object);
@@ -176,7 +176,7 @@ void unmapPointer(void *ptr, Smoke *smoke, Smoke::Index fromClassId, Smoke::Inde
 		lastptr = ptr;
 		if (pointer_map() && pointer_map()->contains(ptr)) {
 			VALUE obj_ptr = pointer_map()->operator[](ptr).value;
-		
+
 			if (do_debug & qtdb_gc) {
 				const char *className = smoke->classes[fromClassId].className;
 				qWarning("unmapPointer (%s*)%p -> %p size: %d", className, ptr, (void*)(&obj_ptr), pointer_map()->size() - 1);
@@ -212,12 +212,12 @@ void mapPointer(VALUE obj, smokeruby_object* o, void *ptr, Smoke *smoke, Smoke::
 
     if (ptr != lastptr) {
 		lastptr = ptr;
-        
+
 		if (do_debug & qtdb_gc) {
 			const char *className = smoke->classes[fromClassId].className;
 			qWarning("mapPointer (%s*)%p -> %p size: %d", className, ptr, (void*)obj, pointer_map()->size() + 1);
 		}
-        
+
         SmokeValue value(obj, o);
 		pointer_map()->insert(ptr, value);
     }
@@ -234,7 +234,7 @@ void mapPointer(VALUE obj, smokeruby_object* o, void *ptr, Smoke *smoke, Smoke::
 	for (Smoke::Index *i = smoke->inheritanceList + smoke->classes[toClassId].parents; *i; i++) {
 		mapPointer(obj, o, ptr, smoke, toClassId, *i, lastptr);
 	}
-	
+
 	return;
 }
 
@@ -282,7 +282,7 @@ Binding::callMethod(Smoke::Index method, void *ptr, Smoke::Stack args, bool /*is
 		if (meth.flags & Smoke::mf_const) {
 			signature += " const";
 		}
-		qWarning(	"module: %s virtual %p->%s::%s called", 
+		qWarning(	"module: %s virtual %p->%s::%s called",
 					smoke->moduleName(),
 					ptr,
 					smoke->classes[smoke->methods[method].classId].className,
@@ -315,7 +315,7 @@ Binding::className(Smoke::Index classId) {
 }
 
 /*
-	Converts a C++ value returned by a signal invocation to a Ruby 
+	Converts a C++ value returned by a signal invocation to a Ruby
 	reply type
 */
 class SignalReturnValue : public Marshall {
@@ -323,7 +323,7 @@ class SignalReturnValue : public Marshall {
     Smoke::Stack _stack;
 	VALUE * _result;
 public:
-	SignalReturnValue(void ** o, VALUE * result, QList<MocArgument*> replyType) 
+	SignalReturnValue(void ** o, VALUE * result, QList<MocArgument*> replyType)
 	{
 		_result = result;
 		_replyType = replyType;
@@ -333,25 +333,25 @@ public:
 		(*fn)(this);
     }
 
-    SmokeType type() { 
-		return _replyType[0]->st; 
+    SmokeType type() {
+		return _replyType[0]->st;
 	}
     Marshall::Action action() { return Marshall::ToVALUE; }
     Smoke::StackItem &item() { return _stack[0]; }
     VALUE * var() {
     	return _result;
     }
-	
-	void unsupported() 
+
+	void unsupported()
 	{
 		rb_raise(rb_eArgError, "Cannot handle '%s' as signal reply-type", type().name());
     }
 	Smoke *smoke() { return type().smoke(); }
-    
+
 	void next() {}
-    
+
 	bool cleanup() { return false; }
-	
+
 	~SignalReturnValue() {
 		delete[] _stack;
 	}
@@ -363,31 +363,31 @@ public:
 */
 EmitSignal::EmitSignal(QObject *obj, int id, int /*items*/, QList<MocArgument*> args, VALUE *sp, VALUE * result) : SigSlotBase(args),
     _obj(obj), _id(id)
-{ 
+{
 	_sp = sp;
 	_result = result;
 }
 
-Marshall::Action 
-EmitSignal::action() 
-{ 
-	return Marshall::FromVALUE; 
+Marshall::Action
+EmitSignal::action()
+{
+	return Marshall::FromVALUE;
 }
 
 Smoke::StackItem &
-EmitSignal::item() 
-{ 
-	return _stack[_cur]; 
+EmitSignal::item()
+{
+	return _stack[_cur];
 }
 
 const char *
-EmitSignal::mytype() 
-{ 
-	return "signal"; 
+EmitSignal::mytype()
+{
+	return "signal";
 }
 
-void 
-EmitSignal::emitSignal() 
+void
+EmitSignal::emitSignal()
 {
 	if (_called) return;
 	_called = true;
@@ -405,45 +405,45 @@ EmitSignal::emitSignal()
 	delete[] o;
 }
 
-void 
-EmitSignal::mainfunction() 
-{ 
-	emitSignal(); 
+void
+EmitSignal::mainfunction()
+{
+	emitSignal();
 }
 
-bool 
-EmitSignal::cleanup() 
-{ 
-	return true; 
+bool
+EmitSignal::cleanup()
+{
+	return true;
 }
 
 InvokeNativeSlot::InvokeNativeSlot(QObject *obj, int id, int /*items*/, QList<MocArgument*> args, VALUE *sp, VALUE * result) : SigSlotBase(args),
     _obj(obj), _id(id)
-{ 
+{
 	_sp = sp;
 	_result = result;
 }
 
-Marshall::Action 
-InvokeNativeSlot::action() 
-{ 
-	return Marshall::FromVALUE; 
+Marshall::Action
+InvokeNativeSlot::action()
+{
+	return Marshall::FromVALUE;
 }
 
 Smoke::StackItem &
-InvokeNativeSlot::item() 
-{ 
-	return _stack[_cur]; 
+InvokeNativeSlot::item()
+{
+	return _stack[_cur];
 }
 
 const char *
-InvokeNativeSlot::mytype() 
-{ 
-	return "slot"; 
+InvokeNativeSlot::mytype()
+{
+	return "slot";
 }
 
-void 
-InvokeNativeSlot::invokeSlot() 
+void
+InvokeNativeSlot::invokeSlot()
 {
 	if (_called) return;
 	_called = true;
@@ -454,28 +454,28 @@ InvokeNativeSlot::invokeSlot()
 	prepareReturnValue(o);
 
 	_obj->qt_metacall(QMetaObject::InvokeMetaMethod, _id, o);
-	
+
 	if (_args[0]->argType != xmoc_void) {
 		SignalReturnValue r(o, _result, _args);
 	}
 	delete[] o;
 }
 
-void 
-InvokeNativeSlot::mainfunction() 
-{ 
-	invokeSlot(); 
+void
+InvokeNativeSlot::mainfunction()
+{
+	invokeSlot();
 }
 
-bool 
-InvokeNativeSlot::cleanup() 
-{ 
-	return true; 
+bool
+InvokeNativeSlot::cleanup()
+{
+	return true;
 }
 
 }
 
-VALUE rb_str_catf(VALUE self, const char *format, ...) 
+VALUE qtruby_str_catf(VALUE self, const char *format, ...)
 {
 #define CAT_BUFFER_SIZE 2048
 static char p[CAT_BUFFER_SIZE];
@@ -524,7 +524,7 @@ findMethod(VALUE /*self*/, VALUE c_value, VALUE name_value)
     char *c = StringValuePtr(c_value);
     char *name = StringValuePtr(name_value);
     VALUE result = rb_ary_new();
-    Smoke::ModuleIndex classId = Smoke::findClass(c);    
+    Smoke::ModuleIndex classId = Smoke::findClass(c);
     Smoke::ModuleIndex meth = Smoke::NullModuleIndex;
     if (classId.smoke != 0) {
         meth = classId.smoke->findMethod(c, name);
@@ -685,7 +685,7 @@ findAllMethods(int argc, VALUE * argv, VALUE /*self*/)
 				rb_ary_push(result, rb_str_new2(s->methodNames[methodRef.name])); \
 			} \
 		}
- 
+
 VALUE
 findAllMethodNames(VALUE /*self*/, VALUE result, VALUE classid, VALUE flags_value)
 {
@@ -769,7 +769,7 @@ static QByteArray * mcid = 0;
 #ifdef DEBUG
 	if (do_debug & qtdb_calls) qWarning("method_missing mcid: %s", (const char *) *mcid);
 #endif
-	
+
 	if (rcid) {
 		// Got a hit
 #ifdef DEBUG
@@ -781,7 +781,7 @@ static QByteArray * mcid = 0;
 		_current_method.smoke = 0;
 		_current_method.index = -1;
 	}
-	
+
 	return mcid;
 }
 
@@ -798,31 +798,31 @@ static QByteArray * pred = 0;
 	if (pred == 0) {
 		pred = new QByteArray();
 	}
-	
+
 	*pred = methodName;
 	if (pred->endsWith("?")) {
 		smokeruby_object *o = value_obj_info(self);
 		if(!o || !o->ptr) {
 			return rb_call_super(argc, argv);
 		}
-		
+
 		// Drop the trailing '?'
 		pred->replace(pred->length() - 1, 1, "");
-		
+
 		pred->replace(0, 1, pred->mid(0, 1).toUpper());
 		pred->replace(0, 0, "is");
 		Smoke::ModuleIndex meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, (const char *) *pred);
-		
+
 		if (meth.index == 0) {
 			pred->replace(0, 2, "has");
 			meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, *pred);
 		}
-		
+
 		if (meth.index > 0) {
 			methodName = (char *) (const char *) *pred;
 		}
 	}
-		
+
 	VALUE * temp_stack = ALLOCA_N(VALUE, argc+3);
     temp_stack[0] = rb_str_new2("Qt");
     temp_stack[1] = rb_str_new2(methodName);
@@ -860,8 +860,8 @@ static QByteArray * pred = 0;
 					// Check for property getter/setter calls, and for slots in QObject classes
 					// not in the smoke library
 					smokeruby_object *o = value_obj_info(self);
-					if (	o != 0 
-							&& o->ptr != 0 
+					if (	o != 0
+							&& o->ptr != 0
 							&& Smoke::isDerivedFrom(Smoke::ModuleIndex(o->smoke, o->classId), Smoke::findClass("QObject")) )
 					{
 						QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
@@ -869,7 +869,7 @@ static QByteArray * name = 0;
 						if (name == 0) {
 							name = new QByteArray();
 						}
-						
+
 						*name = rb_id2name(SYM2ID(argv[0]));
 						const QMetaObject * meta = qobject->metaObject();
 
@@ -901,9 +901,9 @@ static QByteArray * name = 0;
 						// The class isn't in the Smoke lib. But if it is called 'local::Merged'
 						// it is from a QDBusInterface and the slots are remote, so don't try to
 						// those.
-						while (	classId == 0 
+						while (	classId == 0
 								&& qstrcmp(meta->className(), "local::Merged") != 0
-								&& qstrcmp(meta->superClass()->className(), "QDBusAbstractInterface") != 0 ) 
+								&& qstrcmp(meta->superClass()->className(), "QDBusAbstractInterface") != 0 )
 						{
 							// Assume the QObject has slots which aren't in the Smoke library, so try
 							// and call the slot directly
@@ -915,7 +915,7 @@ static QByteArray * name = 0;
 									// Don't check that the types of the ruby args match the c++ ones for now,
 									// only that the name and arg count is the same.
 									if (*name == methodName && meta->method(id).parameterTypes().count() == (argc - 1)) {
-										QList<MocArgument*> args = get_moc_arguments(	o->smoke, meta->method(id).typeName(), 
+										QList<MocArgument*> args = get_moc_arguments(	o->smoke, meta->method(id).typeName(),
 																						meta->method(id).parameterTypes() );
 										VALUE result = Qnil;
 										QtRuby::InvokeNativeSlot slot(qobject, id, argc - 1, args, argv + 1, &result);
@@ -928,7 +928,7 @@ static QByteArray * name = 0;
 							classId = o->smoke->idClass(meta->className()).index;
 						}
 					}
-					
+
 					return rb_call_super(argc, argv);
 				}
 			}
@@ -974,10 +974,10 @@ static QRegExp * rx = 0;
 		if (rx == 0) {
 			rx = new QRegExp("[a-zA-Z]+");
 		}
-		
+
 		if (rx->indexIn(methodName) == -1) {
 			// If an operator method hasn't been found as an instance method,
-			// then look for a class method - after 'op(self,a)' try 'self.op(a)' 
+			// then look for a class method - after 'op(self,a)' try 'self.op(a)'
 	    	VALUE * method_stack = ALLOCA_N(VALUE, argc - 1);
 	    	method_stack[0] = argv[0];
 	    	for (int count = 1; count < argc - 1; count++) {
@@ -1026,7 +1026,7 @@ static QRegExp * rx = 0;
 					typeId = smoke->idType(targetType.constData());
 				}
 
-				// This shouldn't be necessary because the type of the slot arg should always be in the 
+				// This shouldn't be necessary because the type of the slot arg should always be in the
 				// smoke module of the slot being invoked. However, that isn't true for a dataUpdated()
 				// slot in a PlasmaScripting::Applet
 				if (typeId == 0) {
@@ -1038,20 +1038,20 @@ static QRegExp * rx = 0;
 						if (typeId != 0) {
 							break;
 						}
-	
+
 						if (typeId == 0 && !name.contains('*')) {
 							if (!name.contains("&")) {
 								targetType += "&";
 							}
 
 							typeId = smoke->idType(targetType.constData());
-	
+
 							if (typeId != 0) {
 								break;
 							}
 						}
 					}
-				}			
+				}
 			} else if (staticType == "bool") {
 				arg->argType = xmoc_bool;
 				smoke = qtcore_Smoke;
@@ -1129,9 +1129,9 @@ qobject_metaobject(VALUE self)
 		return obj;
 	}
 
-	smokeruby_object  * m = alloc_smokeruby_object(	false, 
-													o->smoke, 
-													o->smoke->idClass("QMetaObject").index, 
+	smokeruby_object  * m = alloc_smokeruby_object(	false,
+													o->smoke,
+													o->smoke->idClass("QMetaObject").index,
 													meta );
 
 	obj = set_obj_info("Qt::MetaObject", m);
@@ -1155,8 +1155,8 @@ set_obj_info(const char * className, smokeruby_object * o)
 	}
 	// If the instance is a subclass of QObject, then check to see if the
 	// className from its QMetaObject is in the Smoke library. If not then
-	// create a Ruby class for it dynamically. Remove the first letter from 
-	// any class names beginning with 'Q' or 'K' and put them under the Qt:: 
+	// create a Ruby class for it dynamically. Remove the first letter from
+	// any class names beginning with 'Q' or 'K' and put them under the Qt::
 	// or KDE:: modules respectively.
 	if (o->smoke->isDerivedFrom(o->smoke, o->classId, o->smoke->idClass("QObject").smoke, o->smoke->idClass("QObject").index)) {
 		QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
@@ -1187,8 +1187,8 @@ set_obj_info(const char * className, smokeruby_object * o)
 					// add them
 					if (qstrcmp(meta->className(), meta->enumerator(id).scope()) == 0) {
 						for (int i = 0; i < meta->enumerator(id).keyCount(); i++) {
-							rb_define_const(	klass, 
-												meta->enumerator(id).key(i), 
+							rb_define_const(	klass,
+												meta->enumerator(id).key(i),
 												INT2NUM(meta->enumerator(id).value(i)) );
 						}
 					}
@@ -1196,7 +1196,7 @@ set_obj_info(const char * className, smokeruby_object * o)
 			}
 
 			// Add a Qt::Object.metaObject method which will do dynamic despatch on the
-			// metaObject() virtual method so that the true QMetaObject of the class 
+			// metaObject() virtual method so that the true QMetaObject of the class
 			// is returned, rather than for the one for the parent class that is in
 			// the Smoke library.
 			rb_define_method(klass, "metaObject", (VALUE (*) (...)) qobject_metaobject, 0);
@@ -1207,21 +1207,21 @@ set_obj_info(const char * className, smokeruby_object * o)
     return obj;
 }
 
-VALUE 
+VALUE
 kross2smoke(VALUE /*self*/, VALUE krobject, VALUE new_klass)
 {
   VALUE new_klassname = rb_funcall(new_klass, rb_intern("name"), 0);
-  
+
   Smoke::ModuleIndex * cast_to_id = classcache.value(StringValuePtr(new_klassname));
   if (cast_to_id == 0) {
     rb_raise(rb_eArgError, "unable to find class \"%s\" to cast to\n", StringValuePtr(new_klassname));
   }
-  
+
   void* o;
   Data_Get_Struct(krobject, void, o);
-  
+
   smokeruby_object * o_cast = alloc_smokeruby_object(false, cast_to_id->smoke, (int) cast_to_id->index, o);
-  
+
   VALUE obj = Data_Wrap_Struct(new_klass, smokeruby_mark, smokeruby_free, (void *) o_cast);
   mapPointer(obj, o_cast, o_cast->classId, 0);
   return obj;
@@ -1259,21 +1259,21 @@ value_to_type_flag(VALUE ruby_value)
     return r;
 }
 
-VALUE prettyPrintMethod(Smoke::Index id) 
+VALUE prettyPrintMethod(Smoke::Index id)
 {
     VALUE r = rb_str_new2("");
     const Smoke::Method &meth = qtcore_Smoke->methods[id];
     const char *tname = qtcore_Smoke->types[meth.ret].name;
-    if(meth.flags & Smoke::mf_static) rb_str_catf(r, "static ");
-    rb_str_catf(r, "%s ", (tname ? tname:"void"));
-    rb_str_catf(r, "%s::%s(", qtcore_Smoke->classes[meth.classId].className, qtcore_Smoke->methodNames[meth.name]);
+    if(meth.flags & Smoke::mf_static) qtruby_str_catf(r, "static ");
+    qtruby_str_catf(r, "%s ", (tname ? tname:"void"));
+    qtruby_str_catf(r, "%s::%s(", qtcore_Smoke->classes[meth.classId].className, qtcore_Smoke->methodNames[meth.name]);
     for(int i = 0; i < meth.numArgs; i++) {
-	if(i) rb_str_catf(r, ", ");
+	if(i) qtruby_str_catf(r, ", ");
 	tname = qtcore_Smoke->types[qtcore_Smoke->argumentList[meth.args+i]].name;
-	rb_str_catf(r, "%s", (tname ? tname:"void"));
+	qtruby_str_catf(r, "%s", (tname ? tname:"void"));
     }
-    rb_str_catf(r, ")");
-    if(meth.flags & Smoke::mf_const) rb_str_catf(r, " const");
+    qtruby_str_catf(r, ")");
+    if(meth.flags & Smoke::mf_const) qtruby_str_catf(r, " const");
     return r;
 }
 }
diff --git a/src/qtruby.cpp b/src/qtruby.cpp
index f83d903..f405ba5 100644
--- a/src/qtruby.cpp
+++ b/src/qtruby.cpp
@@ -15,28 +15,28 @@
  *                                                                         *
  ***************************************************************************/
 
-#include <QtCore/qabstractitemmodel.h>			
+#include <QtCore/qabstractitemmodel.h>
 #include <QtCore/qglobal.h>
 #include <QtCore/qhash.h>
-#include <QtCore/qline.h>			
+#include <QtCore/qline.h>
 #include <QtCore/qmetaobject.h>
 #include <QtCore/qobject.h>
-#include <QtCore/qrect.h>			
+#include <QtCore/qrect.h>
 #include <QtCore/qregexp.h>
 #include <QtCore/qstring.h>
 #include <QtCore/qvariant.h>
 #include <QtGui/qapplication.h>
-#include <QtGui/qbitmap.h>			
-#include <QtGui/qcolor.h>			
+#include <QtGui/qbitmap.h>
+#include <QtGui/qcolor.h>
 #include <QtGui/qcursor.h>
-#include <QtGui/qfont.h>			
-#include <QtGui/qicon.h>			
+#include <QtGui/qfont.h>
+#include <QtGui/qicon.h>
 #include <QtGui/qitemselectionmodel.h>
-#include <QtGui/qpalette.h>			
-#include <QtGui/qpen.h>			
-#include <QtGui/qpixmap.h>			
-#include <QtGui/qpolygon.h>			
-#include <QtGui/qtextformat.h>			
+#include <QtGui/qpalette.h>
+#include <QtGui/qpen.h>
+#include <QtGui/qpixmap.h>
+#include <QtGui/qpolygon.h>
+#include <QtGui/qtextformat.h>
 #include <QtGui/qwidget.h>
 
 #ifdef QT_QTDBUS
@@ -100,28 +100,28 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 		QMetaEnum e = property.enumerator();
 		return QString(" %1=%2::%3").arg(name).arg(e.scope()).arg(e.valueToKey(value.toInt()));
 	}
-	
+
 	switch (value.type()) {
 	case QVariant::String:
 	{
 		if (value.toString().isNull()) {
-			return QString(" %1=nil").arg(name); 
+			return QString(" %1=nil").arg(name);
 		} else {
 			return QString(" %1=%2").arg(name).arg(value.toString());
 		}
 	}
-		
+
 	case QVariant::Bool:
 	{
 		QString rubyName;
 		QRegExp name_re("^(is|has)(.)(.*)");
-		
+
 		if (name_re.indexIn(name) != -1) {
 			rubyName = name_re.cap(2).toLower() + name_re.cap(3) + "?";
 		} else {
 			rubyName = name;
 		}
-		
+
 		return QString(" %1=%2").arg(rubyName).arg(value.toString());
 	}
 
@@ -130,18 +130,18 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 		QColor c = value.value<QColor>();
 		return QString(" %1=#<Qt::Color:0x0 %2>").arg(name).arg(c.name());
 	}
-			
+
 	case QVariant::Cursor:
 	{
 		QCursor c = value.value<QCursor>();
 		return QString(" %1=#<Qt::Cursor:0x0 shape=%2>").arg(name).arg(c.shape());
 	}
-	
+
 	case QVariant::Double:
 	{
 		return QString(" %1=%2").arg(name).arg(value.toDouble());
 	}
-	
+
 	case QVariant::Font:
 	{
 		QFont f = value.value<QFont>();
@@ -155,7 +155,7 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 									.arg(f.underline() ? "true" : "false")
 									.arg(f.strikeOut() ? "true" : "false");
 	}
-	
+
 	case QVariant::Line:
 	{
 		QLine l = value.toLine();
@@ -166,7 +166,7 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 						.arg(l.x2())
 						.arg(l.y2());
 	}
-	
+
 	case QVariant::LineF:
 	{
 		QLineF l = value.toLineF();
@@ -177,19 +177,19 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 						.arg(l.x2())
 						.arg(l.y2());
 	}
-	
+
 	case QVariant::Point:
 	{
 		QPoint p = value.toPoint();
 		return QString(" %1=#<Qt::Point:0x0 x=%2, y=%3>").arg(name).arg(p.x()).arg(p.y());
 	}
-	
+
 	case QVariant::PointF:
 	{
 		QPointF p = value.toPointF();
 		return QString(" %1=#<Qt::PointF:0x0 x=%2, y=%3>").arg(name).arg(p.x()).arg(p.y());
 	}
-	
+
 	case QVariant::Rect:
 	{
 		QRect r = value.toRect();
@@ -197,7 +197,7 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 									.arg(name)
 									.arg(r.left()).arg(r.right()).arg(r.top()).arg(r.bottom());
 	}
-	
+
 	case QVariant::RectF:
 	{
 		QRectF r = value.toRectF();
@@ -205,23 +205,23 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 									.arg(name)
 									.arg(r.left()).arg(r.right()).arg(r.top()).arg(r.bottom());
 	}
-	
+
 	case QVariant::Size:
 	{
 		QSize s = value.toSize();
 		return QString(" %1=#<Qt::Size:0x0 width=%2, height=%3>")
-									.arg(name) 
+									.arg(name)
 									.arg(s.width()).arg(s.height());
 	}
-	
+
 	case QVariant::SizeF:
 	{
 		QSizeF s = value.toSizeF();
 		return QString(" %1=#<Qt::SizeF:0x0 width=%2, height=%3>")
-									.arg(name) 
+									.arg(name)
 									.arg(s.width()).arg(s.height());
 	}
-	
+
 	case QVariant::SizePolicy:
 	{
 		QSizePolicy s = value.value<QSizePolicy>();
@@ -230,7 +230,7 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 									.arg(s.horizontalPolicy())
 									.arg(s.verticalPolicy());
 	}
-	
+
 	case QVariant::Brush:
 //	case QVariant::ColorGroup:
 	case QVariant::Image:
@@ -240,7 +240,7 @@ inspectProperty(QMetaProperty property, const char * name, QVariant & value)
 	{
 		return QString(" %1=#<Qt::%2:0x0>").arg(name).arg(value.typeName() + 1);
 	}
-	
+
 	default:
 		return QString(" %1=%2").arg(name)
 									.arg((value.isNull() || value.toString().isNull()) ? "nil" : value.toString() );
@@ -258,31 +258,31 @@ inspect_qobject(VALUE self)
 	if (TYPE(self) != T_DATA) {
 		return Qnil;
 	}
-	
+
 	// Start with #<Qt::HBoxLayout:0x30139030> from the original inspect() call
 	// Drop the closing '>'
-	VALUE inspect_str = rb_call_super(0, 0);	
+	VALUE inspect_str = rb_call_super(0, 0);
 	rb_str_resize(inspect_str, RSTRING_LEN(inspect_str) - 1);
-	
+
 	smokeruby_object * o = 0;
-    Data_Get_Struct(self, smokeruby_object, o);	
+    Data_Get_Struct(self, smokeruby_object, o);
 	QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
-	
+
 	QString value_list;
 	value_list.append(QString(" objectName=\"%1\"").arg(qobject->objectName()));
-	
+
 	if (qobject->isWidgetType()) {
 		QWidget * w = (QWidget *) qobject;
 		value_list.append(QString(", x=%1, y=%2, width=%3, height=%4")
 												.arg(w->x())
 												.arg(w->y())
 												.arg(w->width())
-												.arg(w->height()) ); 
+												.arg(w->height()) );
 	}
-		
+
 	value_list.append(">");
 	rb_str_cat2(inspect_str, value_list.toLatin1());
-	
+
 	return inspect_str;
 }
 
@@ -301,31 +301,31 @@ pretty_print_qobject(VALUE self, VALUE pp)
 	if (TYPE(self) != T_DATA) {
 		return Qnil;
 	}
-	
+
 	// Start with #<Qt::HBoxLayout:0x30139030>
 	// Drop the closing '>'
-	VALUE inspect_str = rb_funcall(self, rb_intern("to_s"), 0, 0);	
+	VALUE inspect_str = rb_funcall(self, rb_intern("to_s"), 0, 0);
 	rb_str_resize(inspect_str, RSTRING_LEN(inspect_str) - 1);
 	rb_funcall(pp, rb_intern("text"), 1, inspect_str);
 	rb_funcall(pp, rb_intern("breakable"), 0);
-	
+
 	smokeruby_object * o = 0;
-    Data_Get_Struct(self, smokeruby_object, o);	
+    Data_Get_Struct(self, smokeruby_object, o);
 	QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
-	
-	QString value_list;		
-	
+
+	QString value_list;
+
 	if (qobject->parent() != 0) {
 		QString parentInspectString;
 		VALUE obj = getPointerObject(qobject->parent());
 		if (obj != Qnil) {
-			VALUE parent_inspect_str = rb_funcall(obj, rb_intern("to_s"), 0, 0);	
+			VALUE parent_inspect_str = rb_funcall(obj, rb_intern("to_s"), 0, 0);
 			rb_str_resize(parent_inspect_str, RSTRING_LEN(parent_inspect_str) - 1);
 			parentInspectString = StringValuePtr(parent_inspect_str);
 		} else {
 			parentInspectString.sprintf("#<%s:0x0", qobject->parent()->metaObject()->className());
 		}
-		
+
 		if (qobject->parent()->isWidgetType()) {
 			QWidget * w = (QWidget *) qobject->parent();
 			value_list = QString("  parent=%1 objectName=\"%2\", x=%3, y=%4, width=%5, height=%6>,\n")
@@ -340,24 +340,24 @@ pretty_print_qobject(VALUE self, VALUE pp)
 												.arg(parentInspectString)
 												.arg(qobject->parent()->objectName());
 		}
-		
+
 		rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
 	}
-	
+
 	if (qobject->children().count() != 0) {
 		value_list = QString("  children=Array (%1 element(s)),\n")
 								.arg(qobject->children().count());
 		rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
 	}
-	
+
 	value_list = QString("  metaObject=#<Qt::MetaObject:0x0");
 	value_list.append(QString(" className=%1").arg(qobject->metaObject()->className()));
-	
+
 	if (qobject->metaObject()->superClass() != 0) {
 		value_list.append(	QString(", superClass=#<Qt::MetaObject:0x0 className=%1>")
 							.arg(qobject->metaObject()->superClass()->className()) );
-	}		
-	
+	}
+
 	value_list.append(">,\n");
 	rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.toLatin1()));
 
@@ -376,7 +376,7 @@ pretty_print_qobject(VALUE self, VALUE pp)
 	}
 
 	rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(">"));
-	
+
 	return self;
 }
 
@@ -463,9 +463,9 @@ qabstract_item_model_data(int argc, VALUE * argv, VALUE self)
 	}
 
 
-	smokeruby_object  * result = alloc_smokeruby_object(	true, 
-															o->smoke, 
-															o->smoke->findClass("QVariant").index, 
+	smokeruby_object  * result = alloc_smokeruby_object(	true,
+															o->smoke,
+															o->smoke->findClass("QVariant").index,
 															new QVariant(value) );
 	return set_obj_info("Qt::Variant", result);
 }
@@ -485,7 +485,7 @@ qabstract_item_model_setdata(int argc, VALUE * argv, VALUE self)
 	}
 
 	if (argc == 3) {
-		return (model->setData(	*modelIndex, 
+		return (model->setData(	*modelIndex,
 								*variant,
 								NUM2INT(rb_funcall(argv[2], rb_intern("to_i"), 0)) ) ? Qtrue : Qfalse);
 	}
@@ -617,7 +617,7 @@ qimage_scan_line(VALUE self, VALUE ix)
   return rb_str_new((const char *) bytes, image->bytesPerLine());
 }
 
-#ifdef QT_QTDBUS 
+#ifdef QT_QTDBUS
 static VALUE
 qdbusargument_endarraywrite(VALUE self)
 {
@@ -788,9 +788,9 @@ qabstractitemmodel_createindex(int argc, VALUE * argv, VALUE self)
 					stack[3].s_voidp = (void*) argv[2];
 				}
 				(*fn)(m.method, o->ptr, stack);
-				smokeruby_object  * result = alloc_smokeruby_object(	true, 
-																		o->smoke, 
-																		o->smoke->idClass("QModelIndex").index, 
+				smokeruby_object  * result = alloc_smokeruby_object(	true,
+																		o->smoke,
+																		o->smoke->idClass("QModelIndex").index,
 																		stack[0].s_voidp );
 
 				return set_obj_info("Qt::ModelIndex", result);
@@ -819,9 +819,9 @@ qitemselection_at(VALUE self, VALUE i)
 	QItemSelection * item = (QItemSelection *) o->ptr;
 	QItemSelectionRange range = item->at(NUM2INT(i));
 
-	smokeruby_object  * result = alloc_smokeruby_object(	true, 
-															o->smoke, 
-															o->smoke->idClass("QItemSelectionRange").index, 
+	smokeruby_object  * result = alloc_smokeruby_object(	true,
+															o->smoke,
+															o->smoke->idClass("QItemSelectionRange").index,
 															new QItemSelectionRange(range) );
 
 	return set_obj_info("Qt::ItemSelectionRange", result);
@@ -844,7 +844,7 @@ metaObject(VALUE self)
 
 /* This shouldn't be needed, but kalyptus doesn't generate a staticMetaObject
 	method for QObject::staticMetaObject, although it does for all the other
-	classes, and it isn't obvious what the problem with it is. 
+	classes, and it isn't obvious what the problem with it is.
 	So add this as a hack to work round the bug.
 */
 static VALUE
@@ -852,9 +852,9 @@ qobject_staticmetaobject(VALUE /*klass*/)
 {
 	QMetaObject * meta = new QMetaObject(QObject::staticMetaObject);
 
-	smokeruby_object  * m = alloc_smokeruby_object(	true, 
-													qtcore_Smoke, 
-													qtcore_Smoke->idClass("QMetaObject").index, 
+	smokeruby_object  * m = alloc_smokeruby_object(	true,
+													qtcore_Smoke,
+													qtcore_Smoke->idClass("QMetaObject").index,
 													meta );
 
 	VALUE obj = set_obj_info("Qt::MetaObject", m);
@@ -873,9 +873,9 @@ cast_object_to(VALUE /*self*/, VALUE object, VALUE new_klass)
 		rb_raise(rb_eArgError, "unable to find class \"%s\" to cast to\n", StringValuePtr(new_klassname));
 	}
 
-	smokeruby_object * o_cast = alloc_smokeruby_object(	o->allocated, 
-														cast_to_id->smoke, 
-														(int) cast_to_id->index, 
+	smokeruby_object * o_cast = alloc_smokeruby_object(	o->allocated,
+														cast_to_id->smoke,
+														(int) cast_to_id->index,
 														o->smoke->cast(o->ptr, o->classId, (int) cast_to_id->index) );
 
     VALUE obj = Data_Wrap_Struct(new_klass, smokeruby_mark, smokeruby_free, (void *) o_cast);
@@ -908,9 +908,9 @@ qobject_qt_metacast(VALUE self, VALUE klass)
 		return Qnil;
 	}
 
-	smokeruby_object * o_cast = alloc_smokeruby_object(	o->allocated, 
-														mi->smoke, 
-														(int) mi->index, 
+	smokeruby_object * o_cast = alloc_smokeruby_object(	o->allocated,
+														mi->smoke,
+														(int) mi->index,
 														ret );
 
     VALUE obj = Data_Wrap_Struct(klass, smokeruby_mark, smokeruby_free, (void *) o_cast);
@@ -933,11 +933,11 @@ qsignalmapper_mapping(int argc, VALUE * argv, VALUE self)
 		i = -i;		// turn into ambiguousMethodList index
 		while (meth.smoke->ambiguousMethodList[i] != 0) {
 			if (	(	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name,
-									"QObject*" ) == 0 
+									"QObject*" ) == 0
 						&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QObject")
 						&& !Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") )
 					|| (	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args]].name,
-										"QWidget*" ) == 0 
+										"QWidget*" ) == 0
 							&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") ) )
 			{
 				_current_method.smoke = meth.smoke;
@@ -969,11 +969,11 @@ qsignalmapper_set_mapping(int argc, VALUE * argv, VALUE self)
 		i = -i;		// turn into ambiguousMethodList index
 		while (meth.smoke->ambiguousMethodList[i] != 0) {
 			if (	(	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args + 1]].name,
-									"QObject*" ) == 0 
+									"QObject*" ) == 0
 						&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QObject")
 						&& !Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") )
 					|| (	qstrcmp(	meth.smoke->types[meth.smoke->argumentList[meth.smoke->methods[meth.smoke->ambiguousMethodList[i]].args + 1]].name,
-										"QWidget*" ) == 0 
+										"QWidget*" ) == 0
 							&& Smoke::isDerivedFrom(a->smoke->classes[a->classId].className, "QWidget") ) )
 			{
 				_current_method.smoke = meth.smoke;
@@ -1029,7 +1029,7 @@ qvariant_value(VALUE /*self*/, VALUE variant_value_klass, VALUE variant_value)
 
 	if (variant->userType() == rObject_typeId) {
 		return *(VALUE*) variant->data();
-#ifdef QT_QTDBUS 
+#ifdef QT_QTDBUS
 	} else if (variant->userType() == qMetaTypeId<QDBusObjectPath>()) {
 		QString s = qVariantValue<QDBusObjectPath>(*variant).path();
 		return rb_str_new2(s.toLatin1());
@@ -1226,7 +1226,7 @@ static Smoke::Index new_qvariant_qmap = 0;
 		QtRuby::MethodCall c(qtcore_Smoke, _current_method.index, self, argv, argc);
 		c.next();
     	return *(c.var());
-	} else if (	argc == 1 
+	} else if (	argc == 1
 				&& TYPE(argv[0]) == T_ARRAY
 				&& RARRAY_LEN(argv[0]) > 0
 				&& TYPE(rb_ary_entry(argv[0], 0)) != T_STRING )
@@ -1275,7 +1275,7 @@ initialize_qt(int argc, VALUE * argv, VALUE self)
 {
 	VALUE retval = Qnil;
 	VALUE temp_obj;
-	
+
 	if (TYPE(self) == T_DATA) {
 		// If a ruby block was passed then run that now
 		if (rb_block_given_p()) {
@@ -1294,12 +1294,12 @@ initialize_qt(int argc, VALUE * argv, VALUE self)
 	temp_stack[1] = constructor_name;
 	temp_stack[2] = klass;
 	temp_stack[3] = self;
-	
+
 	for (int count = 0; count < argc; count++) {
 		temp_stack[count+4] = argv[count];
 	}
 
-	{ 
+	{
 		QByteArray * mcid = find_cached_selector(argc+4, temp_stack, klass, rb_class2name(klass));
 
 		if (_current_method.index == -1) {
@@ -1315,7 +1315,7 @@ initialize_qt(int argc, VALUE * argv, VALUE self)
 		// Another longjmp here..
 		rb_raise(rb_eArgError, "unresolved constructor call %s\n", rb_class2name(klass));
 	}
-	
+
 	{
 		// Allocate the MethodCall within a C block. Otherwise, because the continue_new_instance()
 		// call below will longjmp out, it wouldn't give C++ an opportunity to clean up
@@ -1323,13 +1323,13 @@ initialize_qt(int argc, VALUE * argv, VALUE self)
 		c.next();
 		temp_obj = *(c.var());
 	}
-	
+
 	smokeruby_object * p = 0;
 	Data_Get_Struct(temp_obj, smokeruby_object, p);
 
-	smokeruby_object  * o = alloc_smokeruby_object(	true, 
-													p->smoke, 
-													p->classId, 
+	smokeruby_object  * o = alloc_smokeruby_object(	true,
+													p->smoke,
+													p->classId,
 													p->ptr );
 	p->ptr = 0;
 	p->allocated = false;
@@ -1354,7 +1354,7 @@ new_qt(int argc, VALUE * argv, VALUE klass)
 
 	VALUE result = rb_funcall2(qt_internal_module, rb_intern("try_initialize"), argc+1, temp_stack);
 	rb_obj_call_init(result, argc, argv);
-	
+
 	return result;
 }
 
@@ -1368,7 +1368,7 @@ qapplication_argv(VALUE /*self*/)
 	for (int index = 1; index < qApp->argc(); index++) {
 		rb_ary_push(result, rb_str_new2(qApp->argv()[index]));
 	}
-	
+
 	return result;
 }
 
@@ -1432,8 +1432,8 @@ qt_metacall(int /*argc*/, VALUE * argv, VALUE self)
 {
 	// Arguments: QMetaObject::Call _c, int id, void ** _o
 	QMetaObject::Call _c = (QMetaObject::Call) NUM2INT(	rb_funcall(	qt_internal_module,
-																	rb_intern("get_qinteger"), 
-																	1, 
+																	rb_intern("get_qinteger"),
+																	1,
 																	argv[0] ) );
 	int id = NUM2INT(argv[1]);
 	void ** _o = 0;
@@ -1460,7 +1460,7 @@ qt_metacall(int /*argc*/, VALUE * argv, VALUE self)
 		}
 	} else {
 		// Should never happen..
-		rb_raise(rb_eRuntimeError, "Cannot find %s::qt_metacall() method\n", 
+		rb_raise(rb_eRuntimeError, "Cannot find %s::qt_metacall() method\n",
 			o->smoke->classes[o->classId].className );
 	}
 
@@ -1499,7 +1499,7 @@ static QRegExp * rx = 0;
 		QtRuby::InvokeSlot slot(self, rb_intern(name.toLatin1()), mocArgs, _o);
 		slot.next();
 	}
-	
+
 	return INT2NUM(id - count);
 }
 
@@ -1579,7 +1579,7 @@ getIsa(VALUE /*self*/, VALUE classId)
     return parents_list;
 }
 
-// Return the class name of a QObject. Note that the name will be in the 
+// Return the class name of a QObject. Note that the name will be in the
 // form of Qt::Widget rather than QWidget. Is this a bug or a feature?
 static VALUE
 class_name(VALUE self)
@@ -1608,7 +1608,7 @@ inherits_qobject(int argc, VALUE * argv, VALUE /*self*/)
 }
 
 /* Adapted from the internal function qt_qFindChildren() in qobject.cpp */
-static void 
+static void
 rb_qFindChildren_helper(VALUE parent, const QString &name, VALUE re,
                          const QMetaObject &mo, VALUE list)
 {
@@ -1620,7 +1620,7 @@ rb_qFindChildren_helper(VALUE parent, const QString &name, VALUE re,
         rv = RARRAY_PTR(children)[i];
 		smokeruby_object *o = value_obj_info(rv);
 		QObject * obj = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject").index);
-		
+
 		// The original code had 'if (mo.cast(obj))' as a test, but it doesn't work here
         if (obj->qt_metacast(mo.className()) != 0) {
             if (re != Qnil) {
@@ -1658,7 +1658,7 @@ find_qobject_children(int argc, VALUE *argv, VALUE self)
 			re = argv[1];
 		}
 	}
-		
+
 	VALUE metaObject = rb_funcall(argv[0], rb_intern("staticMetaObject"), 0);
 	smokeruby_object *o = value_obj_info(metaObject);
 	QMetaObject * mo = (QMetaObject*) o->ptr;
@@ -1701,7 +1701,7 @@ find_qobject_child(int argc, VALUE *argv, VALUE self)
 	if (argc == 2) {
 		name = QString::fromLatin1(StringValuePtr(argv[1]));
 	}
-		
+
 	VALUE metaObject = rb_funcall(argv[0], rb_intern("staticMetaObject"), 0);
 	smokeruby_object *o = value_obj_info(metaObject);
 	QMetaObject * mo = (QMetaObject*) o->ptr;
@@ -1755,7 +1755,7 @@ isEnum(VALUE /*self*/, VALUE enumName_value)
              break;
          }
     }
-	return	typeId > 0 
+	return	typeId > 0
 			&& (	(s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_enum
 					|| (s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_ulong
 					|| (s->types[typeId].flags & Smoke::tf_elem) == Smoke::t_long
@@ -1802,8 +1802,8 @@ get_value_type(VALUE /*self*/, VALUE ruby_value)
     return rb_str_new2(value_to_type_flag(ruby_value));
 }
 
-static QMetaObject* 
-parent_meta_object(VALUE obj) 
+static QMetaObject*
+parent_meta_object(VALUE obj)
 {
 	smokeruby_object* o = value_obj_info(obj);
 	Smoke::ModuleIndex nameId = o->smoke->idMethodName("metaObject");
@@ -1842,13 +1842,13 @@ make_metaObject(VALUE /*self*/, VALUE obj, VALUE parentMeta, VALUE stringdata_va
 	uint * data = new uint[count];
 
 	memcpy(	(void *) stringdata, RSTRING_PTR(stringdata_value), RSTRING_LEN(stringdata_value) );
-	
+
 	for (long i = 0; i < count; i++) {
 		VALUE rv = rb_ary_entry(data_value, i);
 		data[i] = NUM2UINT(rv);
 	}
-	
-	QMetaObject ob = { 
+
+	QMetaObject ob = {
 		{ superdata, stringdata, data, 0 }
 	} ;
 
@@ -1857,7 +1857,7 @@ make_metaObject(VALUE /*self*/, VALUE obj, VALUE parentMeta, VALUE stringdata_va
 
 #ifdef DEBUG
 	printf("make_metaObject() superdata: %p %s\n", meta->d.superdata, superdata->className());
-	
+
 	printf(
 	" // content:\n"
 	"       %d,       // revision\n"
@@ -1866,7 +1866,7 @@ make_metaObject(VALUE /*self*/, VALUE obj, VALUE parentMeta, VALUE stringdata_va
 	"       %d,   %d, // methods\n"
 	"       %d,   %d, // properties\n"
 	"       %d,   %d, // enums/sets\n",
-	data[0], data[1], data[2], data[3], 
+	data[0], data[1], data[2], data[3],
 	data[4], data[5], data[6], data[7], data[8], data[9]);
 
 	int s = data[3];
@@ -1886,22 +1886,22 @@ make_metaObject(VALUE /*self*/, VALUE obj, VALUE parentMeta, VALUE stringdata_va
 		if (signal_headings && (data[s + (j * 5) + 4] & 0x04) != 0) {
 			printf("\n // signals: signature, parameters, type, tag, flags\n");
 			signal_headings = false;
-		} 
+		}
 
 		if (slot_headings && (data[s + (j * 5) + 4] & 0x08) != 0) {
 			printf("\n // slots: signature, parameters, type, tag, flags\n");
 			slot_headings = false;
 		}
 
-		printf("      %d,   %d,   %d,   %d, 0x%2.2x\n", 
-			data[s + (j * 5)], data[s + (j * 5) + 1], data[s + (j * 5) + 2], 
+		printf("      %d,   %d,   %d,   %d, 0x%2.2x\n",
+			data[s + (j * 5)], data[s + (j * 5) + 1], data[s + (j * 5) + 2],
 			data[s + (j * 5) + 3], data[s + (j * 5) + 4]);
 	}
 
 	s += (data[4] * 5);
 	for (uint j = 0; j < data[6]; j++) {
 		printf("\n // properties: name, type, flags\n");
-		printf("      %d,   %d,   0x%8.8x\n", 
+		printf("      %d,   %d,   0x%8.8x\n",
 			data[s + (j * 3)], data[s + (j * 3) + 1], data[s + (j * 3) + 2]);
 	}
 
@@ -1928,9 +1928,9 @@ make_metaObject(VALUE /*self*/, VALUE obj, VALUE parentMeta, VALUE stringdata_va
 	printf("\"\n\n");
 
 #endif
-	smokeruby_object  * m = alloc_smokeruby_object(	true, 
-													qtcore_Smoke, 
-													qtcore_Smoke->idClass("QMetaObject").index, 
+	smokeruby_object  * m = alloc_smokeruby_object(	true,
+													qtcore_Smoke,
+													qtcore_Smoke->idClass("QMetaObject").index,
 													meta );
 
     return Data_Wrap_Struct(qmetaobject_class, smokeruby_mark, smokeruby_free, m);
@@ -1962,7 +1962,7 @@ dispose(VALUE self)
 
     const char *className = o->smoke->classes[o->classId].className;
 	if(do_debug & qtdb_gc) printf("Deleting (%s*)%p\n", className, o->ptr);
-	
+
 	unmapPointer(o, o->classId, 0);
 	object_count--;
 
@@ -1981,7 +1981,7 @@ dispose(VALUE self)
 	delete[] methodName;
 	o->ptr = 0;
 	o->allocated = false;
-	
+
 	return Qnil;
 }
 
@@ -2023,7 +2023,7 @@ findClass(VALUE /*self*/, VALUE name_value)
 //     char *name = StringValuePtr(name_value);
 //     return INT2NUM(qtcore_Smoke->idMethodName(name).index);
 // }
-// 
+//
 // static VALUE
 // idMethod(VALUE /*self*/, VALUE idclass_value, VALUE idmethodname_value)
 // {
@@ -2039,27 +2039,27 @@ dumpCandidates(VALUE /*self*/, VALUE rmeths)
     if(rmeths != Qnil) {
 	int count = RARRAY_LEN(rmeths);
         for(int i = 0; i < count; i++) {
-	    rb_str_catf(errmsg, "\t");
+	    qtruby_str_catf(errmsg, "\t");
 	    int id = NUM2INT(rb_funcall(rb_ary_entry(rmeths, i), rb_intern("index"), 0));
 	    Smoke* smoke = smokeList[NUM2INT(rb_funcall(rb_ary_entry(rmeths, i), rb_intern("smoke"), 0))];
 	    const Smoke::Method &meth = smoke->methods[id];
 	    const char *tname = smoke->types[meth.ret].name;
 	    if(meth.flags & Smoke::mf_enum) {
-			rb_str_catf(errmsg, "enum ");
-			rb_str_catf(errmsg, "%s::%s", smoke->classes[meth.classId].className, smoke->methodNames[meth.name]);
-			rb_str_catf(errmsg, "\n");
+			qtruby_str_catf(errmsg, "enum ");
+			qtruby_str_catf(errmsg, "%s::%s", smoke->classes[meth.classId].className, smoke->methodNames[meth.name]);
+			qtruby_str_catf(errmsg, "\n");
 	    } else {
-			if(meth.flags & Smoke::mf_static) rb_str_catf(errmsg, "static ");
-			rb_str_catf(errmsg, "%s ", (tname ? tname:"void"));
-			rb_str_catf(errmsg, "%s::%s(", smoke->classes[meth.classId].className, smoke->methodNames[meth.name]);
+			if(meth.flags & Smoke::mf_static) qtruby_str_catf(errmsg, "static ");
+			qtruby_str_catf(errmsg, "%s ", (tname ? tname:"void"));
+			qtruby_str_catf(errmsg, "%s::%s(", smoke->classes[meth.classId].className, smoke->methodNames[meth.name]);
 			for(int i = 0; i < meth.numArgs; i++) {
-			if(i) rb_str_catf(errmsg, ", ");
+			if(i) qtruby_str_catf(errmsg, ", ");
 			tname = smoke->types[smoke->argumentList[meth.args+i]].name;
-			rb_str_catf(errmsg, "%s", (tname ? tname:"void"));
+			qtruby_str_catf(errmsg, "%s", (tname ? tname:"void"));
 			}
-			rb_str_catf(errmsg, ")");
-			if(meth.flags & Smoke::mf_const) rb_str_catf(errmsg, " const");
-			rb_str_catf(errmsg, "\n");
+			qtruby_str_catf(errmsg, ")");
+			if(meth.flags & Smoke::mf_const) qtruby_str_catf(errmsg, " const");
+			qtruby_str_catf(errmsg, "\n");
         	}
         }
     }
@@ -2152,13 +2152,13 @@ create_qobject_class(VALUE /*self*/, VALUE package_value, VALUE module_value)
 	VALUE value_moduleName = rb_funcall(module_value, rb_intern("name"), 0);
 	const char *moduleName = strdup(StringValuePtr(value_moduleName));
 	VALUE klass = module_value;
-	
+
 	QString packageName(package);
 
 	foreach(QString s, packageName.mid(strlen(moduleName) + 2).split("::")) {
 		klass = rb_define_class_under(klass, (const char*) s.toLatin1(), qt_base_class);
 	}
-	
+
 	if (packageName == "Qt::Application" || packageName == "Qt::CoreApplication" ) {
 		rb_define_method(klass, "ARGV", (VALUE (*) (...)) qapplication_argv, 0);
 	} else if (packageName == "Qt::Object") {
@@ -2181,7 +2181,7 @@ create_qobject_class(VALUE /*self*/, VALUE package_value, VALUE module_value)
 		rb_define_method(qtablemodel_class, "remove_rows", (VALUE (*) (...)) qabstract_item_model_removerows, -1);
 		rb_define_method(qtablemodel_class, "removeColumns", (VALUE (*) (...)) qabstract_item_model_removecolumns, -1);
 		rb_define_method(qtablemodel_class, "remove_columns", (VALUE (*) (...)) qabstract_item_model_removecolumns, -1);
-		
+
 		qlistmodel_class = rb_define_class_under(qt_module, "ListModel", klass);
 		rb_define_method(qlistmodel_class, "rowCount", (VALUE (*) (...)) qabstract_item_model_rowcount, -1);
 		rb_define_method(qlistmodel_class, "row_count", (VALUE (*) (...)) qabstract_item_model_rowcount, -1);
@@ -2207,7 +2207,7 @@ create_qobject_class(VALUE /*self*/, VALUE package_value, VALUE module_value)
 		rb_define_singleton_method(klass, "singleShot", (VALUE (*) (...)) qtimer_single_shot, -1);
 		rb_define_singleton_method(klass, "single_shot", (VALUE (*) (...)) qtimer_single_shot, -1);
 	}
-	
+
 
 	rb_define_method(klass, "qobject_cast", (VALUE (*) (...)) qobject_qt_metacast, 1);
 	rb_define_method(klass, "inspect", (VALUE (*) (...)) inspect_qobject, 0);
@@ -2217,10 +2217,10 @@ create_qobject_class(VALUE /*self*/, VALUE package_value, VALUE module_value)
 	rb_define_method(klass, "inherits", (VALUE (*) (...)) inherits_qobject, -1);
 	rb_define_method(klass, "findChildren", (VALUE (*) (...)) find_qobject_children, -1);
 	rb_define_method(klass, "find_children", (VALUE (*) (...)) find_qobject_children, -1);
-	rb_define_method(klass, "findChild", (VALUE (*) (...)) find_qobject_child, -1);   
-	rb_define_method(klass, "find_child", (VALUE (*) (...)) find_qobject_child, -1);   
-	rb_define_method(klass, "connect", (VALUE (*) (...)) qobject_connect, -1);   
-	rb_define_singleton_method(klass, "connect", (VALUE (*) (...)) qobject_connect, -1);   
+	rb_define_method(klass, "findChild", (VALUE (*) (...)) find_qobject_child, -1);
+	rb_define_method(klass, "find_child", (VALUE (*) (...)) find_qobject_child, -1);
+	rb_define_method(klass, "connect", (VALUE (*) (...)) qobject_connect, -1);
+	rb_define_singleton_method(klass, "connect", (VALUE (*) (...)) qobject_connect, -1);
 
 	foreach(QtRubyModule m, qtruby_modules.values()) {
 		if (m.class_created)
@@ -2349,9 +2349,9 @@ Init_qtruby4()
     init_qtnetwork_Smoke();
     init_qtsvg_Smoke();
     init_qtdbus_Smoke();
-	
+
     install_handlers(Qt_handlers);
-	
+
     INIT_BINDING(qtcore)
     INIT_BINDING(qtgui)
     INIT_BINDING(qtxml)
@@ -2384,7 +2384,7 @@ Init_qtruby4()
 
 	rb_define_method(qt_base_class, "qVariantValue", (VALUE (*) (...)) qvariant_value, 2);
 	rb_define_method(qt_base_class, "qVariantFromValue", (VALUE (*) (...)) qvariant_from_value, -1);
-    
+
 	rb_define_method(rb_cObject, "qDebug", (VALUE (*) (...)) qdebug, 1);
 	rb_define_method(rb_cObject, "qFatal", (VALUE (*) (...)) qfatal, 1);
 	rb_define_method(rb_cObject, "qWarning", (VALUE (*) (...)) qwarning, 1);
@@ -2426,9 +2426,9 @@ Init_qtruby4()
     rb_define_module_function(qt_module, "dynamic_cast", (VALUE (*) (...)) cast_object_to, 2);
     rb_define_module_function(qt_internal_module, "kross2smoke", (VALUE (*) (...)) kross2smoke, 2);
     rb_define_module_function(qt_internal_module, "set_qtruby_embedded", (VALUE (*) (...)) set_qtruby_embedded_wrapped, 1);
-    
+
     rb_define_module_function(qt_internal_module, "application_terminated=", (VALUE (*) (...)) set_application_terminated, 1);
-    
+
 	rb_define_module_function(qt_module, "version", (VALUE (*) (...)) version, 0);
     rb_define_module_function(qt_module, "qtruby_version", (VALUE (*) (...)) qtruby_version, 0);
 
@@ -2437,9 +2437,9 @@ Init_qtruby4()
 
     // A problem has been found with QtRuby when it is run with Ruby 1.9.1
     // and GC.stess is true.
-    // In the smokeruby_mark() function called during garbage collection, 
-    // any virtual methods which are called on the instances being checked 
-    // could have overriden by Ruby methods.  So the Wt::Ruby runtime uses 
+    // In the smokeruby_mark() function called during garbage collection,
+    // any virtual methods which are called on the instances being checked
+    // could have overriden by Ruby methods.  So the Wt::Ruby runtime uses
     // 'respond_to()' to find out whether they have been overriden.
     // However, this involves calling 'rb_intern()' on the method name,
     // which means memory could be allocated, giving an error when running under
diff --git a/src/qtruby.h b/src/qtruby.h
index a70db1c..d35e6d3 100644
--- a/src/qtruby.h
+++ b/src/qtruby.h
@@ -74,11 +74,11 @@ struct SmokeValue
 {
   VALUE value;
   smokeruby_object* o;
-  
+
   SmokeValue()
   : value(Qnil)
   , o(0) { }
-  
+
   SmokeValue(VALUE value, smokeruby_object* o)
   : value(value)
   , o(o) { }
@@ -159,7 +159,7 @@ extern Q_DECL_EXPORT void mapPointer(VALUE obj, smokeruby_object *o, Smoke::Inde
 extern Q_DECL_EXPORT void unmapPointer(smokeruby_object *, Smoke::Index, void*);
 
 extern Q_DECL_EXPORT const char * resolve_classname(smokeruby_object * o);
-extern Q_DECL_EXPORT VALUE rb_str_catf(VALUE self, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+extern Q_DECL_EXPORT VALUE qtruby_str_catf(VALUE self, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
 
 extern Q_DECL_EXPORT VALUE findMethod(VALUE self, VALUE c_value, VALUE name_value);
 extern Q_DECL_EXPORT VALUE findAllMethods(int argc, VALUE * argv, VALUE self);


More information about the Kde-bindings mailing list