qtbindings 4.8.6.1 → 4.8.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1344,14 +1344,21 @@ initialize_qt(int argc, VALUE * argv, VALUE self)
1344
1344
  {
1345
1345
  VALUE retval = Qnil;
1346
1346
  VALUE temp_obj;
1347
-
1347
+ static VALUE mainThread = Qnil;
1348
+ if (mainThread == Qnil) {
1349
+ mainThread = rb_thread_main();
1350
+ }
1348
1351
  if (TYPE(self) == T_DATA) {
1349
1352
  // If a ruby block was passed then run that now
1350
1353
  if (rb_block_given_p()) {
1351
1354
  rb_funcall(qt_internal_module, rb_intern("run_initializer_block"), 2, self, rb_block_proc());
1352
1355
  }
1353
1356
  return self;
1354
- }
1357
+ } else {
1358
+ if (rb_thread_current() != mainThread) {
1359
+ rb_raise(rb_eRuntimeError, "Qt methods cannot be called from outside of the main thread");
1360
+ }
1361
+ }
1355
1362
 
1356
1363
  VALUE klass = rb_funcall(self, rb_intern("class"), 0);
1357
1364
  VALUE constructor_name = rb_str_new2("new");
File without changes
@@ -241,7 +241,7 @@ module Qt
241
241
  Qt::Internal::getAllParents(classid, ids)
242
242
  ids << classid
243
243
  ids.each { |c| Qt::Internal::findAllMethodNames(meths, c, flags) }
244
- return meths.uniq
244
+ return meths.uniq.map! {|a| a.intern}
245
245
  end
246
246
  end # Qt::Base
247
247
 
@@ -2505,6 +2505,8 @@ module Qt
2505
2505
  @@classes = {}
2506
2506
  @@cpp_names = {}
2507
2507
  @@idclass = []
2508
+ # Initialize all instances to false since nil can be a valid entry
2509
+ @@method_lookup_cache = Hash.new(false)
2508
2510
 
2509
2511
  @@normalize_procs = []
2510
2512
 
@@ -2577,7 +2579,7 @@ module Qt
2577
2579
 
2578
2580
  def Internal.checkarg(argtype, typename)
2579
2581
  const_point = typename =~ /^const\s+/ ? -1 : 0
2580
- if argtype == 'i'
2582
+ if argtype == 'i'.freeze
2581
2583
  if typename =~ /^int&?$|^signed int&?$|^signed$|^qint32&?$/
2582
2584
  return 6 + const_point
2583
2585
  elsif typename =~ /^quint32&?$/
@@ -2593,7 +2595,7 @@ module Qt
2593
2595
  return 2
2594
2596
  end
2595
2597
  end
2596
- elsif argtype == 'n'
2598
+ elsif argtype == 'n'.freeze
2597
2599
  if typename =~ /^double$|^qreal$/
2598
2600
  return 6 + const_point
2599
2601
  elsif typename =~ /^float$/
@@ -2609,11 +2611,11 @@ module Qt
2609
2611
  return 2 + const_point
2610
2612
  end
2611
2613
  end
2612
- elsif argtype == 'B'
2614
+ elsif argtype == 'B'.freeze
2613
2615
  if typename =~ /^(?:bool)[*&]?$/
2614
2616
  return 2 + const_point
2615
2617
  end
2616
- elsif argtype == 's'
2618
+ elsif argtype == 's'.freeze
2617
2619
  if typename =~ /^(const )?((QChar)[*&]?)$/
2618
2620
  return 6 + const_point
2619
2621
  elsif typename =~ /^(?:(u(nsigned )?)?char\*)$/
@@ -2623,7 +2625,7 @@ module Qt
2623
2625
  elsif typename =~ /^(?:(?:const )?(QString)[*&]?)$/
2624
2626
  return 8 + const_point
2625
2627
  end
2626
- elsif argtype == 'a'
2628
+ elsif argtype == 'a'.freeze
2627
2629
  # FIXME: shouldn't be hardcoded. Installed handlers should tell what ruby type they expect.
