author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/kxmlguiclient.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdeui/kxmlguiclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/kxmlguiclient.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/microkde/kdeui/kxmlguiclient.cpp b/microkde/kdeui/kxmlguiclient.cpp index 073e30b..8740bde 100644 --- a/microkde/kdeui/kxmlguiclient.cpp +++ b/microkde/kdeui/kxmlguiclient.cpp | |||
@@ -26,93 +26,95 @@ | |||
26 | 26 | ||
27 | /*US | 27 | /*US |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qdom.h> | 30 | #include <qdom.h> |
31 | #include <qtextstream.h> | 31 | #include <qtextstream.h> |
32 | #include <qregexp.h> | 32 | #include <qregexp.h> |
33 | */ | 33 | */ |
34 | 34 | ||
35 | //US #include <kinstance.h> | 35 | //US #include <kinstance.h> |
36 | #include <kstandarddirs.h> | 36 | #include <kstandarddirs.h> |
37 | #include <kdebug.h> | 37 | #include <kdebug.h> |
38 | #include <kaction.h> | 38 | #include <kaction.h> |
39 | #include <kapplication.h> | 39 | #include <kapplication.h> |
40 | 40 | ||
41 | #include <assert.h> | 41 | #include <assert.h> |
42 | //Added by qt3to4: | ||
43 | #include <Q3PtrList> | ||
42 | 44 | ||
43 | class KXMLGUIClientPrivate | 45 | class KXMLGUIClientPrivate |
44 | { | 46 | { |
45 | public: | 47 | public: |
46 | KXMLGUIClientPrivate() | 48 | KXMLGUIClientPrivate() |
47 | { | 49 | { |
48 | //US m_instance = KGlobal::instance(); | 50 | //US m_instance = KGlobal::instance(); |
49 | //US m_factory = 0L; | 51 | //US m_factory = 0L; |
50 | m_parent = 0L; | 52 | m_parent = 0L; |
51 | //US m_builder = 0L; | 53 | //US m_builder = 0L; |
52 | m_actionCollection = 0; | 54 | m_actionCollection = 0; |
53 | } | 55 | } |
54 | ~KXMLGUIClientPrivate() | 56 | ~KXMLGUIClientPrivate() |
55 | { | 57 | { |
56 | } | 58 | } |
57 | 59 | ||
58 | //US KInstance *m_instance; | 60 | //US KInstance *m_instance; |
59 | 61 | ||
60 | //US QDomDocument m_doc; | 62 | //US QDomDocument m_doc; |
61 | KActionCollection *m_actionCollection; | 63 | KActionCollection *m_actionCollection; |
62 | //US QDomDocument m_buildDocument; | 64 | //US QDomDocument m_buildDocument; |
63 | //US KXMLGUIFactory *m_factory; | 65 | //US KXMLGUIFactory *m_factory; |
64 | KXMLGUIClient *m_parent; | 66 | KXMLGUIClient *m_parent; |
65 | //QPtrList<KXMLGUIClient> m_supers; | 67 | //QPtrList<KXMLGUIClient> m_supers; |
66 | QPtrList<KXMLGUIClient> m_children; | 68 | Q3PtrList<KXMLGUIClient> m_children; |
67 | //US KXMLGUIBuilder *m_builder; | 69 | //US KXMLGUIBuilder *m_builder; |
68 | //US QString m_xmlFile; | 70 | //US QString m_xmlFile; |
69 | //US QString m_localXMLFile; | 71 | //US QString m_localXMLFile; |
70 | }; | 72 | }; |
71 | 73 | ||
72 | KXMLGUIClient::KXMLGUIClient() | 74 | KXMLGUIClient::KXMLGUIClient() |
73 | { | 75 | { |
74 | d = new KXMLGUIClientPrivate; | 76 | d = new KXMLGUIClientPrivate; |
75 | } | 77 | } |
76 | 78 | ||
77 | KXMLGUIClient::KXMLGUIClient( KXMLGUIClient *parent ) | 79 | KXMLGUIClient::KXMLGUIClient( KXMLGUIClient *parent ) |
78 | { | 80 | { |
79 | d = new KXMLGUIClientPrivate; | 81 | d = new KXMLGUIClientPrivate; |
80 | parent->insertChildClient( this ); | 82 | parent->insertChildClient( this ); |
81 | } | 83 | } |
82 | 84 | ||
83 | KXMLGUIClient::~KXMLGUIClient() | 85 | KXMLGUIClient::~KXMLGUIClient() |
84 | { | 86 | { |
85 | if ( d->m_parent ) | 87 | if ( d->m_parent ) |
86 | d->m_parent->removeChildClient( this ); | 88 | d->m_parent->removeChildClient( this ); |
87 | 89 | ||
88 | QPtrListIterator<KXMLGUIClient> it( d->m_children ); | 90 | Q3PtrListIterator<KXMLGUIClient> it( d->m_children ); |
89 | for ( ; it.current(); ++it ) { | 91 | for ( ; it.current(); ++it ) { |
90 | assert( it.current()->d->m_parent == this ); | 92 | assert( it.current()->d->m_parent == this ); |
91 | it.current()->d->m_parent = 0; | 93 | it.current()->d->m_parent = 0; |
92 | } | 94 | } |
93 | 95 | ||
94 | delete d->m_actionCollection; | 96 | delete d->m_actionCollection; |
95 | delete d; | 97 | delete d; |
96 | } | 98 | } |
97 | 99 | ||
98 | KAction *KXMLGUIClient::action( const char *name ) const | 100 | KAction *KXMLGUIClient::action( const char *name ) const |
99 | { | 101 | { |
100 | KAction* act = actionCollection()->action( name ); | 102 | KAction* act = actionCollection()->action( name ); |
101 | if ( !act ) { | 103 | if ( !act ) { |
102 | QPtrListIterator<KXMLGUIClient> childIt( d->m_children ); | 104 | Q3PtrListIterator<KXMLGUIClient> childIt( d->m_children ); |
103 | for (; childIt.current(); ++childIt ) { | 105 | for (; childIt.current(); ++childIt ) { |
104 | act = childIt.current()->actionCollection()->action( name ); | 106 | act = childIt.current()->actionCollection()->action( name ); |
105 | if ( act ) | 107 | if ( act ) |
106 | break; | 108 | break; |
107 | } | 109 | } |
108 | } | 110 | } |
109 | return act; | 111 | return act; |
110 | } | 112 | } |
111 | 113 | ||
112 | KActionCollection *KXMLGUIClient::actionCollection() const | 114 | KActionCollection *KXMLGUIClient::actionCollection() const |
113 | { | 115 | { |
114 | if ( !d->m_actionCollection ) | 116 | if ( !d->m_actionCollection ) |
115 | d->m_actionCollection = new KActionCollection( 0, 0, | 117 | d->m_actionCollection = new KActionCollection( 0, 0, |
116 | "KXMLGUILClient-KActionCollection" ); | 118 | "KXMLGUILClient-KActionCollection" ); |
117 | return d->m_actionCollection; | 119 | return d->m_actionCollection; |
118 | } | 120 | } |
@@ -575,51 +577,51 @@ void KXMLGUIClient::insertChildClient( KXMLGUIClient *child ) | |||
575 | 577 | ||
576 | void KXMLGUIClient::removeChildClient( KXMLGUIClient *child ) | 578 | void KXMLGUIClient::removeChildClient( KXMLGUIClient *child ) |
577 | { | 579 | { |
578 | assert( d->m_children.containsRef( child ) ); | 580 | assert( d->m_children.containsRef( child ) ); |
579 | d->m_children.removeRef( child ); | 581 | d->m_children.removeRef( child ); |
580 | child->d->m_parent = 0; | 582 | child->d->m_parent = 0; |
581 | } | 583 | } |
582 | 584 | ||
583 | /*bool KXMLGUIClient::addSuperClient( KXMLGUIClient *super ) | 585 | /*bool KXMLGUIClient::addSuperClient( KXMLGUIClient *super ) |
584 | { | 586 | { |
585 | if ( d->m_supers.contains( super ) ) | 587 | if ( d->m_supers.contains( super ) ) |
586 | return false; | 588 | return false; |
587 | d->m_supers.append( super ); | 589 | d->m_supers.append( super ); |
588 | return true; | 590 | return true; |
589 | }*/ | 591 | }*/ |
590 | 592 | ||
591 | const QPtrList<KXMLGUIClient> *KXMLGUIClient::childClients() | 593 | const Q3PtrList<KXMLGUIClient> *KXMLGUIClient::childClients() |
592 | { | 594 | { |
593 | return &d->m_children; | 595 | return &d->m_children; |
594 | } | 596 | } |
595 | /*US | 597 | /*US |
596 | void KXMLGUIClient::setClientBuilder( KXMLGUIBuilder *builder ) | 598 | void KXMLGUIClient::setClientBuilder( KXMLGUIBuilder *builder ) |
597 | { | 599 | { |
598 | d->m_builder = builder; | 600 | d->m_builder = builder; |
599 | if ( builder ) | 601 | if ( builder ) |
600 | builder->setBuilderInstance( instance() ); | 602 | builder->setBuilderInstance( instance() ); |
601 | } | 603 | } |
602 | 604 | ||
603 | KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const | 605 | KXMLGUIBuilder *KXMLGUIClient::clientBuilder() const |
604 | { | 606 | { |
605 | return d->m_builder; | 607 | return d->m_builder; |
606 | } | 608 | } |
607 | */ | 609 | */ |
608 | 610 | ||
609 | void KXMLGUIClient::plugActionList( const QString &name, const QPtrList<KAction> &actionList ) | 611 | void KXMLGUIClient::plugActionList( const QString &name, const Q3PtrList<KAction> &actionList ) |
610 | { | 612 | { |
611 | /*US | 613 | /*US |
612 | if ( !d->m_factory ) | 614 | if ( !d->m_factory ) |
613 | return; | 615 | return; |
614 | 616 | ||
615 | d->m_factory->plugActionList( this, name, actionList ); | 617 | d->m_factory->plugActionList( this, name, actionList ); |
616 | */ | 618 | */ |
617 | } | 619 | } |
618 | 620 | ||
619 | void KXMLGUIClient::unplugActionList( const QString &name ) | 621 | void KXMLGUIClient::unplugActionList( const QString &name ) |
620 | { | 622 | { |
621 | /*US | 623 | /*US |
622 | if ( !d->m_factory ) | 624 | if ( !d->m_factory ) |
623 | return; | 625 | return; |
624 | 626 | ||
625 | d->m_factory->unplugActionList( this, name ); | 627 | d->m_factory->unplugActionList( this, name ); |