diff options
author | Caleb Tennis <caleb@gentoo.org> | 2006-08-29 20:14:33 +0000 |
---|---|---|
committer | Caleb Tennis <caleb@gentoo.org> | 2006-08-29 20:14:33 +0000 |
commit | 6ba12529d772f24c998c4e89c0379fa02af2af2b (patch) | |
tree | b4a7acdd428d6db95433590241678da7b7c8af58 /kde-base | |
parent | ppc stable, bug #144748 (diff) | |
download | historical-6ba12529d772f24c998c4e89c0379fa02af2af2b.tar.gz historical-6ba12529d772f24c998c4e89c0379fa02af2af2b.tar.bz2 historical-6ba12529d772f24c998c4e89c0379fa02af2af2b.zip |
Fix some memory leaks
Package-Manager: portage-2.1.1_pre5-r3
Diffstat (limited to 'kde-base')
-rw-r--r-- | kde-base/korundum/Manifest | 33 | ||||
-rw-r--r-- | kde-base/qtruby/ChangeLog | 8 | ||||
-rw-r--r-- | kde-base/qtruby/Manifest | 29 | ||||
-rw-r--r-- | kde-base/qtruby/files/digest-qtruby-3.5.4-r1 | 3 | ||||
-rw-r--r-- | kde-base/qtruby/files/qtruby-3.5.4-more.patch | 445 | ||||
-rw-r--r-- | kde-base/qtruby/qtruby-3.5.4-r1.ebuild | 30 |
6 files changed, 519 insertions, 29 deletions
diff --git a/kde-base/korundum/Manifest b/kde-base/korundum/Manifest index da6bb01ca0c8..d648c016f6b9 100644 --- a/kde-base/korundum/Manifest +++ b/kde-base/korundum/Manifest @@ -1,10 +1,15 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - +AUX korundum-3.5.4-more.patch 3415 RMD160 dae8c6c29d82266430c76851a5a8d47d0ead013a SHA1 26f5ac8d513796b8b3c7d8b5bc131e62e4b3fee2 SHA256 527b5d73909f5beae4b2eff561169c34a035117f578a00796a46f7f2649df453 +MD5 1b21b0196e7d3d14da48a80f5d8a7f7d files/korundum-3.5.4-more.patch 3415 +RMD160 dae8c6c29d82266430c76851a5a8d47d0ead013a files/korundum-3.5.4-more.patch 3415 +SHA256 527b5d73909f5beae4b2eff561169c34a035117f578a00796a46f7f2649df453 files/korundum-3.5.4-more.patch 3415 AUX no-gtk-glib-check.diff 949 RMD160 6df47b78e158fb7e38a49c30627421186d83e3da SHA1 234a650d3b629e41b2249ae99e6f7b0ee44fcf63 SHA256 f2721c8a1567ab9e259e216372a6552f8910fd33bc82390d8556aff00b0ba8df MD5 ffe26fb6d5d193883dfebd69250df2e5 files/no-gtk-glib-check.diff 949 RMD160 6df47b78e158fb7e38a49c30627421186d83e3da files/no-gtk-glib-check.diff 949 SHA256 f2721c8a1567ab9e259e216372a6552f8910fd33bc82390d8556aff00b0ba8df files/no-gtk-glib-check.diff 949 +AUX qtruby-3.5.4-more.patch 15979 RMD160 643ec2dc0f5a5104ea7c0da57248e1ca67cf6639 SHA1 16ed802d14dc9b50a838699da41db1712d9dda01 SHA256 b0ecf17f0496497e9b8e0c169308c887cae5436588350047d285fe2e0a73a1cd +MD5 951a869fa65e2e774a5643ab01c7b7c0 files/qtruby-3.5.4-more.patch 15979 +RMD160 643ec2dc0f5a5104ea7c0da57248e1ca67cf6639 files/qtruby-3.5.4-more.patch 15979 +SHA256 b0ecf17f0496497e9b8e0c169308c887cae5436588350047d285fe2e0a73a1cd files/qtruby-3.5.4-more.patch 15979 DIST kdebindings-3.4.3.tar.bz2 7184410 RMD160 559369596fae2ef5d15f6e56b6747c2492f1704f SHA1 d37c6c49122032cb207a7dae3986291c79a63cad SHA256 0c1cc98f6523267605c0c6666988ba7a6b7561f4e40dbbe95529469ac98f45d6 DIST kdebindings-3.5.2.tar.bz2 5416964 RMD160 670891a4848bd18d9ce629f675d1d2550b45307c SHA1 f1b0180d8005b9497cd8549f260b30f43e08ed4b SHA256 71ca8bf60cc9eb232ddfe5d6522e0051931b2f498ee0066edcb6c4900784f1c9 DIST kdebindings-3.5.3.tar.bz2 5416888 RMD160 68ca9b57e6de96773bee2a1934db766e36872737 SHA1 e8081576cfb148f508c31e6e3b075d75b11f3577 SHA256 eeb08caa9b419fddd5fb1c5fdd1da7af3cf34ff57e605ed0ea1668d9272dda50 @@ -21,14 +26,18 @@ EBUILD korundum-3.5.3.ebuild 1115 RMD160 48b0b82824d461849326029ced817e0297a6b7f MD5 09e72b21c6e3ce282a211953e186ea12 korundum-3.5.3.ebuild 1115 RMD160 48b0b82824d461849326029ced817e0297a6b7fe korundum-3.5.3.ebuild 1115 SHA256 bb31c3e2c7947bbecb9127e43ace0a54b506f8551586d0e23f7093c1bebd7a68 korundum-3.5.3.ebuild 1115 +EBUILD korundum-3.5.4-r1.ebuild 1186 RMD160 b4ccb5100c1fcf1d1943a104acb03b51add3e842 SHA1 2c15e5ea8d3a087d027dbf589fe077bb294b977a SHA256 40ccf6a5405df20c39cad49291b054198d4b7992068877218ff469b6cccea45b +MD5 67cd143d01fb3a800e6e2057725b2799 korundum-3.5.4-r1.ebuild 1186 +RMD160 b4ccb5100c1fcf1d1943a104acb03b51add3e842 korundum-3.5.4-r1.ebuild 1186 +SHA256 40ccf6a5405df20c39cad49291b054198d4b7992068877218ff469b6cccea45b korundum-3.5.4-r1.ebuild 1186 EBUILD korundum-3.5.4.ebuild 1115 RMD160 a6ff623a7efc65de87cff3edda2e7c90406b8806 SHA1 167811476743185e44b7f6fe9f40096e0c8efb96 SHA256 5086fa9694b715b7b62361527db6884dc1abb8d7efbb228ee57073547f260b9d MD5 ce162390ae8527d232086674cbb98709 korundum-3.5.4.ebuild 1115 RMD160 a6ff623a7efc65de87cff3edda2e7c90406b8806 korundum-3.5.4.ebuild 1115 SHA256 5086fa9694b715b7b62361527db6884dc1abb8d7efbb228ee57073547f260b9d korundum-3.5.4.ebuild 1115 -MISC ChangeLog 6050 RMD160 daed420d945cadecdb4bbbdebe0dd1dadd23436e SHA1 c2709ff5130504c18384a4763f5c25517ebc0b6f SHA256 8b71762d1411b04b79cbb58a25544172eb47c5c7fa3f3930af2159a33bfd59e9 -MD5 606c71af30c01035c10b7668ee6defa6 ChangeLog 6050 -RMD160 daed420d945cadecdb4bbbdebe0dd1dadd23436e ChangeLog 6050 -SHA256 8b71762d1411b04b79cbb58a25544172eb47c5c7fa3f3930af2159a33bfd59e9 ChangeLog 6050 +MISC ChangeLog 6245 RMD160 c70ca3c17a05a0f52b961af9aca0c785cd1006a5 SHA1 52ccff1979f519234088ecbb4b12448276082383 SHA256 51c4c8043733944bdc44ff44fd5a5fd20142a16c318214eb74176f6c728c4fd0 +MD5 4dd320e92b6e2a5e11b572aef612c5d4 ChangeLog 6245 +RMD160 c70ca3c17a05a0f52b961af9aca0c785cd1006a5 ChangeLog 6245 +SHA256 51c4c8043733944bdc44ff44fd5a5fd20142a16c318214eb74176f6c728c4fd0 ChangeLog 6245 MISC metadata.xml 156 RMD160 ecce3b981f150c45ae1e84e2d208e678d6124259 SHA1 b64f7c0b4e5db816d82ad19848f72118af129d35 SHA256 2f4da28506b9d4185f320f67a6191d30c7a921217ed4447ed46ea0bc4aefc79a MD5 acc03a4b12bb0433a57e95bd253b9501 metadata.xml 156 RMD160 ecce3b981f150c45ae1e84e2d208e678d6124259 metadata.xml 156 @@ -45,10 +54,6 @@ SHA256 b503b071b0fc92be80bf03101b99a4de1f7f621cd58788a86bb702c4f1985628 files/di MD5 851a87b85a25cfe922a8cfb170ff0bcf files/digest-korundum-3.5.4 259 RMD160 44bf0b0d81a2e5951041d556ee533b0cc44c5d36 files/digest-korundum-3.5.4 259 SHA256 04bba1bfcf6ff17b91639a5e88419f2bed35bde91374c3c270a59979e00fdae8 files/digest-korundum-3.5.4 259 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.5-ecc0.1.6 (GNU/Linux) - -iD8DBQFE5d+FKRy60XGEcJIRAk/UAKCg3X67vfdCSFPh9koDOBDFAQgqgQCeOqyf -LADxMefQJDwJyc/SznNoTBk= -=Vbxk ------END PGP SIGNATURE----- +MD5 851a87b85a25cfe922a8cfb170ff0bcf files/digest-korundum-3.5.4-r1 259 +RMD160 44bf0b0d81a2e5951041d556ee533b0cc44c5d36 files/digest-korundum-3.5.4-r1 259 +SHA256 04bba1bfcf6ff17b91639a5e88419f2bed35bde91374c3c270a59979e00fdae8 files/digest-korundum-3.5.4-r1 259 diff --git a/kde-base/qtruby/ChangeLog b/kde-base/qtruby/ChangeLog index e7f4b8d18950..33911e99f0b8 100644 --- a/kde-base/qtruby/ChangeLog +++ b/kde-base/qtruby/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for kde-base/qtruby # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/qtruby/ChangeLog,v 1.42 2006/08/18 15:39:16 gustavoz Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/qtruby/ChangeLog,v 1.43 2006/08/29 20:14:32 caleb Exp $ + +*qtruby-3.5.4-r1 (29 Aug 2006) + + 29 Aug 2006; Caleb Tennis <caleb@gentoo.org> + +files/qtruby-3.5.4-more.patch, +qtruby-3.5.4-r1.ebuild: + Fix some memory leaks 18 Aug 2006; Gustavo Zacarias <gustavoz@gentoo.org> qtruby-3.5.2.ebuild, qtruby-3.5.3.ebuild, qtruby-3.5.4.ebuild: diff --git a/kde-base/qtruby/Manifest b/kde-base/qtruby/Manifest index cc6aec13492c..0eea113a8e5d 100644 --- a/kde-base/qtruby/Manifest +++ b/kde-base/qtruby/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - AUX no-gtk-glib-check.diff 949 RMD160 6df47b78e158fb7e38a49c30627421186d83e3da SHA1 234a650d3b629e41b2249ae99e6f7b0ee44fcf63 SHA256 f2721c8a1567ab9e259e216372a6552f8910fd33bc82390d8556aff00b0ba8df MD5 ffe26fb6d5d193883dfebd69250df2e5 files/no-gtk-glib-check.diff 949 RMD160 6df47b78e158fb7e38a49c30627421186d83e3da files/no-gtk-glib-check.diff 949 @@ -13,6 +10,10 @@ AUX qtruby-3.4.1-handlers.diff 379 RMD160 96fae8bd8995db1b6acfe515bd7e0e461470cf MD5 d859fab9468c7c54cc414ab700d5a16c files/qtruby-3.4.1-handlers.diff 379 RMD160 96fae8bd8995db1b6acfe515bd7e0e461470cf11 files/qtruby-3.4.1-handlers.diff 379 SHA256 20a7616ea3500862521ed92fb74c62dbcd7b248773bc37fa8474f506cb3ee3b3 files/qtruby-3.4.1-handlers.diff 379 +AUX qtruby-3.5.4-more.patch 15979 RMD160 643ec2dc0f5a5104ea7c0da57248e1ca67cf6639 SHA1 16ed802d14dc9b50a838699da41db1712d9dda01 SHA256 b0ecf17f0496497e9b8e0c169308c887cae5436588350047d285fe2e0a73a1cd +MD5 951a869fa65e2e774a5643ab01c7b7c0 files/qtruby-3.5.4-more.patch 15979 +RMD160 643ec2dc0f5a5104ea7c0da57248e1ca67cf6639 files/qtruby-3.5.4-more.patch 15979 +SHA256 b0ecf17f0496497e9b8e0c169308c887cae5436588350047d285fe2e0a73a1cd files/qtruby-3.5.4-more.patch 15979 DIST kdebindings-3.4.3.tar.bz2 7184410 RMD160 559369596fae2ef5d15f6e56b6747c2492f1704f SHA1 d37c6c49122032cb207a7dae3986291c79a63cad SHA256 0c1cc98f6523267605c0c6666988ba7a6b7561f4e40dbbe95529469ac98f45d6 DIST kdebindings-3.5.2.tar.bz2 5416964 RMD160 670891a4848bd18d9ce629f675d1d2550b45307c SHA1 f1b0180d8005b9497cd8549f260b30f43e08ed4b SHA256 71ca8bf60cc9eb232ddfe5d6522e0051931b2f498ee0066edcb6c4900784f1c9 DIST kdebindings-3.5.3.tar.bz2 5416888 RMD160 68ca9b57e6de96773bee2a1934db766e36872737 SHA1 e8081576cfb148f508c31e6e3b075d75b11f3577 SHA256 eeb08caa9b419fddd5fb1c5fdd1da7af3cf34ff57e605ed0ea1668d9272dda50 @@ -29,14 +30,18 @@ EBUILD qtruby-3.5.3.ebuild 940 RMD160 6a2a3650e530740a9ea97449673301083d855518 S MD5 51a7066933a6dcc419ae2ca65dfd9698 qtruby-3.5.3.ebuild 940 RMD160 6a2a3650e530740a9ea97449673301083d855518 qtruby-3.5.3.ebuild 940 SHA256 4cbd8be2eb96e6af0bc1a2ab769e87f317b6643a92575f28f4bb2cd244b11b05 qtruby-3.5.3.ebuild 940 +EBUILD qtruby-3.5.4-r1.ebuild 974 RMD160 528c41d077fbca12ead8a38aac084a3a34fb276b SHA1 e08490584820b20a42783dacb9e355d616764281 SHA256 a89d9b5dcccf1e9cd88c299dfe918cc967aaeade2505d95cab7f51077e7306bc +MD5 951e96d0453623dd0712191106d2423e qtruby-3.5.4-r1.ebuild 974 +RMD160 528c41d077fbca12ead8a38aac084a3a34fb276b qtruby-3.5.4-r1.ebuild 974 +SHA256 a89d9b5dcccf1e9cd88c299dfe918cc967aaeade2505d95cab7f51077e7306bc qtruby-3.5.4-r1.ebuild 974 EBUILD qtruby-3.5.4.ebuild 940 RMD160 7b1faa54aa92e68500e3f106a132184871d8a449 SHA1 a739a8beaf045e4ba2a511b9b54af6e60fa52642 SHA256 90f36947bc63b6db0e204f8982cc95b5d1fa401dfb5ca07ae31327169aafcc57 MD5 bf5484a6f19b0b41f8d6f6b842d5bfb6 qtruby-3.5.4.ebuild 940 RMD160 7b1faa54aa92e68500e3f106a132184871d8a449 qtruby-3.5.4.ebuild 940 SHA256 90f36947bc63b6db0e204f8982cc95b5d1fa401dfb5ca07ae31327169aafcc57 qtruby-3.5.4.ebuild 940 -MISC ChangeLog 6041 RMD160 2e3cf67fbd76ef53c25b54580eb5a8604c56af3e SHA1 7ac5400c58d01378b57a6102f3988b7f0053558f SHA256 57bab2a599c753f9d5236480b5a05124b170228b44241d93700d81eedf619489 -MD5 056229946296a23641220238353be107 ChangeLog 6041 -RMD160 2e3cf67fbd76ef53c25b54580eb5a8604c56af3e ChangeLog 6041 -SHA256 57bab2a599c753f9d5236480b5a05124b170228b44241d93700d81eedf619489 ChangeLog 6041 +MISC ChangeLog 6201 RMD160 7fc0e5c5836b5c25c10e157e788f489f0e907d86 SHA1 636773e9ccb9c57b6bec2311bb4a4f40ea86ab2e SHA256 8ad7d995b71b7cc138bf2851b1e564cb74eac836526ff9e0ef94a985c3cd03e0 +MD5 8edbe8741426ab57a8601dfb4a740487 ChangeLog 6201 +RMD160 7fc0e5c5836b5c25c10e157e788f489f0e907d86 ChangeLog 6201 +SHA256 8ad7d995b71b7cc138bf2851b1e564cb74eac836526ff9e0ef94a985c3cd03e0 ChangeLog 6201 MISC metadata.xml 156 RMD160 ecce3b981f150c45ae1e84e2d208e678d6124259 SHA1 b64f7c0b4e5db816d82ad19848f72118af129d35 SHA256 2f4da28506b9d4185f320f67a6191d30c7a921217ed4447ed46ea0bc4aefc79a MD5 acc03a4b12bb0433a57e95bd253b9501 metadata.xml 156 RMD160 ecce3b981f150c45ae1e84e2d208e678d6124259 metadata.xml 156 @@ -53,10 +58,6 @@ SHA256 b503b071b0fc92be80bf03101b99a4de1f7f621cd58788a86bb702c4f1985628 files/di MD5 851a87b85a25cfe922a8cfb170ff0bcf files/digest-qtruby-3.5.4 259 RMD160 44bf0b0d81a2e5951041d556ee533b0cc44c5d36 files/digest-qtruby-3.5.4 259 SHA256 04bba1bfcf6ff17b91639a5e88419f2bed35bde91374c3c270a59979e00fdae8 files/digest-qtruby-3.5.4 259 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.5-ecc0.1.6 (GNU/Linux) - -iD8DBQFE5d8xKRy60XGEcJIRApFQAJ9YhBcnyOsSwhKF7ecUxXnpwQGb1QCfV56d -GbrpT+s2MiSqbm7ddbDqGcw= -=k/KW ------END PGP SIGNATURE----- +MD5 851a87b85a25cfe922a8cfb170ff0bcf files/digest-qtruby-3.5.4-r1 259 +RMD160 44bf0b0d81a2e5951041d556ee533b0cc44c5d36 files/digest-qtruby-3.5.4-r1 259 +SHA256 04bba1bfcf6ff17b91639a5e88419f2bed35bde91374c3c270a59979e00fdae8 files/digest-qtruby-3.5.4-r1 259 diff --git a/kde-base/qtruby/files/digest-qtruby-3.5.4-r1 b/kde-base/qtruby/files/digest-qtruby-3.5.4-r1 new file mode 100644 index 000000000000..14931d41e70d --- /dev/null +++ b/kde-base/qtruby/files/digest-qtruby-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/qtruby/files/qtruby-3.5.4-more.patch b/kde-base/qtruby/files/qtruby-3.5.4-more.patch new file mode 100644 index 000000000000..614f495fbaeb --- /dev/null +++ b/kde-base/qtruby/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/qtruby/qtruby-3.5.4-r1.ebuild b/kde-base/qtruby/qtruby-3.5.4-r1.ebuild new file mode 100644 index 000000000000..5295bcdea29e --- /dev/null +++ b/kde-base/qtruby/qtruby-3.5.4-r1.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/qtruby/qtruby-3.5.4-r1.ebuild,v 1.1 2006/08/29 20:14:32 caleb Exp $ + +KMNAME=kdebindings +KMCOPYLIB="libsmokeqt smoke/qt" +KM_MAKEFILESREV=1 +MAXKDEVER=$PV +KM_DEPRANGE="$PV $MAXKDEVER" +inherit kde-meta + +DESCRIPTION="Ruby bindings for QT" +HOMEPAGE="http://developer.kde.org/language-bindings/ruby/" + +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="" +DEPEND=" >=virtual/ruby-1.8 +$(deprange 3.5.2 $MAXKDEVER kde-base/smoke)" + +PATCHES="$FILESDIR/no-gtk-glib-check.diff $FILESDIR/qtruby-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 versions. +SLOT="0" +src_compile() { + kde_src_compile myconf + myconf="$myconf --prefix=/usr" + kde_src_compile configure make +} |