2628
2630
  if typename =~ /^(?:
2629
2631
  const\ QCOORD\*|
@@ -2637,7 +2639,7 @@ module Qt
2637
2639
  )$/x
2638
2640
  return 2 + const_point
2639
2641
  end
2640
- elsif argtype == 'u'
2642
+ elsif argtype == 'u'.freeze
2641
2643
  # Give nil matched against string types a higher score than anything else
2642
2644
  if typename =~ /^(?:u?char\*|const u?char\*|(?:const )?((Q(C?)String))[*&]?)$/
2643
2645
  return 4 + const_point
@@ -2647,7 +2649,7 @@ module Qt
2647
2649
  else
2648
2650
  return 2 + const_point
2649
2651
  end
2650
- elsif argtype == 'U'
2652
+ elsif argtype == 'U'.freeze
2651
2653
  if typename =~ /QStringList/
2652
2654
  return 4 + const_point
2653
2655
  else
@@ -2724,10 +2726,17 @@ module Qt
2724
2726
  end
2725
2727
  end
2726
2728
  end
2729
+ lookup_str = "#{classname}::#{method}::#{args.collect {|arg| arg.class.to_s} }"
2730
+ lookup = @@method_lookup_cache[lookup_str]
2731
+ # @@method_lookup_cache is initialized to return false values on a cache miss
2732
+ if lookup != false
2733
+ setCurrentMethod(lookup) if lookup
2734
+ return nil
2735
+ end
2727
2736
 
2728
2737
  # Modify constructor method name from new to the name of the Qt class
2729
2738
  # and remove any namespacing
2730
- if method == "new"
2739
+ if method == "new".freeze
2731
2740
  method = classname.dup
2732
2741
  method.gsub!(/^.*::/,"")
2733
2742
  end
@@ -2737,7 +2746,7 @@ module Qt
2737
2746
  method = "operator" + method.sub("@","") if method !~ /[a-zA-Z]+/
2738
2747
 
2739
2748
  # Change foobar= to setFoobar()
2740
- method = 'set' + method[0,1].upcase + method[1,method.length].sub("=", "") if method =~ /.*[^-+%\/|=]=$/ && method != 'operator='
2749
+ method = 'set' + method[0,1].upcase + method[1,method.length].sub("=", "") if method =~ /.*[^-+%\/|=]=$/ && method != 'operator='.freeze
2741
2750
 
2742
2751
  # Build list of munged method names which is the methodname followed
2743
2752
  # by symbols that indicate the basic type of the method's arguments
@@ -2843,6 +2852,7 @@ module Qt
2843
2852
  end
2844
2853
 
2845
2854
  # Select the chosen method
2855
+ @@method_lookup_cache[lookup_str] = chosen
2846
2856
  setCurrentMethod(chosen) if chosen
2847
2857
  return nil
2848
2858
  end
@@ -3253,6 +3263,6 @@ class Module
3253
3263
  end
3254
3264
  ids << classid
3255
3265
  ids.each { |c| Qt::Internal::findAllMethodNames(meths, c, flags) }
3256
- return meths.uniq
3266
+ return meths.uniq.map! {|a| a.intern}
3257
3267
  end
3258
3268
  end
@@ -1,2 +1,2 @@
1
- QTBINDINGS_VERSION = '4.8.6.1'
2
- QTBINDINGS_RELEASE_DATE = '2015-03-26 11:48:16 -0600'
1
+ QTBINDINGS_VERSION = '4.8.6.2'
2
+ QTBINDINGS_RELEASE_DATE = '2015-05-08 08:23:33 -0600'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qtbindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.6.1
4
+ version: 4.8.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Melton
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-03-26 00:00:00.000000000 Z
14
+ date: 2015-05-08 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: qtbindings provides ruby bindings to QT4.x. It is derived from the kdebindings
17
17
  project.
@@ -26,12 +26,15 @@ extensions:
26
26
  - extconf.rb
27
27
  extra_rdoc_files: []
28
28
  files:
