[Kde-bindings] [Bug 100123] require 'Korundum' conflicts with require 'Qt'

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sun May 29 11:04:03 UTC 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=100123         




------- Additional Comments From Richard_Dale tipitina demon co uk  2005-05-29 13:04 -------
SVN commit 419405 by rdale:

* At the moment require 'Qt' and require 'Korundum' statements can't appear
  in the same ruby program. Suitable fatal error messages are now displayed
  to indicate the cause of the problem. Fixes bug reported by Caleb Tennis
  and Dave M
CCMAIL: caleb gentoo org
CCMAIL: dave.m email it
CCBUGS: 100123


 M  +7 -0      korundum/ChangeLog  
 M  +6 -1      korundum/rubylib/korundum/Korundum.cpp  
 M  +11 -3     qtruby/rubylib/qtruby/Qt.cpp  


--- trunk/KDE/kdebindings/korundum/ChangeLog #419404:419405
 @ -1,3 +1,10  @
+2005-05-29  Richard Dale  <Richard_Dale tipitina demon co uk>
+
+	* At the moment require 'Qt' and require 'Korundum' statements can't appear
+	  in the same ruby program. Suitable fatal error messages are now displayed
+	  to indicate the cause of the problem. Fixes bug reported by Caleb Tennis
+	  and Dave M
+
 2005-05-21  Richard Dale  <Richard_Dale tipitina demon co uk>
 
 	* KDE::DCOPRef.methods now returns remote DCOP methods as well as the local methods in
--- trunk/KDE/kdebindings/korundum/rubylib/korundum/Korundum.cpp #419404:419405
 @ -1171,6 +1171,11  @
 void
 Init_korundum()
 {
+	if (qt_internal_module != Qnil) {
+		rb_fatal("require 'Korundum' must not follow require 'Qt'\n");
+		return;
+	}
+
 	set_new_kde(new_kde);
 #if KDE_VERSION >= 0x030200
 	set_kconfigskeletonitem_immutable(kconfigskeletonitem_immutable);
 @ -1179,7 +1184,7  @
 		
 	// The Qt extension is linked against libsmokeqt.so, but Korundum links against
 	// libsmokekde.so only. Specifying both a 'require Qt' and a 'require Korundum',
-	// would give a link error.
+	// would give a link error (see the rb_fatal() error above).
 	// So call the Init_qtruby() initialization function explicitely, not via 'require Qt'
 	// (Qt.o is linked into libqtruby.so, as well as the Qt.so extension).
 	Init_qtruby();
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/Qt.cpp #419404:419405
 @ -101,7 +101,7  @
 VALUE kconfigskeleton_itemenum_choice_class = Qnil;
 VALUE kio_udsatom_class = Qnil;
 VALUE kwin_class = Qnil;
-bool application_terminated = FALSE;
+bool application_terminated = false;
 };
 
 #define logger logger_backend
 @ -2582,12 +2582,20  @
 void
 Init_qtruby()
 {
+	if (qt_Smoke != 0L) {
+		// This function must have been called twice because both
+		// 'require Qt' and 'require Korundum' statements have
+		// been included in a ruby program
+		rb_fatal("require 'Qt' must not follow require 'Korundum'\n");
+		return;
+	}
+
     init_qt_Smoke();
     qt_Smoke->binding = new QtRubySmokeBinding(qt_Smoke);
     install_handlers(Qt_handlers);
 
-    methcache.setAutoDelete(1);
-    classcache.setAutoDelete(1);
+    methcache.setAutoDelete(true);
+    classcache.setAutoDelete(true);
 
 	if (qt_module == Qnil) {
 		qt_module = rb_define_module("Qt");



More information about the Kde-bindings mailing list