summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kactioncollection.cpp
Unidiff
Diffstat (limited to 'microkde/kdeui/kactioncollection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kactioncollection.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/microkde/kdeui/kactioncollection.cpp b/microkde/kdeui/kactioncollection.cpp
index 69e5d02..4d66c7f 100644
--- a/microkde/kdeui/kactioncollection.cpp
+++ b/microkde/kdeui/kactioncollection.cpp
@@ -26,7 +26,9 @@
26#include "kactioncollection.h" 26#include "kactioncollection.h"
27//US#include "kactionshortcutlist.h" 27//US#include "kactionshortcutlist.h"
28 28
29#include <qptrdict.h> 29#include <q3ptrdict.h>
30//Added by qt3to4:
31#include <Q3ValueList>
30//US#include <qvariant.h> 32//US#include <qvariant.h>
31 33
32//US#include <kaccel.h> 34//US#include <kaccel.h>
@@ -36,8 +38,8 @@
36//US#include <kxmlguifactory.h> 38//US#include <kxmlguifactory.h>
37 39
38//US I included the following files 40//US I included the following files
39#include <qasciidict.h> 41#include <q3asciidict.h>
40#include <qptrlist.h> 42#include <q3ptrlist.h>
41#include "kaction.h" 43#include "kaction.h"
42#include <kglobal.h> 44#include <kglobal.h>
43#include <qobject.h> 45#include <qobject.h>
@@ -67,13 +69,13 @@ public:
67 //int m_iWidgetCurrent; 69 //int m_iWidgetCurrent;
68 //QValueList<QWidget*> m_widgetList; 70 //QValueList<QWidget*> m_widgetList;
69 //QValueList<KAccel*> m_kaccelList; 71 //QValueList<KAccel*> m_kaccelList;
70 QValueList<KActionCollection*> m_docList; 72 Q3ValueList<KActionCollection*> m_docList;
71 QWidget *m_widget; 73 QWidget *m_widget;
72 KAccel *m_kaccel; 74 KAccel *m_kaccel;
73 KAccel *m_builderKAccel; 75 KAccel *m_builderKAccel;
74 76
75 QAsciiDict<KAction> m_actionDict; 77 Q3AsciiDict<KAction> m_actionDict;
76 QPtrDict< QPtrList<KAction> > m_dctHighlightContainers; 78 Q3PtrDict< Q3PtrList<KAction> > m_dctHighlightContainers;
77 bool m_highlight; 79 bool m_highlight;
78 KAction *m_currentHighlightAction; 80 KAction *m_currentHighlightAction;
79 bool m_statusCleared; 81 bool m_statusCleared;
@@ -133,7 +135,7 @@ KActionCollection::KActionCollection( const KActionCollection &copy )
133KActionCollection::~KActionCollection() 135KActionCollection::~KActionCollection()
134{ 136{
135 kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; 137 kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl;
136 for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { 138 for ( Q3AsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) {
137 KAction* pAction = it.current(); 139 KAction* pAction = it.current();
138 if ( pAction->m_parentCollection == this ) 140 if ( pAction->m_parentCollection == this )
139 pAction->m_parentCollection = 0L; 141 pAction->m_parentCollection = 0L;
@@ -365,7 +367,7 @@ KAction* KActionCollection::_take( KAction* action )
365 367
366void KActionCollection::_clear() 368void KActionCollection::_clear()
367{ 369{
368 QAsciiDictIterator<KAction> it( d->m_actionDict ); 370 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
369 while ( it.current() ) 371 while ( it.current() )
370 _remove( it.current() ); 372 _remove( it.current() );
371} 373}
@@ -386,7 +388,7 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co
386 pAction = d->m_actionDict[ name ]; 388 pAction = d->m_actionDict[ name ];
387 389
388 else { 390 else {
389 QAsciiDictIterator<KAction> it( d->m_actionDict ); 391 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
390 for( ; it.current(); ++it ) 392 for( ; it.current(); ++it )
391 { 393 {
392 if ( ( !name || strcmp( it.current()->name(), name ) == 0 ) && 394 if ( ( !name || strcmp( it.current()->name(), name ) == 0 ) &&
@@ -407,7 +409,7 @@ KAction* KActionCollection::action( const char* name, const char* classname ) co
407 409
408KAction* KActionCollection::action( int index ) const 410KAction* KActionCollection::action( int index ) const
409{ 411{
410 QAsciiDictIterator<KAction> it( d->m_actionDict ); 412 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
411 it += index; 413 it += index;
412 return it.current(); 414 return it.current();
413// return d->m_actions.at( index ); 415// return d->m_actions.at( index );
@@ -432,7 +434,7 @@ QStringList KActionCollection::groups() const
432{ 434{
433 QStringList lst; 435 QStringList lst;
434 436
435 QAsciiDictIterator<KAction> it( d->m_actionDict ); 437 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
436 for( ; it.current(); ++it ) 438 for( ; it.current(); ++it )
437 if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) ) 439 if ( !it.current()->group().isEmpty() && !lst.contains( it.current()->group() ) )
438 lst.append( it.current()->group() ); 440 lst.append( it.current()->group() );
@@ -444,7 +446,7 @@ KActionPtrList KActionCollection::actions( const QString& group ) const
444{ 446{
445 KActionPtrList lst; 447 KActionPtrList lst;
446 448
447 QAsciiDictIterator<KAction> it( d->m_actionDict ); 449 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
448 for( ; it.current(); ++it ) 450 for( ; it.current(); ++it )
449 if ( it.current()->group() == group ) 451 if ( it.current()->group() == group )
450 lst.append( it.current() ); 452 lst.append( it.current() );
@@ -458,7 +460,7 @@ KActionPtrList KActionCollection::actions() const
458{ 460{
459 KActionPtrList lst; 461 KActionPtrList lst;
460 462
461 QAsciiDictIterator<KAction> it( d->m_actionDict ); 463 Q3AsciiDictIterator<KAction> it( d->m_actionDict );
462 for( ; it.current(); ++it ) 464 for( ; it.current(); ++it )
463 lst.append( it.current() ); 465 lst.append( it.current() );
464 466
@@ -508,13 +510,13 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action )
508 if ( !d->m_highlight ) 510 if ( !d->m_highlight )
509 return; 511 return;
510 512
511 QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; 513 Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ];
512 514
513 if ( !actionList ) 515 if ( !actionList )
514 { 516 {
515 actionList = new QPtrList<KAction>; 517 actionList = new Q3PtrList<KAction>;
516 518
517 if ( container->inherits( "QPopupMenu" ) ) 519 if ( container->inherits( "Q3PopupMenu" ) )
518 { 520 {
519 connect( container, SIGNAL( highlighted( int ) ), 521 connect( container, SIGNAL( highlighted( int ) ),
520 this, SLOT( slotMenuItemHighlighted( int ) ) ); 522 this, SLOT( slotMenuItemHighlighted( int ) ) );
@@ -522,7 +524,7 @@ void KActionCollection::connectHighlight( QWidget *container, KAction *action )
522 this, SLOT( slotMenuAboutToHide() ) ); 524 this, SLOT( slotMenuAboutToHide() ) );
523 } 525 }
524//US else if ( container->inherits( "KToolBar" ) ) 526//US else if ( container->inherits( "KToolBar" ) )
525 else if ( container->inherits( "QToolBar" ) ) 527 else if ( container->inherits( "Q3ToolBar" ) )
526 { 528 {
527 connect( container, SIGNAL( highlighted( int, bool ) ), 529 connect( container, SIGNAL( highlighted( int, bool ) ),
528 this, SLOT( slotToolBarButtonHighlighted( int, bool ) ) ); 530 this, SLOT( slotToolBarButtonHighlighted( int, bool ) ) );
@@ -542,7 +544,7 @@ void KActionCollection::disconnectHighlight( QWidget *container, KAction *action
542 if ( !d->m_highlight ) 544 if ( !d->m_highlight )
543 return; 545 return;
544 546
545 QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ]; 547 Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ container ];
546 548
547 if ( !actionList ) 549 if ( !actionList )
548 return; 550 return;
@@ -625,12 +627,12 @@ void KActionCollection::slotDestroyed()
625 627
626KAction *KActionCollection::findAction( QWidget *container, int id ) 628KAction *KActionCollection::findAction( QWidget *container, int id )
627{ 629{
628 QPtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ]; 630 Q3PtrList<KAction> *actionList = d->m_dctHighlightContainers[ reinterpret_cast<void *>( container ) ];
629 631
630 if ( !actionList ) 632 if ( !actionList )
631 return 0; 633 return 0;
632 634
633 QPtrListIterator<KAction> it( *actionList ); 635 Q3PtrListIterator<KAction> it( *actionList );
634 for (; it.current(); ++it ) 636 for (; it.current(); ++it )
635 if ( it.current()->isPlugged( container, id ) ) 637 if ( it.current()->isPlugged( container, id ) )
636 return it.current(); 638 return it.current();
@@ -644,9 +646,9 @@ KActionCollection KActionCollection::operator+(const KActionCollection &c ) cons
644 kdWarning(129) << "KActionCollection::operator+(): function is severely deprecated." << endl; 646 kdWarning(129) << "KActionCollection::operator+(): function is severely deprecated." << endl;
645 KActionCollection ret( *this ); 647 KActionCollection ret( *this );
646 648
647 QValueList<KAction *> actions = c.actions(); 649 Q3ValueList<KAction *> actions = c.actions();
648 QValueList<KAction *>::ConstIterator it = actions.begin(); 650 Q3ValueList<KAction *>::ConstIterator it = actions.begin();
649 QValueList<KAction *>::ConstIterator end = actions.end(); 651 Q3ValueList<KAction *>::ConstIterator end = actions.end();
650 for (; it != end; ++it ) 652 for (; it != end; ++it )
651 ret.insert( *it ); 653 ret.insert( *it );
652 654
@@ -670,7 +672,7 @@ KActionCollection &KActionCollection::operator=( const KActionCollection &copy )
670KActionCollection &KActionCollection::operator+=( const KActionCollection &c ) 672KActionCollection &KActionCollection::operator+=( const KActionCollection &c )
671{ 673{
672 kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl; 674 kdWarning(129) << "KActionCollection::operator+=(): function is severely deprecated." << endl;
673 QAsciiDictIterator<KAction> it(c.d->m_actionDict); 675 Q3AsciiDictIterator<KAction> it(c.d->m_actionDict);
674 for ( ; it.current(); ++it ) 676 for ( ; it.current(); ++it )
675 insert( it.current() ); 677 insert( it.current() );
676 678