29
- - CHANGELOG.txt
30
- - COPYING.LIB.txt
31
- - COPYING.txt
32
- - KNOWN_ISSUES.txt
33
- - Rakefile
34
- - TODO.txt
29
+ - lib/Qt/qtruby4.rb
30
+ - lib/Qt.rb
31
+ - lib/Qt4.rb
32
+ - lib/qtbindings_version.rb
33
+ - lib/qtdeclarative/qtdeclarative.rb
34
+ - lib/qtscript/qtscript.rb
35
+ - lib/qttest/qttest.rb
36
+ - lib/qtuitools/qtuitools.rb
37
+ - lib/qtwebkit/qtwebkit.rb
35
38
  - bin/rbqtapi
36
39
  - bin/rbrcc
37
40
  - bin/rbuic4
@@ -116,8 +119,8 @@ files:
116
119
  - examples/itemviews/chart/qtdata.cht
117
120
  - examples/itemviews/dirview/main.rb
118
121
  - examples/itemviews/pixelator/imagemodel.rb
119
- - examples/itemviews/pixelator/images.qrc
120
122
  - examples/itemviews/pixelator/images/qt.png
123
+ - examples/itemviews/pixelator/images.qrc
121
124
  - examples/itemviews/pixelator/main.rb
122
125
  - examples/itemviews/pixelator/mainwindow.rb
123
126
  - examples/itemviews/pixelator/makefile
@@ -287,13 +290,12 @@ files:
287
290
  - examples/richtext/syntaxhighlighter/highlighter.rb
288
291
  - examples/richtext/syntaxhighlighter/main.rb
289
292
  - examples/richtext/syntaxhighlighter/mainwindow.rb
290
- - examples/ruboids/LICENSE.txt
291
- - examples/ruboids/Manifest
292
- - examples/ruboids/README
293
- - examples/ruboids/TODO
294
293
  - examples/ruboids/boids.properties
295
294
  - examples/ruboids/generateManifest.rb
296
295
  - examples/ruboids/index.html
296
+ - examples/ruboids/LICENSE.txt
297
+ - examples/ruboids/Manifest
298
+ - examples/ruboids/README
297
299
  - examples/ruboids/release.rb
298
300
  - examples/ruboids/ruboids/Boid.rb
299
301
  - examples/ruboids/ruboids/BoidView.rb
@@ -304,15 +306,16 @@ files:
304
306
  - examples/ruboids/ruboids/CloudView.rb
305
307
  - examples/ruboids/ruboids/Flock.rb
306
308
  - examples/ruboids/ruboids/Graphics.rb
309
+ - examples/ruboids/ruboids/info.rb
307
310
  - examples/ruboids/ruboids/Params.rb
308
311
  - examples/ruboids/ruboids/Point.rb
312
+ - examples/ruboids/ruboids/ruboids.rb
309
313
  - examples/ruboids/ruboids/Thing.rb
310
314
  - examples/ruboids/ruboids/Triangle.rb
311
315
  - examples/ruboids/ruboids/View.rb
312
316
  - examples/ruboids/ruboids/World.rb
313
317
  - examples/ruboids/ruboids/WorldWindow.rb
314
- - examples/ruboids/ruboids/info.rb
315
- - examples/ruboids/ruboids/ruboids.rb
318
+ - examples/ruboids/TODO
316
319
  - examples/run_all.rb
317
320
  - examples/threading/main_thread.rb
318
321
  - examples/tutorial/t1/t1.rb
@@ -426,18 +429,17 @@ files:
426
429
  - examples/xml/saxbookmarks/mainwindow.rb
427
430
  - examples/xml/saxbookmarks/xbelgenerator.rb
428
431
  - examples/xml/saxbookmarks/xbelhandler.rb
429
- - ext/CMakeLists.txt
430
432
  - ext/cmake/modules/BasicFindPackageVersion.cmake.in
433
+ - ext/cmake/modules/CheckCXXSourceCompiles.cmake
431
434
  - ext/cmake/modules/CMakeCSharpCompiler.cmake.in
432
435
  - ext/cmake/modules/CMakeCSharpInformation.cmake
