summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kaction.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kdeui/kaction.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kaction.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/microkde/kdeui/kaction.cpp b/microkde/kdeui/kaction.cpp
index 77d36a5..d38a6d5 100644
--- a/microkde/kdeui/kaction.cpp
+++ b/microkde/kdeui/kaction.cpp
@@ -207,17 +207,16 @@ KAction::KAction( QObject* parent, const char* name )
{
initPrivate( QString::null, KShortcut(), 0, 0 );
}
// KDE 4: remove end
KAction::~KAction()
{
- kdDebug(129) << "KAction::~KAction( this = \"" << name() << "\" )" << endl; // -- ellis
#ifndef KDE_NO_COMPAT
if (d->m_kaccel)
unplugAccel();
#endif
// If actionCollection hasn't already been destructed,
if ( m_parentCollection ) {
m_parentCollection->take( this );
@@ -430,17 +429,18 @@ bool KAction::setShortcut( const KShortcut& cut )
}
*/
return true;
}
bool KAction::updateKAccelShortcut( KAccel* kaccel )
{
- qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+ //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+
// Check if action is permitted
/*US
if (kapp && !kapp->authorizeKAction(name()))
return false;
bool b = true;
if ( !kaccel->actions().actionPtr( name() ) ) {
@@ -457,33 +457,35 @@ bool KAction::updateKAccelShortcut( KAccel* kaccel )
return b;
*/
return true;
}
void KAction::insertKAccel( KAccel* kaccel )
{
- qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+ //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed");
+
/*US
//kdDebug(129) << "KAction::insertKAccel( " << kaccel << " ): this = " << this << endl;
if ( !kaccel->actions().actionPtr( name() ) ) {
if( updateKAccelShortcut( kaccel ) ) {
d->m_kaccelList.append( kaccel );
connect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
}
}
else
kdWarning(129) << "KAction::insertKAccel( kaccel = " << kaccel << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis
*/
}
void KAction::removeKAccel( KAccel* kaccel )
{
- qDebug("KAction::removeKAccel~ ...1 has top be fixed");
+ // qDebug("KAction::removeKAccel~ ...1 has top be fixed");
+
/*US
//kdDebug(129) << "KAction::removeKAccel( " << i << " ): this = " << this << endl;
for( uint i = 0; i < d->m_kaccelList.count(); i++ ) {
if( d->m_kaccelList[i] == kaccel ) {
kaccel->remove( name() );
d->m_kaccelList.remove( d->m_kaccelList.at( i ) );
disconnect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
break;
@@ -506,17 +508,18 @@ void KAction::updateShortcut( int i )
QWidget* w = container( i );
if ( w->inherits( "QPopupMenu" ) ) {
QPopupMenu* menu = static_cast<QPopupMenu*>(w);
updateShortcut( menu, id );
}
else if ( w->inherits( "QMenuBar" ) )
//US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id );
//US (QMenuBar*)(w)->setAccel( d->m_cut.keyCodeQt(), id );
- qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed");
+
+ ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed");
}
void KAction::updateShortcut( QPopupMenu* menu, int id )
{
/*US
//kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl;
// If the action has a KAccel object,
@@ -534,17 +537,19 @@ void KAction::updateShortcut( QPopupMenu* menu, int id )
// Otherwise insert the shortcut itself into the popup menu.
else {
// This is a fall-hack in case the KAction is missing a proper parent collection.
// It should be removed eventually. --ellis
menu->setAccel( d->m_cut.keyCodeQt(), id );
kdWarning(129) << "KAction::updateShortcut(): name = \"" << name() << "\", cut = " << d->m_cut.toStringInternal() << "; No KAccel, probably missing a parent collection." << endl;
}
*/
- qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed");
+
+
+//qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed");
}
const KShortcut& KAction::shortcut() const
{
return d->m_cut;
}
@@ -560,17 +565,17 @@ QString KAction::shortcutText() const
void KAction::setShortcutText( const QString& s )
{
setShortcut( KShortcut(s) );
}
int KAction::accel() const
{
- qDebug("KAction::accel() ...1 has top be fixed");
+ // qDebug("KAction::accel() ...1 has top be fixed");
//US return d->m_cut.keyCodeQt();
return 0;
}
void KAction::setGroup( const QString& grp )
{
d->m_group = grp;
@@ -596,27 +601,27 @@ bool KAction::isEnabled() const
bool KAction::isShortcutConfigurable() const
{
return d->m_configurable;
}
void KAction::setToolTip( const QString& tt )
{
- qDebug("KAction::setToolTip ...1 has top be fixed");
+ //qDebug("KAction::setToolTip ...1 has top be fixed");
d->setToolTip( tt );
int len = containerCount();
for( int i = 0; i < len; ++i )
updateToolTip( i );
}
void KAction::updateToolTip( int i )
{
- qDebug("KAction::updateToolTip ...1 has top be fixed");
+ //qDebug("KAction::updateToolTip ...1 has top be fixed");
QWidget *w = container( i );
if ( w->inherits( "KToolBar" ) )
QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
else if ( w->inherits( "QToolBar" ) )
QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() );
}
@@ -628,24 +633,17 @@ QString KAction::toolTip() const
int KAction::plug( QWidget *w, int index )
{
//kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl;
if (w == 0) {
kdWarning(129) << "KAction::plug called with 0 argument\n";
return -1;
}
-#ifndef NDEBUG
- KAccel* kaccel = kaccelCurrent();
- // If there is a shortcut, but no KAccel available
- if( !d->m_cut.isNull() && kaccel == 0 ) {
- kdWarning(129) << "KAction::plug(): has no KAccel object; this = " << this << " name = " << name() << " parentCollection = " << m_parentCollection << endl; // ellis
-//US kdDebug(129) << kdBacktrace() << endl;
- }
-#endif
+
// Check if action is permitted
//US if (kapp && !kapp->authorizeKAction(name()))
//US return -1;
plugShortcut();
if ( w->inherits("QPopupMenu") )
@@ -770,17 +768,18 @@ void KAction::unplug( QWidget *w )
removeContainer( i );
if ( m_parentCollection )
m_parentCollection->disconnectHighlight( w, this );
}
void KAction::plugAccel(KAccel *kacc, bool configurable)
{
- qDebug("KAction::plugAccel ...1 has top be fixed");
+ // qDebug("KAction::plugAccel ...1 has top be fixed");
+
/*US
kdWarning(129) << "KAction::plugAccel(): call to deprecated action." << endl;
kdDebug(129) << kdBacktrace() << endl;
//kdDebug(129) << "KAction::plugAccel( kacc = " << kacc << " ): name \"" << name() << "\"" << endl;
if ( d->m_kaccel )
unplugAccel();
// If the parent collection's accel ptr isn't set yet
@@ -801,30 +800,31 @@ void KAction::plugAccel(KAccel *kacc, bool configurable)
}
else
kdWarning(129) << "KAction::plugAccel( kacc = " << kacc << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis
*/
}
void KAction::unplugAccel()
{
- qDebug("KAction::unplugAccel ...1 has top be fixed");
+ // qDebug("KAction::unplugAccel ...1 has top be fixed");
/*US
//kdDebug(129) << "KAction::unplugAccel() " << this << " " << name() << endl;
if ( d->m_kaccel )
{
d->m_kaccel->remove(name());
d->m_kaccel = 0;
}
*/
}
void KAction::plugMainWindowAccel( QWidget *w )
{
- qDebug("KAction::plugMainWindowAccel ...1 has top be fixed");
+ // qDebug("KAction::plugMainWindowAccel ...1 has top be fixed");
+
/*US
// Note: topLevelWidget() stops too early, we can't use it.
QWidget * tl = w;
QWidget * n;
while ( !tl->isDialog() && ( n = tl->parentWidget() ) ) // lookup parent and store
tl = n;
KMainWindow * mw = dynamic_cast<KMainWindow *>(tl); // try to see if it's a kmainwindow
@@ -910,17 +910,17 @@ void KAction::updateText( int i )
int id = itemId( i );
static_cast<QPopupMenu*>(w)->changeItem( id, d->text() );
updateShortcut( static_cast<QPopupMenu*>(w), id );
}
else if ( w->inherits( "QMenuBar" ) )
static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() );
else if ( w->inherits( "KToolBar" ) )
{
- qDebug("KAction::updateText ...3 has top be fixed");
+ //qDebug("KAction::updateText ...3 has top be fixed");
QWidget *button = static_cast<KToolBar *>(w)->getWidget( itemId( i ) );
if ( button->inherits( "KToolBarButton" ) )
static_cast<KToolBarButton *>(button)->setText( d->plainText() );
}
}
QString KAction::text() const
@@ -1113,17 +1113,17 @@ void KAction::activate()
void KAction::slotActivated()
{
emit activated();
}
void KAction::slotDestroyed()
{
- kdDebug(129) << "KAction::slotDestroyed(): this = " << this << ", name = \"" << name() << "\", sender = " << sender() << endl;
+
const QObject* o = sender();
/*
// KDE 4: remove
if ( o == d->m_kaccel )
{