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

List:       kde-commits
Subject:    KDE/kdebindings/ruby/korundum
From:       Richard Dale <richard.j.dale () gmail ! com>
Date:       2010-09-30 15:34:41
Message-ID: 20100930153441.B9110AC88E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1181284 by rdale:

* Replace STR2CSTR macros with StringValuePtr so that the
  krubypluginfactory.cpp builds with Ruby 1.9

CCMAIL: kde-bindings@kde.org


 M  +4 -0      ChangeLog  
 M  +5 -4      src/krubypluginfactory.cpp  


--- trunk/KDE/kdebindings/ruby/korundum/ChangeLog #1181283:1181284
@@ -1,3 +1,7 @@
+2010-09-30  Richard Dale  <richard.j.dale@gmail.com>
+    * Replace STR2CSTR macros with StringValuePtr so that the
+      krubypluginfactory.cpp builds with Ruby 1.9
+
 2009-09-22  Richard Dale  <richard.j.dale@gmail.com>
     * Fix broken KDE::ConfigGroup.readEntry method. Thanks to Paulo Capriotti
       for reporting the bug
--- trunk/KDE/kdebindings/ruby/korundum/src/krubypluginfactory.cpp #1181283:1181284
@@ -52,16 +52,17 @@
     VALUE bt = rb_funcall(info, rb_intern("backtrace"), 0);
     VALUE message = RARRAY_PTR(bt)[0];
 
+    VALUE obj_string = rb_obj_as_string(info);
     QString errormessage = QString("%1: %2 (%3)")
-                            .arg( STR2CSTR(message) )
-                            .arg( STR2CSTR(rb_obj_as_string(info)) )
-                            .arg( rb_class2name(CLASS_OF(info)) );
+                            .arg( QString::fromLatin1(StringValuePtr(message)) )
+                            .arg( QString::fromLatin1(StringValuePtr(obj_string)) )
+                            .arg( QString::fromLatin1(rb_class2name(CLASS_OF(info))) );
     fprintf(stderr, "%s\n", errormessage.toLatin1().constData());
 
     QString tracemessage;
     for(int i = 1; i < RARRAY_LEN(bt); ++i) {
         if( TYPE(RARRAY_PTR(bt)[i]) == T_STRING ) {
-            QString s = QString("%1\n").arg( STR2CSTR(RARRAY_PTR(bt)[i]) );
+            QString s = QString("%1\n").arg( QString::fromLatin1(StringValuePtr(RARRAY_PTR(bt)[i])) );
             Q_ASSERT( ! s.isNull() );
             tracemessage += s;
             fprintf(stderr, "\t%s", s.toLatin1().constData());
[prev in list] [next in list] [prev in thread] [next in thread] 

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