433
436
  - ext/cmake/modules/CMakeDetermineCSharpCompiler.cmake
434
437
  - ext/cmake/modules/CMakeTestCSharpCompiler.cmake
435
- - ext/cmake/modules/CheckCXXSourceCompiles.cmake
436
438
  - ext/cmake/modules/FindLibraryWithDebug.cmake
437
439
  - ext/cmake/modules/FindMono.cmake
438
- - ext/cmake/modules/FindPHP5.cmake
439
440
  - ext/cmake/modules/FindPerlMore.cmake
440
441
  - ext/cmake/modules/FindPhonon.cmake
442
+ - ext/cmake/modules/FindPHP5.cmake
441
443
  - ext/cmake/modules/FindQImageBlitz.cmake
442
444
  - ext/cmake/modules/FindQScintilla.cmake
443
445
  - ext/cmake/modules/FindQt4.cmake
@@ -453,7 +455,7 @@ files:
453
455
  - ext/cmake/modules/Qt4ConfigDependentSettings.cmake
454
456
  - ext/cmake/modules/Qt4Macros.cmake
455
457
  - ext/cmake/modules/SmokeConfig.cmake.in
456
- - ext/generator/CMakeLists.txt
458
+ - ext/CMakeLists.txt
457
459
  - ext/generator/cmake/BasicFindPackageVersion.cmake.in
458
460
  - ext/generator/cmake/CMakeLists.txt
459
461
  - ext/generator/cmake/FindLibraryWithDebug.cmake
@@ -467,6 +469,7 @@ files:
467
469
  - ext/generator/cmake/MacroOptionalFindPackage.cmake
468
470
  - ext/generator/cmake/MacroWriteBasicCMakeVersionFile.cmake
469
471
  - ext/generator/cmake/SmokeConfig.cmake.in
472
+ - ext/generator/CMakeLists.txt
470
473
  - ext/generator/config.h
471
474
  - ext/generator/generator_export.h
472
475
  - ext/generator/generatorenvironment.cpp
@@ -489,10 +492,10 @@ files:
489
492
  - ext/generator/name_compiler.h
490
493
  - ext/generator/options.cpp
491
494
  - ext/generator/options.h
492
- - ext/generator/parser/CMakeLists.txt
493
495
  - ext/generator/parser/ast.cpp
494
496
  - ext/generator/parser/ast.h
495
497
  - ext/generator/parser/astutilities.h
498
+ - ext/generator/parser/CMakeLists.txt
496
499
  - ext/generator/parser/codegenerator.cpp
497
500
  - ext/generator/parser/codegenerator.h
498
501
  - ext/generator/parser/codemodel_fwd.h
@@ -524,14 +527,14 @@ files:
524
527
  - ext/generator/parser/parsesession.cpp
525
528
  - ext/generator/parser/parsesession.h
526
529
  - ext/generator/parser/problem.h
527
- - ext/generator/parser/rpp/CMakeLists.txt
528
- - ext/generator/parser/rpp/Makefile.am
529
530
  - ext/generator/parser/rpp/anchor.h
530
531
  - ext/generator/parser/rpp/appendedlist.h
531
532
  - ext/generator/parser/rpp/chartools.cpp
532
533
  - ext/generator/parser/rpp/chartools.h
534
+ - ext/generator/parser/rpp/CMakeLists.txt
533
535
  - ext/generator/parser/rpp/macrorepository.cpp
534
536
  - ext/generator/parser/rpp/macrorepository.h
537
+ - ext/generator/parser/rpp/Makefile.am
535
538
  - ext/generator/parser/rpp/pp-configuration
536
539
  - ext/generator/parser/rpp/pp-engine.cpp
537
540
  - ext/generator/parser/rpp/pp-engine.h
@@ -597,20 +600,18 @@ files:
597
600
  - ext/ruby/qtdeclarative/qtdeclarative.rb
598
601
  - ext/ruby/qtdeclarative/qtdeclarativehandlers.cpp
599
602
  - ext/ruby/qtruby/AUTHORS
