fix ruby bindings

This commit is contained in:
Phil Miller 2010-10-28 23:34:41 +02:00
parent 130e69fdfa
commit 085d73ed08
2 changed files with 29 additions and 2 deletions

View File

@ -43,9 +43,11 @@ makedepends=('pkgconfig' 'cmake' 'automoc4' "kdelibs>=${_kdever}" 'pyqt'
'ruby' 'mono' "kdegraphics-okular>=${_kdever}" "kdegraphics-common>=${_kdever}") # "kdepim-runtime>=${_kdever}"
source=($_mirror/${_origname}-$_kdever.tar.bz2
fix-generator-segfaults.patch)
fix-generator-segfaults.patch
fix-ruby-bindings.patch)
md5sums=(`grep ${_origname}-$_kdever.tar.bz2 ../kde-sc.md5 | cut -d" " -f1`
e870fe57c933a076c3e8319604edb63d)
e870fe57c933a076c3e8319604edb63d
95efe147489fdd8acb421a0a450e635a)
#
@ -57,6 +59,7 @@ build()
# Already fixed in 4.5.3
patch -Np4 -i ${srcdir}/fix-generator-segfaults.patch
patch -Np3 -i ${srcdir}/fix-ruby-bindings.patch
#fix ruby
for f in `find ruby -name CMakeLists.txt`; do

View File

@ -0,0 +1,24 @@
--- trunk/KDE/kdebindings/ruby/korundum/src/krubypluginfactory.cpp 2010/07/20 14:22:25 1152205
+++ trunk/KDE/kdebindings/ruby/korundum/src/krubypluginfactory.cpp 2010/09/30 15:34:41 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());