diff options
author | Caleb Tennis <caleb@gentoo.org> | 2006-08-29 20:17:05 +0000 |
---|---|---|
committer | Caleb Tennis <caleb@gentoo.org> | 2006-08-29 20:17:05 +0000 |
commit | 25a01e841baf4ad904439bd6b3b176977d416bd0 (patch) | |
tree | 288407cd4fb0800276db4b0e34313b08819205c1 /kde-base | |
parent | Fix some memory leaks (diff) | |
download | gentoo-2-25a01e841baf4ad904439bd6b3b176977d416bd0.tar.gz gentoo-2-25a01e841baf4ad904439bd6b3b176977d416bd0.tar.bz2 gentoo-2-25a01e841baf4ad904439bd6b3b176977d416bd0.zip |
Fix memory leaks
(Portage version: 2.1.1_pre5-r3)
Diffstat (limited to 'kde-base')
-rw-r--r-- | kde-base/korundum/ChangeLog | 9 | ||||
-rw-r--r-- | kde-base/korundum/files/digest-korundum-3.5.4-r1 | 3 | ||||
-rw-r--r-- | kde-base/korundum/files/korundum-3.5.4-more.patch | 118 | ||||
-rw-r--r-- | kde-base/korundum/files/qtruby-3.5.4-more.patch | 445 | ||||
-rw-r--r-- | kde-base/korundum/korundum-3.5.4-r1.ebuild | 34 |
5 files changed, 608 insertions, 1 deletions
diff --git a/kde-base/korundum/ChangeLog b/kde-base/korundum/ChangeLog index 64ea6bc87fbd..26d4c9ba9114 100644 --- a/kde-base/korundum/ChangeLog +++ b/kde-base/korundum/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for kde-base/korundum # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/korundum/ChangeLog,v 1.41 2006/08/18 15:40:23 gustavoz Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/korundum/ChangeLog,v 1.42 2006/08/29 20:17:05 caleb Exp $ + +*korundum-3.5.4-r1 (29 Aug 2006) + + 29 Aug 2006; Caleb Tennis <caleb@gentoo.org> + +files/korundum-3.5.4-more.patch, +files/qtruby-3.5.4-more.patch, + +korundum-3.5.4-r1.ebuild: + Fix memory leaks 18 Aug 2006; Gustavo Zacarias <gustavoz@gentoo.org> korundum-3.5.2.ebuild, korundum-3.5.3.ebuild, korundum-3.5.4.ebuild: diff --git a/kde-base/korundum/files/digest-korundum-3.5.4-r1 b/kde-base/korundum/files/digest-korundum-3.5.4-r1 new file mode 100644 index 000000000000..14931d41e70d --- /dev/null +++ b/kde-base/korundum/files/digest-korundum-3.5.4-r1 @@ -0,0 +1,3 @@ +MD5 097eb4311f5715f36fdc83dc5badb476 kdebindings-3.5.4.tar.bz2 5416588 +RMD160 51f90590e662f548a1ff10f7a3f5f6449cae00c4 kdebindings-3.5.4.tar.bz2 5416588 +SHA256 3714a50ef43cad14cfd53457a79f5d3b809c3e98c3c047ca755115f486c1455e kdebindings-3.5.4.tar.bz2 5416588 diff --git a/kde-base/korundum/files/korundum-3.5.4-more.patch b/kde-base/korundum/files/korundum-3.5.4-more.patch new file mode 100644 index 000000000000..96d2fe0a9fa7 --- /dev/null +++ b/kde-base/korundum/files/korundum-3.5.4-more.patch @@ -0,0 +1,118 @@ +Index: ChangeLog +=================================================================== +--- korundum/ChangeLog (revision 565692) ++++ korundum/ChangeLog (revision 578517) +@@ -1,3 +1,8 @@ ++2006-08-18 Richard Dale <rdale@foton.es> ++ ++ * Added a KActionPtrList marshaller. Fixes problem reported by ++ eskatos on the #qtruby irc channel. ++ + 2006-06-05 Richard Dale <rdale@foton.es> + + * The metaObject methods for slots and signals are no longer added when +Index: rubylib/korundum/Korundum.cpp +=================================================================== +--- korundum/rubylib/korundum/Korundum.cpp (revision 565692) ++++ korundum/rubylib/korundum/Korundum.cpp (revision 578517) +@@ -661,6 +661,8 @@ + ~EmitDCOPSignal() + { + delete[] _stack; ++ delete _stream; ++ delete _data; + } + const MocArgument &arg() { return _args[_cur]; } + SmokeType type() { return arg().st; } +@@ -878,6 +880,9 @@ + ~InvokeDCOPSlot() { + delete[] _stack; + delete _stream; ++ for(int i=0;i<_items;++i) { ++ free(_sp++); ++ } + } + }; + +Index: rubylib/korundum/kdehandlers.cpp +=================================================================== +--- korundum/rubylib/korundum/kdehandlers.cpp (revision 565692) ++++ korundum/rubylib/korundum/kdehandlers.cpp (revision 578517) +@@ -642,6 +642,60 @@ + } + #endif + ++void marshall_KActionPtrList(Marshall *m) { ++ switch(m->action()) { ++ case Marshall::FromVALUE: ++ { ++ } ++ break; ++ case Marshall::ToVALUE: ++ { ++ KActionPtrList *valuelist = (KActionPtrList*)m->item().s_voidp; ++ if (!valuelist) { ++ *(m->var()) = Qnil; ++ break; ++ } ++ ++ VALUE av = rb_ary_new(); ++ ++ int ix = m->smoke()->idClass("KAction"); ++ const char * className = m->smoke()->binding->className(ix); ++ ++ for ( KActionPtrList::Iterator it = valuelist->begin(); ++ it != valuelist->end(); ++ ++it ) ++ { ++ void *p = (*it); ++ ++ if (m->item().s_voidp == 0) { ++ *(m->var()) = Qnil; ++ break; ++ } ++ ++ VALUE obj = getPointerObject(p); ++ if (obj == Qnil) { ++ smokeruby_object * o = ALLOC(smokeruby_object); ++ o->smoke = m->smoke(); ++ o->classId = o->smoke->idClass("KAction"); ++ o->ptr = p; ++ o->allocated = false; ++ obj = set_obj_info(className, o); ++ } ++ rb_ary_push(av, obj); ++ } ++ ++ if (m->cleanup()) ++ delete valuelist; ++ else ++ *(m->var()) = av; ++ } ++ break; ++ default: ++ m->unsupported(); ++ break; ++ } ++} ++ + void marshall_KTraderOfferList(Marshall *m) { + switch(m->action()) { + case Marshall::FromVALUE: +@@ -1261,6 +1315,7 @@ + TypeHandler KDE_handlers[] = { + { "QCStringList", marshall_QCStringList }, + { "KCmdLineOptions*", marshall_KCmdLineOptions }, ++ { "KActionPtrList", marshall_KActionList }, + { "QPtrList<KAction>", marshall_KActionList }, + { "QPtrList<KAction>&", marshall_KActionList }, + { "KMimeType::List", marshall_KMimeTypeList }, +@@ -1291,6 +1346,8 @@ + { "QPtrList<KParts::Plugin>", marshall_KPartPluginList }, + { "QPtrList<KParts::ReadOnlyPart>", marshall_KPartReadOnlyPartList }, + { "QPtrList<KServiceTypeProfile>&", marshall_KServiceTypeProfileList }, ++ { "QValueList<KAction*>", marshall_KActionPtrList }, ++ { "KActionPtrList", marshall_KActionPtrList }, + { "QValueList<KAboutPerson>", marshall_KAboutPersonList }, + { "QValueList<KAboutTranslator>", marshall_KAboutTranslatorList }, + { "QValueList<KIO::CopyInfo>&", marshall_KIOCopyInfoList }, diff --git a/kde-base/korundum/files/qtruby-3.5.4-more.patch b/kde-base/korundum/files/qtruby-3.5.4-more.patch new file mode 100644 index 000000000000..614f495fbaeb --- /dev/null +++ b/kde-base/korundum/files/qtruby-3.5.4-more.patch @@ -0,0 +1,445 @@ +Index: ChangeLog +=================================================================== +--- qtruby/ChangeLog (revision 565692) ++++ qtruby/ChangeLog (revision 578513) +@@ -1,3 +1,13 @@ ++2006-08-29 Richard Dale <rdale@foton.es> ++ ++ * Backported some memory leak fixes from Qt4 QtRuby ++ ++2006-08-10 Richard Dale <rdale@foton.es> ++ ++ * The Ruby VALUE to 'uchar *' marshaller wasn't working correctly if the ++ Ruby string contained nulls. Fixed by Dirk Mueller (thanks) and also ++ applied for 'char *' types. ++ + 2006-07-12 Richard Dale <rdale@foton.es> + + * The Ruby String to 'char *' and String to 'unsigned char *' were using +Index: rubylib/qtruby/handlers.cpp +=================================================================== +--- qtruby/rubylib/qtruby/handlers.cpp (revision 565692) ++++ qtruby/rubylib/qtruby/handlers.cpp (revision 578513) +@@ -422,6 +422,7 @@ + Smoke::Index ccMeth = o->smoke->findMethod(o->classId, ccId); + + if(!ccMeth) { ++ delete[] ccArg; + return 0; + } + Smoke::Index method = o->smoke->methodMaps[ccMeth].method; +@@ -747,17 +748,21 @@ + + static void marshall_charP(Marshall *m) { + switch(m->action()) { +- case Marshall::FromVALUE: +- { +- VALUE rv = *(m->var()); +- if(rv == Qnil) { +- m->item().s_voidp = 0; +- break; +- } +- +- m->item().s_voidp = strdup(StringValuePtr(rv)); +- } +- break; ++ case Marshall::FromVALUE: ++ { ++ VALUE rv = *(m->var()); ++ if (rv == Qnil) { ++ m->item().s_voidp = 0; ++ break; ++ } ++ ++ int len = RSTRING(rv)->len; ++ char* mem = (char*) malloc(len+1); ++ memcpy(mem, StringValuePtr(rv), len); ++ mem[len] ='\0'; ++ m->item().s_voidp = mem; ++ } ++ break; + case Marshall::ToVALUE: + { + char *p = (char*)m->item().s_voidp; +@@ -777,14 +782,18 @@ + + void marshall_ucharP(Marshall *m) { + switch(m->action()) { +- case Marshall::FromVALUE: +- { +- VALUE rv = *(m->var()); +- if(rv == Qnil) { +- m->item().s_voidp = 0; +- break; +- } +- m->item().s_voidp = strdup(StringValuePtr(rv)); ++ case Marshall::FromVALUE: ++ { ++ VALUE rv = *(m->var()); ++ if (rv == Qnil) { ++ m->item().s_voidp = 0; ++ break; ++ } ++ int len = RSTRING(rv)->len; ++ char* mem = (char*) malloc(len+1); ++ memcpy(mem, StringValuePtr(rv), len); ++ mem[len] ='\0'; ++ m->item().s_voidp = mem; + } + break; + case Marshall::ToVALUE: +@@ -1836,8 +1845,8 @@ + } + } + +-#define DEF_VALUELIST_MARSHALLER(ListIdent,ItemList,Item,Itr) namespace { char ListIdent##STR[] = #Item; }; \ +- Marshall::HandlerFn marshall_##ListIdent = marshall_ValueItemList<Item,ItemList,Itr,ListIdent##STR>; ++#define DEF_VALUELIST_MARSHALLER(ListIdent,ItemList,Item,Itr) namespace dummy { char ListIdent##STR[] = #Item; }; \ ++ Marshall::HandlerFn marshall_##ListIdent = marshall_ValueItemList<Item,ItemList,Itr,dummy::ListIdent##STR>; + + DEF_VALUELIST_MARSHALLER( QVariantList, QValueList<QVariant>, QVariant, QValueList<QVariant>::Iterator ) + DEF_VALUELIST_MARSHALLER( QPixmapList, QValueList<QPixmap>, QPixmap, QValueList<QPixmap>::Iterator ) +Index: rubylib/qtruby/Qt.cpp +=================================================================== +--- qtruby/rubylib/qtruby/Qt.cpp (revision 565692) ++++ qtruby/rubylib/qtruby/Qt.cpp (revision 578513) +@@ -1351,28 +1351,32 @@ + return obj; + } + +-static QCString ++static QCString * + find_cached_selector(int argc, VALUE * argv, VALUE klass, char * methodName) + { + // Look in the cache +- QCString mcid(rb_class2name(klass)); +- mcid += ';'; +- mcid += methodName; ++static QCString * mcid = 0; ++ if (mcid == 0) { ++ mcid = new QCString(); ++ } ++ *mcid = rb_class2name(klass); ++ *mcid += ';'; ++ *mcid += methodName; + for(int i=3; i<argc ; i++) + { +- mcid += ';'; +- mcid += get_VALUEtype(argv[i]); ++ *mcid += ';'; ++ *mcid += get_VALUEtype(argv[i]); + } + +- Smoke::Index *rcid = methcache.find((const char *)mcid); ++ Smoke::Index *rcid = methcache.find((const char *)*mcid); + #ifdef DEBUG +- if (do_debug & qtdb_calls) qWarning("method_missing mcid: %s", (const char *) mcid); ++ if (do_debug & qtdb_calls) qWarning("method_missing mcid: %s", (const char *) *mcid); + #endif + + if (rcid) { + // Got a hit + #ifdef DEBUG +- if (do_debug & qtdb_calls) qWarning("method_missing cache hit, mcid: %s", (const char *) mcid); ++ if (do_debug & qtdb_calls) qWarning("method_missing cache hit, mcid: %s", (const char *) *mcid); + #endif + _current_method = *rcid; + } else { +@@ -1389,27 +1393,32 @@ + VALUE klass = rb_funcall(self, rb_intern("class"), 0); + + // Look for 'thing?' methods, and try to match isThing() or hasThing() in the Smoke runtime +- QString pred(rb_id2name(SYM2ID(argv[0]))); +- if (pred.endsWith("?")) { ++static QString * pred = 0; ++ if (pred == 0) { ++ pred = new QString(); ++ } ++ ++ *pred = methodName; ++ if (pred->endsWith("?")) { + smokeruby_object *o = value_obj_info(self); + if(!o || !o->ptr) { + rb_call_super(argc, argv); + } + + // Drop the trailing '?' +- pred.replace(pred.length() - 1, 1, ""); ++ pred->replace(pred->length() - 1, 1, ""); + +- pred.replace(0, 1, pred.at(0).upper()); +- pred.replace(0, 0, QString("is")); +- Smoke::Index meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, pred.latin1()); ++ pred->replace(0, 1, pred->at(0).upper()); ++ pred->replace(0, 0, QString("is")); ++ Smoke::Index meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, pred->latin1()); + + if (meth == 0) { +- pred.replace(0, 2, QString("has")); +- meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, pred.latin1()); ++ pred->replace(0, 2, QString("has")); ++ meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, pred->latin1()); + } + + if (meth > 0) { +- methodName = (char *) pred.latin1(); ++ methodName = (char *) pred->latin1(); + } + } + +@@ -1423,18 +1432,26 @@ + } + + { +- QCString mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); ++ QCString * mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); + + if (_current_method == -1) { + // Find the C++ method to call. Do that from Ruby for now + + VALUE retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+3, temp_stack); + if (_current_method == -1) { +- QRegExp rx("^[-+%/|]$"); +- QString op(rb_id2name(SYM2ID(argv[0]))); +- if (rx.search(op) != -1) { ++ char * op = rb_id2name(SYM2ID(argv[0])); ++ if ( qstrcmp(op, "-") == 0 ++ || qstrcmp(op, "+") == 0 ++ || qstrcmp(op, "/") == 0 ++ || qstrcmp(op, "%") == 0 ++ || qstrcmp(op, "|") == 0 ) ++ { + // Look for operator methods of the form 'operator+=', 'operator-=' and so on.. +- temp_stack[1] = rb_str_new2(op.append("=").latin1()); ++ char op1[3]; ++ op1[0] = op[0]; ++ op1[1] = '='; ++ op1[2] = '\0'; ++ temp_stack[1] = rb_str_new2(op1); + retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+3, temp_stack); + } + +@@ -1448,26 +1465,31 @@ + && isDerivedFrom(o->smoke, o->classId, o->smoke->idClass("QObject")) ) + { + QObject * qobject = (QObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject")); +- QString prop(rb_id2name(SYM2ID(argv[0]))); ++static QString * prop = 0; ++ if (prop == 0) { ++ prop = new QString(); ++ } ++ ++ *prop = rb_id2name(SYM2ID(argv[0])); + QMetaObject * meta = qobject->metaObject(); + if (argc == 1) { +- if (prop.endsWith("?")) { +- prop.replace(0, 1, pred.at(0).upper()); +- prop.replace(0, 0, QString("is")); +- if (meta->findProperty(prop.latin1(), true) == -1) { +- prop.replace(0, 2, QString("has")); ++ if (prop->endsWith("?")) { ++ prop->replace(0, 1, pred->at(0).upper()); ++ prop->replace(0, 0, QString("is")); ++ if (meta->findProperty(prop->latin1(), true) == -1) { ++ prop->replace(0, 2, QString("has")); + } + } + +- if (meta->findProperty(prop.latin1(), true) != -1) { +- VALUE qvariant = rb_funcall(self, rb_intern("property"), 1, rb_str_new2(prop.latin1())); ++ if (meta->findProperty(prop->latin1(), true) != -1) { ++ VALUE qvariant = rb_funcall(self, rb_intern("property"), 1, rb_str_new2(prop->latin1())); + return rb_funcall(qvariant, rb_intern("to_ruby"), 0); + } +- } else if (argc == 2 && prop.endsWith("=")) { +- prop.replace("=", ""); +- if (meta->findProperty(prop.latin1(), true) != -1) { ++ } else if (argc == 2 && prop->endsWith("=")) { ++ prop->replace("=", ""); ++ if (meta->findProperty(prop->latin1(), true) != -1) { + VALUE qvariant = rb_funcall(qvariant_class, rb_intern("new"), 1, argv[1]); +- return rb_funcall(self, rb_intern("setProperty"), 2, rb_str_new2(prop.latin1()), qvariant); ++ return rb_funcall(self, rb_intern("setProperty"), 2, rb_str_new2(prop->latin1()), qvariant); + } + } + } +@@ -1476,7 +1498,7 @@ + } + } + // Success. Cache result. +- methcache.insert((const char *)mcid, new Smoke::Index(_current_method)); ++ methcache.insert((const char *)*mcid, new Smoke::Index(_current_method)); + } + } + +@@ -1503,21 +1525,25 @@ + } + + { +- QCString mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); ++ QCString * mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); + + if (_current_method == -1) { + VALUE retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+3, temp_stack); + Q_UNUSED(retval); + if (_current_method != -1) { + // Success. Cache result. +- methcache.insert((const char *)mcid, new Smoke::Index(_current_method)); ++ methcache.insert((const char *)*mcid, new Smoke::Index(_current_method)); + } + } + } + + if (_current_method == -1) { +- QRegExp rx("[a-zA-Z]+"); +- if (rx.search(methodName) == -1) { ++static QRegExp * rx = 0; ++ if (rx == 0) { ++ rx = new QRegExp("[a-zA-Z]+"); ++ } ++ ++ if (rx->search(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)' + VALUE * method_stack = (VALUE *) calloc(argc - 1, sizeof(VALUE)); +@@ -1584,10 +1610,10 @@ + if (TYPE(self) == T_DATA) { + // If a ruby block was passed then run that now + if (rb_block_given_p()) { +- rb_funcall(qt_internal_module, rb_intern("run_initializer_block"), 2, self, rb_block_proc()); ++ rb_funcall(qt_internal_module, rb_intern("run_initializer_block"), 2, self, rb_block_proc()); + } + +- return self; ++ return self; + } + + VALUE klass = rb_funcall(self, rb_intern("class"), 0); +@@ -1599,19 +1625,19 @@ + temp_stack[2] = klass; + temp_stack[3] = self; + for (int count = 0; count < argc; count++) { +- temp_stack[count+4] = argv[count]; ++ temp_stack[count+4] = argv[count]; + } + + { + // Put this in a C block so that the mcid will be de-allocated at the end of the block, + // rather than on f'n exit, to avoid the longjmp problem described below +- QCString mcid = find_cached_selector(argc+4, temp_stack, klass, rb_class2name(klass)); ++ QCString * mcid = find_cached_selector(argc+4, temp_stack, klass, rb_class2name(klass)); + + if (_current_method == -1) { + retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+4, temp_stack); + if (_current_method != -1) { + // Success. Cache result. +- methcache.insert((const char *)mcid, new Smoke::Index(_current_method)); ++ methcache.insert((const char *)*mcid, new Smoke::Index(_current_method)); + } + } + } +@@ -1652,7 +1678,7 @@ + VALUE * temp_stack = (VALUE *) calloc(argc + 1, sizeof(VALUE)); + temp_stack[0] = rb_obj_alloc(klass); + for (int count = 0; count < argc; count++) { +- temp_stack[count+1] = argv[count]; ++ temp_stack[count+1] = argv[count]; + } + + VALUE result = rb_funcall2(qt_internal_module, rb_intern("try_initialize"), argc+1, temp_stack); +@@ -1668,16 +1694,16 @@ + VALUE result = Qnil; + + if (argc == 1 && TYPE(argv[0]) == T_ARRAY) { +- // Convert '(ARGV)' to '(NUM, [$0]+ARGV)' +- VALUE * local_argv = (VALUE *) calloc(argc + 1, sizeof(VALUE)); +- VALUE temp = rb_ary_dup(argv[0]); +- rb_ary_unshift(temp, rb_gv_get("$0")); +- local_argv[0] = INT2NUM(RARRAY(temp)->len); +- local_argv[1] = temp; +- result = new_qt(2, local_argv, klass); +- free(local_argv); ++ // Convert '(ARGV)' to '(NUM, [$0]+ARGV)' ++ VALUE * local_argv = (VALUE *) calloc(argc + 1, sizeof(VALUE)); ++ VALUE temp = rb_ary_dup(argv[0]); ++ rb_ary_unshift(temp, rb_gv_get("$0")); ++ local_argv[0] = INT2NUM(RARRAY(temp)->len); ++ local_argv[1] = temp; ++ result = new_qt(2, local_argv, klass); ++ free(local_argv); + } else { +- result = new_qt(argc, argv, klass); ++ result = new_qt(argc, argv, klass); + } + + rb_gv_set("$qApp", result); +@@ -1735,9 +1761,9 @@ + if(index < 0) return Qnil; + + if (isSignal) { +- member = rb_funcall(qt_internal_module, rb_intern("signalAt"), 2, self, INT2NUM(index)); ++ member = rb_funcall(qt_internal_module, rb_intern("signalAt"), 2, self, INT2NUM(index)); + } else { +- member = rb_funcall(qt_internal_module, rb_intern("slotAt"), 2, self, INT2NUM(index)); ++ member = rb_funcall(qt_internal_module, rb_intern("slotAt"), 2, self, INT2NUM(index)); + } + + VALUE mocArgs = rb_funcall(qt_internal_module, rb_intern("getMocArguments"), 1, member); +@@ -1815,7 +1841,12 @@ + } + + QString name(slotname); +- name.replace(QRegExp("\\(.*"), ""); ++static QRegExp * rx = 0; ++ if (rx == 0) { ++ rx = new QRegExp("\\(.*"); ++ } ++ name.replace(*rx, ""); ++ + InvokeSlot slot(self, rb_intern(name.latin1()), mocArgs, _o); + slot.next(); + +@@ -2568,7 +2599,10 @@ + { + VALUE klass = Qnil; + QString packageName(package); +- QRegExp scope_op("^([^:]+)::([^:]+)$"); ++static QRegExp * scope_op = 0; ++ if (scope_op == 0) { ++ scope_op = new QRegExp("^([^:]+)::([^:]+)$"); ++ } + + if (packageName.startsWith("KDE::ConfigSkeleton::ItemEnum::")) { + klass = rb_define_class_under(kconfigskeleton_itemenum_class, package+strlen("KDE::ConfigSkeleton::EnumItem::"), base_class); +@@ -2606,7 +2640,7 @@ + } else if (packageName.startsWith("Kontact::")) { + klass = rb_define_class_under(kontact_module, package+strlen("Kontact::"), base_class); + rb_define_singleton_method(klass, "new", (VALUE (*) (...)) _new_kde, -1); +- } else if (packageName.startsWith("Ko") && scope_op.search(packageName) == -1) { ++ } else if (packageName.startsWith("Ko") && scope_op->search(packageName) == -1) { + klass = rb_define_class_under(koffice_module, package+strlen("Ko"), base_class); + rb_define_singleton_method(klass, "new", (VALUE (*) (...)) _new_kde, -1); + } else if (packageName.startsWith("Kate::")) { +@@ -2618,11 +2652,11 @@ + } else if (packageName.startsWith("KTextEditor::")) { + klass = rb_define_class_under(ktexteditor_module, package+strlen("KTextEditor::"), base_class); + rb_define_singleton_method(klass, "new", (VALUE (*) (...)) _new_kde, -1); +- } else if (scope_op.search(packageName) != -1) { ++ } else if (scope_op->search(packageName) != -1) { + // If an unrecognised classname of the form 'XXXXXX::YYYYYY' is found, + // then create a module XXXXXX to put the class YYYYYY under +- VALUE module = rb_define_module(scope_op.cap(1).latin1()); +- klass = rb_define_class_under(module, scope_op.cap(2).latin1(), base_class); ++ VALUE module = rb_define_module(scope_op->cap(1).latin1()); ++ klass = rb_define_class_under(module, scope_op->cap(2).latin1(), base_class); + } else if ( packageName.startsWith("K") + && packageName.mid(1, 1).contains(QRegExp("[A-Z]")) == 1 ) + { +@@ -2792,6 +2826,7 @@ + + methcache.setAutoDelete(true); + classcache.setAutoDelete(true); ++ classname.setAutoDelete(true); + + if (qt_module == Qnil) { + qt_module = rb_define_module("Qt"); diff --git a/kde-base/korundum/korundum-3.5.4-r1.ebuild b/kde-base/korundum/korundum-3.5.4-r1.ebuild new file mode 100644 index 000000000000..ad4f423f649b --- /dev/null +++ b/kde-base/korundum/korundum-3.5.4-r1.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/korundum/korundum-3.5.4-r1.ebuild,v 1.1 2006/08/29 20:17:05 caleb Exp $ + +KMNAME=kdebindings +KMCOPYLIB="libsmokeqt smoke/qt libsmokekde smoke/kde" +KMCOMPILEONLY="qtruby" +KM_MAKEFILESREV=1 +MAXKDEVER=$PV +KM_DEPRANGE="$PV $MAXKDEVER" +inherit kde-meta + +DESCRIPTION="KDE ruby bindings" +HOMEPAGE="http://developer.kde.org/language-bindings/ruby/" + +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="" +OLDDEPEND=">=virtual/ruby-1.8 ~kde-base/qtruby-$PV ~kde-base/smoke-3.3.1" +DEPEND=" >=virtual/ruby-1.8 +$(deprange $PV $MAXKDEVER kde-base/qtruby) +$(deprange 3.5.2 $MAXKDEVER kde-base/smoke)" + +PATCHES="$FILESDIR/no-gtk-glib-check.diff $FILESDIR/qtruby-3.5.4-more.patch $FILESDIR/korundum-3.5.4-more.patch" + +# Because this installs into /usr/lib/ruby/..., it doesn't have SLOT=X.Y like the rest of KDE, +# and it installs into /usr entirely. +# Note that it still depends on a specific range of (slotted) smoke and qtruby versions. +SLOT="0" +src_compile() { + kde_src_compile myconf + myconf="$myconf --prefix=/usr" + kde_src_compile configure make +} + |