603
+ - ext/ruby/qtruby/bin/CMakeLists.txt
604
+ - ext/ruby/qtruby/bin/rbqtapi
605
+ - ext/ruby/qtruby/ChangeLog
600
606
  - ext/ruby/qtruby/CMakeLists.txt
601
607
  - ext/ruby/qtruby/COPYING
602
608
  - ext/ruby/qtruby/COPYING.LIB
603
- - ext/ruby/qtruby/ChangeLog
604
609
  - ext/ruby/qtruby/INSTALL
605
- - ext/ruby/qtruby/README
606
- - ext/ruby/qtruby/TODO
607
- - ext/ruby/qtruby/bin/CMakeLists.txt
608
- - ext/ruby/qtruby/bin/rbqtapi
609
- - ext/ruby/qtruby/rails_support/CMakeLists.txt
610
610
  - ext/ruby/qtruby/rails_support/active_item_model.rb
611
611
  - ext/ruby/qtruby/rails_support/active_table_model.rb
612
+ - ext/ruby/qtruby/rails_support/CMakeLists.txt
613
+ - ext/ruby/qtruby/README
612
614
  - ext/ruby/qtruby/src/CMakeLists.txt
613
- - ext/ruby/qtruby/src/Qt.cpp
614
615
  - ext/ruby/qtruby/src/handlers.cpp
615
616
  - ext/ruby/qtruby/src/marshall.h
616
617
  - ext/ruby/qtruby/src/marshall_basetypes.h
@@ -619,22 +620,21 @@ files:
619
620
  - ext/ruby/qtruby/src/marshall_primitives.h
620
621
  - ext/ruby/qtruby/src/marshall_types.cpp
621
622
  - ext/ruby/qtruby/src/marshall_types.h
623
+ - ext/ruby/qtruby/src/Qt.cpp
622
624
  - ext/ruby/qtruby/src/qtruby.cpp
623
625
  - ext/ruby/qtruby/src/qtruby.h
624
626
  - ext/ruby/qtruby/src/smokeruby.h
625
627
  - ext/ruby/qtruby/test/opoverloading.rb
626
628
  - ext/ruby/qtruby/test/unittests.rb
629
+ - ext/ruby/qtruby/TODO
627
630
  - ext/ruby/qtruby/tools/CMakeLists.txt
628
631
  - ext/ruby/qtruby/tools/rbrcc/CMakeLists.txt
629
- - ext/ruby/qtruby/tools/rbrcc/Messages.sh
630
632
  - ext/ruby/qtruby/tools/rbrcc/main.cpp
633
+ - ext/ruby/qtruby/tools/rbrcc/Messages.sh
631
634
  - ext/ruby/qtruby/tools/rbrcc/rbrcc.pro
632
635
  - ext/ruby/qtruby/tools/rbrcc/rcc.cpp
633
636
  - ext/ruby/qtruby/tools/rbrcc/rcc.h
634
637
  - ext/ruby/qtruby/tools/rbuic/CMakeLists.txt
635
- - ext/ruby/qtruby/tools/rbuic/LICENSE.GPL
636
- - ext/ruby/qtruby/tools/rbuic/Messages.sh
637
- - ext/ruby/qtruby/tools/rbuic/TODO
638
638
  - ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.cpp
639
639
  - ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.h
640
640
  - ext/ruby/qtruby/tools/rbuic/databaseinfo.cpp
@@ -642,7 +642,9 @@ files:
642
642
  - ext/ruby/qtruby/tools/rbuic/driver.cpp
643
643
  - ext/ruby/qtruby/tools/rbuic/driver.h
644
644
  - ext/ruby/qtruby/tools/rbuic/globaldefs.h
645
+ - ext/ruby/qtruby/tools/rbuic/LICENSE.GPL
645
646
  - ext/ruby/qtruby/tools/rbuic/main.cpp
647
+ - ext/ruby/qtruby/tools/rbuic/Messages.sh
646
648
  - ext/ruby/qtruby/tools/rbuic/option.h
647
649
  - ext/ruby/qtruby/tools/rbuic/rbuic.pri
