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/kactioncollection.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/kactioncollection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/kactioncollection.cpp | 50 |
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 | |||
@@ -13,80 +13,82 @@ | |||
13 | License version 2 as published by the Free Software Foundation. | 13 | License version 2 as published by the Free Software Foundation. |
14 | 14 | ||
15 | This library is distributed in the hope that it will be useful, | 15 | This library is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 | Library General Public License for more details. | 18 | Library General Public License for more details. |
19 | 19 | ||
20 | You should have received a copy of the GNU Library General Public License | 20 | You should have received a copy of the GNU Library General Public License |
21 | along with this library; see the file COPYING.LIB. If not, write to | 21 | along with this library; see the file COPYING.LIB. If not, write to |
22 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 22 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
23 | Boston, MA 02111-1307, USA. | 23 | Boston, MA 02111-1307, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
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> |
33 | //US#include <kaccelbase.h> | 35 | //US#include <kaccelbase.h> |
34 | //US#include <kapplication.h> | 36 | //US#include <kapplication.h> |
35 | #include <kdebug.h> | 37 | #include <kdebug.h> |
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> |
44 | #include <qwidget.h> | 46 | #include <qwidget.h> |
45 | 47 | ||
46 | class KActionCollection::KActionCollectionPrivate | 48 | class KActionCollection::KActionCollectionPrivate |
47 | { | 49 | { |
48 | public: | 50 | public: |
49 | KActionCollectionPrivate() | 51 | KActionCollectionPrivate() |
50 | { | 52 | { |
51 | //US m_instance = 0; | 53 | //US m_instance = 0; |
52 | //m_bOneKAccelOnly = false; | 54 | //m_bOneKAccelOnly = false; |
53 | //m_iWidgetCurrent = 0; | 55 | //m_iWidgetCurrent = 0; |
54 | m_bAutoConnectShortcuts = true; | 56 | m_bAutoConnectShortcuts = true; |
55 | m_widget = 0; | 57 | m_widget = 0; |
56 | m_kaccel = m_builderKAccel = 0; | 58 | m_kaccel = m_builderKAccel = 0; |
57 | m_dctHighlightContainers.setAutoDelete( true ); | 59 | m_dctHighlightContainers.setAutoDelete( true ); |
58 | m_highlight = false; | 60 | m_highlight = false; |
59 | m_currentHighlightAction = 0; | 61 | m_currentHighlightAction = 0; |
60 | m_statusCleared = true; | 62 | m_statusCleared = true; |
61 | } | 63 | } |
62 | 64 | ||
63 | //US KInstance *m_instance; | 65 | //US KInstance *m_instance; |
64 | //US QString m_sXMLFile; | 66 | //US QString m_sXMLFile; |
65 | bool m_bAutoConnectShortcuts; | 67 | bool m_bAutoConnectShortcuts; |
66 | //bool m_bOneKAccelOnly; | 68 | //bool m_bOneKAccelOnly; |
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; |
80 | }; | 82 | }; |
81 | 83 | ||
82 | KActionCollection::KActionCollection( QWidget *parent, const char *name /*US, | 84 | KActionCollection::KActionCollection( QWidget *parent, const char *name /*US, |
83 | KInstance *instance */) | 85 | KInstance *instance */) |
84 | : QObject( (QObject*)parent, name ) | 86 | : QObject( (QObject*)parent, name ) |
85 | { | 87 | { |
86 | kdDebug(129) << "KActionCollection::KActionCollection( " << parent << ", " << name << " ): this = " << this << endl; // ellis | 88 | kdDebug(129) << "KActionCollection::KActionCollection( " << parent << ", " << name << " ): this = " << this << endl; // ellis |
87 | d = new KActionCollectionPrivate; | 89 | d = new KActionCollectionPrivate; |
88 | if( parent ) | 90 | if( parent ) |
89 | setWidget( parent ); | 91 | setWidget( parent ); |
90 | //d->m_bOneKAccelOnly = (d->m_kaccelList.count() > 0); | 92 | //d->m_bOneKAccelOnly = (d->m_kaccelList.count() > 0); |
91 | //US setInstance( instance ); | 93 | //US setInstance( instance ); |
92 | } | 94 | } |
@@ -120,33 +122,33 @@ KActionCollection::KActionCollection( QObject *parent, const char *name /*US, | |||
120 | //d->m_bOneKAccelOnly = (d->m_kaccelList.count() > 0); | 122 | //d->m_bOneKAccelOnly = (d->m_kaccelList.count() > 0); |
121 | //US setInstance( instance ); | 123 | //US setInstance( instance ); |
122 | } | 124 | } |
123 | 125 | ||
124 | KActionCollection::KActionCollection( const KActionCollection © ) | 126 | KActionCollection::KActionCollection( const KActionCollection © ) |
125 | : QObject() | 127 | : QObject() |
126 | { | 128 | { |
127 | kdWarning(129) << "KActionCollection::KActionCollection( const KActionCollection & ): function is severely deprecated." << endl; | 129 | kdWarning(129) << "KActionCollection::KActionCollection( const KActionCollection & ): function is severely deprecated." << endl; |
128 | d = new KActionCollectionPrivate; | 130 | d = new KActionCollectionPrivate; |
129 | *this = copy; | 131 | *this = copy; |
130 | } | 132 | } |
131 | // KDE 4: remove end | 133 | // KDE 4: remove end |
132 | 134 | ||
133 | KActionCollection::~KActionCollection() | 135 | KActionCollection::~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; |
140 | } | 142 | } |
141 | 143 | ||
142 | //US delete d->m_kaccel; | 144 | //US delete d->m_kaccel; |
143 | //US delete d->m_builderKAccel; | 145 | //US delete d->m_builderKAccel; |
144 | delete d; d = 0; | 146 | delete d; d = 0; |
145 | } | 147 | } |
146 | 148 | ||
147 | void KActionCollection::setWidget( QWidget* w ) | 149 | void KActionCollection::setWidget( QWidget* w ) |
148 | { | 150 | { |
149 | //if ( d->m_actionDict.count() > 0 ) { | 151 | //if ( d->m_actionDict.count() > 0 ) { |
150 | // kdError(129) << "KActionCollection::setWidget(): must be called before any actions are added to collection!" << endl; | 152 | // kdError(129) << "KActionCollection::setWidget(): must be called before any actions are added to collection!" << endl; |
151 | // kdDebug(129) << kdBacktrace() << endl; | 153 | // kdDebug(129) << kdBacktrace() << endl; |
152 | //} | 154 | //} |
@@ -352,126 +354,126 @@ KAction* KActionCollection::_take( KAction* action ) | |||
352 | if( qstrcmp( name, "unnamed" ) == 0 ) | 354 | if( qstrcmp( name, "unnamed" ) == 0 ) |
353 | { | 355 | { |
354 | sprintf(unnamed_name, "unnamed-%p", (void *) action); | 356 | sprintf(unnamed_name, "unnamed-%p", (void *) action); |
355 | name = unnamed_name; | 357 | name = unnamed_name; |
356 | } | 358 | } |
357 | 359 | ||
358 | KAction *a = d->m_actionDict.take( name ); | 360 | KAction *a = d->m_actionDict.take( name ); |
359 | if ( !a || a != action ) | 361 | if ( !a || a != action ) |
360 | return 0; | 362 | return 0; |
361 | 363 | ||
362 | emit removed( action ); | 364 | emit removed( action ); |
363 | return a; | 365 | return a; |
364 | } | 366 | } |
365 | 367 | ||
366 | void KActionCollection::_clear() | 368 | void 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 | } |
372 | 374 | ||
373 | void KActionCollection::insert( KAction* action ) { _insert( action ); } | 375 | void KActionCollection::insert( KAction* action ) { _insert( action ); } |
374 | void KActionCollection::remove( KAction* action ) { _remove( action ); } | 376 | void KActionCollection::remove( KAction* action ) { _remove( action ); } |
375 | KAction* KActionCollection::take( KAction* action ) { return _take( action ); } | 377 | KAction* KActionCollection::take( KAction* action ) { return _take( action ); } |
376 | void KActionCollection::clear() { _clear(); } | 378 | void KActionCollection::clear() { _clear(); } |
377 | KAccel* KActionCollection::accel() { return kaccel(); } | 379 | KAccel* KActionCollection::accel() { return kaccel(); } |
378 | const KAccel* KActionCollection::accel() const { return kaccel(); } | 380 | const KAccel* KActionCollection::accel() const { return kaccel(); } |
379 | KAccel* KActionCollection::builderKAccel() const { return d->m_builderKAccel; } | 381 | KAccel* KActionCollection::builderKAccel() const { return d->m_builderKAccel; } |
380 | 382 | ||
381 | KAction* KActionCollection::action( const char* name, const char* classname ) const | 383 | KAction* KActionCollection::action( const char* name, const char* classname ) const |
382 | { | 384 | { |
383 | KAction* pAction = 0; | 385 | KAction* pAction = 0; |
384 | 386 | ||
385 | if ( !classname && name ) | 387 | if ( !classname && name ) |
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 ) && |
393 | ( !classname || strcmp( it.current()->className(), classname ) == 0 ) ) { | 395 | ( !classname || strcmp( it.current()->className(), classname ) == 0 ) ) { |
394 | pAction = it.current(); | 396 | pAction = it.current(); |
395 | break; | 397 | break; |
396 | } | 398 | } |
397 | } | 399 | } |
398 | } | 400 | } |
399 | 401 | ||
400 | if( !pAction ) { | 402 | if( !pAction ) { |
401 | for( uint i = 0; i < d->m_docList.count() && !pAction; i++ ) | 403 | for( uint i = 0; i < d->m_docList.count() && !pAction; i++ ) |
402 | pAction = d->m_docList[i]->action( name, classname ); | 404 | pAction = d->m_docList[i]->action( name, classname ); |
403 | } | 405 | } |
404 | 406 | ||
405 | return pAction; | 407 | return pAction; |
406 | } | 408 | } |
407 | 409 | ||
408 | KAction* KActionCollection::action( int index ) const | 410 | KAction* 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 ); |
414 | } | 416 | } |
415 | /*US | 417 | /*US |
416 | bool KActionCollection::readShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig ) | 418 | bool KActionCollection::readShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig ) |
417 | { | 419 | { |
418 | return KActionShortcutList(this).readSettings( sConfigGroup, pConfig ); | 420 | return KActionShortcutList(this).readSettings( sConfigGroup, pConfig ); |
419 | } | 421 | } |
420 | 422 | ||
421 | bool KActionCollection::writeShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig ) const | 423 | bool KActionCollection::writeShortcutSettings( const QString& sConfigGroup, KConfigBase* pConfig ) const |
422 | { | 424 | { |
423 | return KActionShortcutList((KActionCollection*)this).writeSettings( sConfigGroup, pConfig ); | 425 | return KActionShortcutList((KActionCollection*)this).writeSettings( sConfigGroup, pConfig ); |
424 | } | 426 | } |
425 | */ | 427 | */ |
426 | uint KActionCollection::count() const | 428 | uint KActionCollection::count() const |
427 | { | 429 | { |
428 | return d->m_actionDict.count(); | 430 | return d->m_actionDict.count(); |
429 | } | 431 | } |
430 | 432 | ||
431 | QStringList KActionCollection::groups() const | 433 | 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() ); |
439 | 441 | ||
440 | return lst; | 442 | return lst; |
441 | } | 443 | } |
442 | 444 | ||
443 | KActionPtrList KActionCollection::actions( const QString& group ) const | 445 | 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() ); |
451 | else if ( it.current()->group().isEmpty() && group.isEmpty() ) | 453 | else if ( it.current()->group().isEmpty() && group.isEmpty() ) |
452 | lst.append( it.current() ); | 454 | lst.append( it.current() ); |
453 | 455 | ||
454 | return lst; | 456 | return lst; |
455 | } | 457 | } |
456 | 458 | ||
457 | KActionPtrList KActionCollection::actions() const | 459 | 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 | ||
465 | return lst; | 467 | return lst; |
466 | } | 468 | } |
467 | 469 | ||
468 | /*US we have no instance object. Use KGlobal instead | 470 | /*US we have no instance object. Use KGlobal instead |
469 | void KActionCollection::setInstance( KInstance *instance ) | 471 | void KActionCollection::setInstance( KInstance *instance ) |
470 | { | 472 | { |
471 | if ( instance ) | 473 | if ( instance ) |
472 | d->m_instance = instance; | 474 | d->m_instance = instance; |
473 | qDebug("KActionCollection::setInstance has to be fixed"); | 475 | qDebug("KActionCollection::setInstance has to be fixed"); |
474 | else | 476 | else |
475 | d->m_instance = KGlobal::instance(); | 477 | d->m_instance = KGlobal::instance(); |
476 | } | 478 | } |
477 | 479 | ||
@@ -495,67 +497,67 @@ const QString& KActionCollection::xmlFile() const | |||
495 | 497 | ||
496 | void KActionCollection::setHighlightingEnabled( bool enable ) | 498 | void KActionCollection::setHighlightingEnabled( bool enable ) |
497 | { | 499 | { |
498 | d->m_highlight = enable; | 500 | d->m_highlight = enable; |
499 | } | 501 | } |
500 | 502 | ||
501 | bool KActionCollection::highlightingEnabled() const | 503 | bool KActionCollection::highlightingEnabled() const |
502 | { | 504 | { |
503 | return d->m_highlight; | 505 | return d->m_highlight; |
504 | } | 506 | } |
505 | 507 | ||
506 | void KActionCollection::connectHighlight( QWidget *container, KAction *action ) | 508 | void KActionCollection::connectHighlight( QWidget *container, KAction *action ) |
507 | { | 509 | { |
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 ) ) ); |
521 | connect( container, SIGNAL( aboutToHide() ), | 523 | connect( container, SIGNAL( aboutToHide() ), |
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 ) ) ); |
529 | } | 531 | } |
530 | 532 | ||
531 | connect( container, SIGNAL( destroyed() ), | 533 | connect( container, SIGNAL( destroyed() ), |
532 | this, SLOT( slotDestroyed() ) ); | 534 | this, SLOT( slotDestroyed() ) ); |
533 | 535 | ||
534 | d->m_dctHighlightContainers.insert( container, actionList ); | 536 | d->m_dctHighlightContainers.insert( container, actionList ); |
535 | } | 537 | } |
536 | 538 | ||
537 | actionList->append( action ); | 539 | actionList->append( action ); |
538 | } | 540 | } |
539 | 541 | ||
540 | void KActionCollection::disconnectHighlight( QWidget *container, KAction *action ) | 542 | void KActionCollection::disconnectHighlight( QWidget *container, KAction *action ) |
541 | { | 543 | { |
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; |
549 | 551 | ||
550 | actionList->removeRef( action ); | 552 | actionList->removeRef( action ); |
551 | 553 | ||
552 | if ( actionList->count() == 0 ) | 554 | if ( actionList->count() == 0 ) |
553 | d->m_dctHighlightContainers.remove( container ); | 555 | d->m_dctHighlightContainers.remove( container ); |
554 | } | 556 | } |
555 | 557 | ||
556 | void KActionCollection::slotMenuItemHighlighted( int id ) | 558 | void KActionCollection::slotMenuItemHighlighted( int id ) |
557 | { | 559 | { |
558 | if ( !d->m_highlight ) | 560 | if ( !d->m_highlight ) |
559 | return; | 561 | return; |
560 | 562 | ||
561 | if ( d->m_currentHighlightAction ) | 563 | if ( d->m_currentHighlightAction ) |
@@ -612,78 +614,78 @@ void KActionCollection::slotToolBarButtonHighlighted( int id, bool highlight ) | |||
612 | if ( highlight ) | 614 | if ( highlight ) |
613 | d->m_currentHighlightAction = action; | 615 | d->m_currentHighlightAction = action; |
614 | else | 616 | else |
615 | { | 617 | { |
616 | d->m_currentHighlightAction = 0; | 618 | d->m_currentHighlightAction = 0; |
617 | // emit clearStatusText(); | 619 | // emit clearStatusText(); |
618 | } | 620 | } |
619 | } | 621 | } |
620 | 622 | ||
621 | void KActionCollection::slotDestroyed() | 623 | void KActionCollection::slotDestroyed() |
622 | { | 624 | { |
623 | d->m_dctHighlightContainers.remove( reinterpret_cast<void *>( const_cast<QObject *>(sender()) ) ); | 625 | d->m_dctHighlightContainers.remove( reinterpret_cast<void *>( const_cast<QObject *>(sender()) ) ); |
624 | } | 626 | } |
625 | 627 | ||
626 | KAction *KActionCollection::findAction( QWidget *container, int id ) | 628 | KAction *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(); |
637 | 639 | ||
638 | return 0; | 640 | return 0; |
639 | } | 641 | } |
640 | 642 | ||
641 | // KDE 4: remove | 643 | // KDE 4: remove |
642 | KActionCollection KActionCollection::operator+(const KActionCollection &c ) const | 644 | KActionCollection KActionCollection::operator+(const KActionCollection &c ) const |
643 | { | 645 | { |
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 | ||
653 | return ret; | 655 | return ret; |
654 | } | 656 | } |
655 | 657 | ||
656 | KActionCollection &KActionCollection::operator=( const KActionCollection © ) | 658 | KActionCollection &KActionCollection::operator=( const KActionCollection © ) |
657 | { | 659 | { |
658 | kdWarning(129) << "KActionCollection::operator=(): function is severely deprecated." << endl; | 660 | kdWarning(129) << "KActionCollection::operator=(): function is severely deprecated." << endl; |
659 | //d->m_bOneKAccelOnly = copy.d->m_bOneKAccelOnly; | 661 | //d->m_bOneKAccelOnly = copy.d->m_bOneKAccelOnly; |
660 | //d->m_iWidgetCurrent = copy.d->m_iWidgetCurrent; | 662 | //d->m_iWidgetCurrent = copy.d->m_iWidgetCurrent; |
661 | //d->m_widgetList = copy.d->m_widgetList; | 663 | //d->m_widgetList = copy.d->m_widgetList; |
662 | //d->m_kaccelList = copy.d->m_kaccelList; | 664 | //d->m_kaccelList = copy.d->m_kaccelList; |
663 | d->m_widget = copy.d->m_widget; | 665 | d->m_widget = copy.d->m_widget; |
664 | d->m_kaccel = copy.d->m_kaccel; | 666 | d->m_kaccel = copy.d->m_kaccel; |
665 | d->m_actionDict = copy.d->m_actionDict; | 667 | d->m_actionDict = copy.d->m_actionDict; |
666 | //US setInstance( copy.instance() ); | 668 | //US setInstance( copy.instance() ); |
667 | return *this; | 669 | return *this; |
668 | } | 670 | } |
669 | 671 | ||
670 | KActionCollection &KActionCollection::operator+=( const KActionCollection &c ) | 672 | KActionCollection &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 | ||
677 | return *this; | 679 | return *this; |
678 | } | 680 | } |
679 | // KDE 4: remove end | 681 | // KDE 4: remove end |
680 | 682 | ||
681 | //--------------------------------------------------------------------- | 683 | //--------------------------------------------------------------------- |
682 | // KActionShortcutList | 684 | // KActionShortcutList |
683 | //--------------------------------------------------------------------- | 685 | //--------------------------------------------------------------------- |
684 | /*US | 686 | /*US |
685 | KActionShortcutList::KActionShortcutList( KActionCollection* pColl ) | 687 | KActionShortcutList::KActionShortcutList( KActionCollection* pColl ) |
686 | : m_actions( *pColl ) | 688 | : m_actions( *pColl ) |
687 | { } | 689 | { } |
688 | KActionShortcutList::~KActionShortcutList() | 690 | KActionShortcutList::~KActionShortcutList() |
689 | { } | 691 | { } |