~kubuntu-members/korundum/4.11

« back to all changes in this revision

Viewing changes to nepomuk/nepomuk.rb

  • Committer: Ian Monroe
  • Date: 2010-11-21 15:55:01 UTC
  • Revision ID: git-v1:c37670e4e3c59f5eb2ba112f5341a5e706217f6f
Split up Smoke into Qt and KDE directories. 
Move libsmoke stuff into the generator directory
Split up Ruby into qtruby and korundum directories

svn path=/trunk/KDE/kdebindings/ruby/; revision=1199320

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=begin
2
 
/***************************************************************************
3
 
                          nepomuk.rb  -  Nepomuk ruby client lib
4
 
                             -------------------
5
 
    begin                : Thurs May 29 2008
6
 
    copyright            : (C) 2008 by Richard Dale
7
 
    email                : richard.j.dale@gmail.com
8
 
 ***************************************************************************/
9
 
 
10
 
/***************************************************************************
11
 
 *                                                                         *
12
 
 *   This program is free software; you can redistribute it and/or modify  *
13
 
 *   it under the terms of the GNU General Public License as published by  *
14
 
 *   the Free Software Foundation; either version 2 of the License, or     *
15
 
 *   (at your option) any later version.                                   *
16
 
 *                                                                         *
17
 
 ***************************************************************************/
18
 
=end
19
 
 
20
 
module Nepomuk
21
 
  module Internal
22
 
    def self.init_all_classes
23
 
#      Qt::Internal::add_normalize_proc(Proc.new do |classname|
24
 
#        if classname =~ /^Nepomuk/
25
 
#          now = classname.sub(/^Nepomuk?(?=[A-Z])/,'Nepomuk::')
26
 
#        end
27
 
#        now
28
 
#      end)
29
 
      getClassList.each do |c|
30
 
        classname = Qt::Internal::normalize_classname(c)
31
 
        id = Qt::Internal::findClass(c);
32
 
        Qt::Internal::insert_pclassid(classname, id)
33
 
        Qt::Internal::cpp_names[classname] = c
34
 
        klass = Qt::Internal::isQObject(c) ? Qt::Internal::create_qobject_class(classname, Nepomuk) \
35
 
                                           : Qt::Internal::create_qt_class(classname, Nepomuk)
36
 
        Qt::Internal::classes[classname] = klass unless klass.nil?
37
 
      end
38
 
    end
39
 
  end
40
 
 
41
 
  class Variant < Qt::Base
42
 
    def inspect
43
 
      str = super
44
 
      str.sub(/>$/, " '%s'>" % toString)
45
 
    end
46
 
    
47
 
    def pretty_print(pp)
48
 
      str = to_s
49
 
      pp.text str.sub(/>$/, " '%s'>" % toString)
50
 
    end
51
 
  end
52
 
end