648
650
  - ext/ruby/qtruby/tools/rbuic/rbuic4.pro
@@ -659,6 +661,7 @@ files:
659
661
  - ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.cpp
660
662
  - ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.h
661
663
  - ext/ruby/qtruby/tools/rbuic/ruby/ruby.pri
664
+ - ext/ruby/qtruby/tools/rbuic/TODO
662
665
  - ext/ruby/qtruby/tools/rbuic/treewalker.cpp
663
666
  - ext/ruby/qtruby/tools/rbuic/treewalker.h
664
667
  - ext/ruby/qtruby/tools/rbuic/ui4.cpp
@@ -673,8 +676,8 @@ files:
673
676
  - ext/ruby/qtscript/qtscript.rb
674
677
  - ext/ruby/qtscript/qtscripthandlers.cpp
675
678
  - ext/ruby/qtscript/smokedata.cpp
676
- - ext/ruby/qttest/CMakeLists.txt
677
679
  - ext/ruby/qttest/ChangeLog
680
+ - ext/ruby/qttest/CMakeLists.txt
678
681
  - ext/ruby/qttest/examples/myfirsttest.rb
679
682
  - ext/ruby/qttest/qttest.cpp
680
683
  - ext/ruby/qttest/qttest.rb
@@ -692,10 +695,10 @@ files:
692
695
  - ext/smoke/deptool/main.cpp
693
696
  - ext/smoke/qt_smoke.h
694
697
  - ext/smoke/qtcore/CMakeLists.txt
695
- - ext/smoke/qtcore/QtGuess.txt
696
698
  - ext/smoke/qtcore/config.xml.cmake
697
699
  - ext/smoke/qtcore/qt-config.xml.cmake
698
700
  - ext/smoke/qtcore/qtcore_includes.h
701
+ - ext/smoke/qtcore/QtGuess.txt
699
702
  - ext/smoke/qtcore/smokeconfig.xml
700
703
  - ext/smoke/qtcore/tests/CMakeLists.txt
701
704
  - ext/smoke/qtcore/tests/test.cpp
@@ -781,17 +784,14 @@ files:
781
784
  - ext/smoke/smokebase/CMakeLists.txt
782
785
  - ext/smoke/smokebase/smokebase.cpp
783
786
  - ext/smoke/solid_smoke.h
787
+ - CHANGELOG.txt
788
+ - COPYING.LIB.txt
789
+ - COPYING.txt
790
+ - KNOWN_ISSUES.txt
791
+ - TODO.txt
784
792
  - extconf.rb
785
- - lib/Qt.rb
786
- - lib/Qt/qtruby4.rb
787
- - lib/Qt4.rb
788
- - lib/qtbindings_version.rb
789
- - lib/qtdeclarative/qtdeclarative.rb
790
- - lib/qtscript/qtscript.rb
791
- - lib/qttest/qttest.rb
792
- - lib/qtuitools/qtuitools.rb
793
- - lib/qtwebkit/qtwebkit.rb
794
793
  - qtbindings.gemspec
794
+ - Rakefile
795
795
  homepage: http://github.com/ryanmelt/qtbindings
796
796
  licenses:
797
797
  - LGPLv2.1
@@ -802,18 +802,18 @@ require_paths:
802
802
  - lib
803
803
  required_ruby_version: !ruby/object:Gem::Requirement
804
804
  requirements:
805
- - - ">="
805
+ - - ! '>='
806
806
  - !ruby/object:Gem::Version
807
807
  version: '0'
808
808
  required_rubygems_version: !ruby/object:Gem::Requirement
809
809
  requirements:
810
- - - ">="
810
+ - - ! '>='
811
811
  - !ruby/object:Gem::Version
812
812
  version: '0'
813
813
  requirements:
814
814
  - none
815
815
  rubyforge_project: qtbindings
816
- rubygems_version: 2.2.2
816
+ rubygems_version: 2.1.5
817
817
  signing_key:
818
818
  specification_version: 4
819
819
  summary: Qt bindings for ruby