summaryrefslogtreecommitdiffstats
path: root/kmdi
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-31 06:26:14 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-31 06:26:14 +0000
commitf007f85c4dc9ed297291c2a209bba73663ecd37b (patch)
treeaf24a01bffa79a5d2006320aed4a3aab0895a8f2 /kmdi
parentc6ea5f2c665bbc4b9c512d3d1fee3a7b58040f5d (diff)
downloadtdelibs-f007f85c4dc9ed297291c2a209bba73663ecd37b.tar.gz
tdelibs-f007f85c4dc9ed297291c2a209bba73663ecd37b.zip
Convert qt_cast() to ::qt_cast<>
This should fix some random segfaults It needs to be tested to make sure that interfaces still work, e.g. kate/kwrite interfaces in interface/ktexteditor git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1218078 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmdi')
-rw-r--r--kmdi/kmdi/dockcontainer.cpp26
-rw-r--r--kmdi/kmdi/guiclient.cpp4
-rw-r--r--kmdi/kmdi/mainwindow.cpp8
-rw-r--r--kmdi/kmdidockcontainer.cpp19
-rw-r--r--kmdi/kmdiguiclient.cpp4
-rw-r--r--kmdi/kmdimainfrm.cpp8
6 files changed, 33 insertions, 36 deletions
diff --git a/kmdi/kmdi/dockcontainer.cpp b/kmdi/kmdi/dockcontainer.cpp
index 017d8a02a..eb8518a4a 100644
--- a/kmdi/kmdi/dockcontainer.cpp
+++ b/kmdi/kmdi/dockcontainer.cpp
@@ -119,7 +119,7 @@ DockContainer::~DockContainer()
it = m_map.begin();
KDockWidget *w=it.key();
if (m_overlapButtons.tqcontains(w)) {
- (static_cast<KDockWidgetHeader*>(w->getHeader()->qt_cast("KDockWidgetHeader")))->removeButton(m_overlapButtons[w]);
+ (::tqqt_cast<KDockWidgetHeader*>(w->getHeader()))->removeButton(m_overlapButtons[w]);
m_overlapButtons.remove(w);
}
m_map.remove(w);
@@ -148,8 +148,8 @@ void DockContainer::init()
// try to restore splitter size
if ( parentDockWidget() && parentDockWidget()->parent() )
{
- KDockSplitter *sp= static_cast<KDockSplitter*>(parentDockWidget()->
- tqparent()->qt_cast("KDockSplitter"));
+ KDockSplitter *sp= ::tqqt_cast<KDockSplitter*>(parentDockWidget()->
+ tqparent());
if ( sp )
sp->setSeparatorPosX( m_separatorPos );
}
@@ -184,12 +184,11 @@ void DockContainer::insertWidget (KDockWidget *dwdg, TQPixmap pixmap, const TQSt
if (((KDockWidget*)tqparentWidget())->mayBeShow())
((KDockWidget*)tqparentWidget())->dockBack();
- if (w->getHeader()->qt_cast("KDockWidgetHeader"))
+ if (::tqqt_cast<KDockWidgetHeader*>(w->getHeader()))
{
kdDebug(760)<<"*** KDockWidgetHeader has been found"<<endl;
- KDockWidgetHeader *hdr=static_cast<KDockWidgetHeader*>(w->getHeader()->
- qt_cast("KDockWidgetHeader"));
+ KDockWidgetHeader *hdr=::tqqt_cast<KDockWidgetHeader*>(w->getHeader());
KDockButton_Private *btn = new KDockButton_Private( hdr, "OverlapButton" );
@@ -256,8 +255,7 @@ bool DockContainer::eventFilter( TQObject *obj, TQEvent *event )
kdDebug()<<"NO HEADER"<<endl;
break;
}
- KDockWidgetHeader *hdr=static_cast<KDockWidgetHeader*>(w->getHeader()->
- qt_cast("KDockWidgetHeader"));
+ KDockWidgetHeader *hdr=::tqqt_cast<KDockWidgetHeader*>(w->getHeader());
if (!hdr) {
kdDebug()<<"Wrong header type in DockContainer::eventFilter"<<endl;
break;
@@ -357,7 +355,7 @@ void DockContainer::removeWidget(KDockWidget* dwdg)
m_map.remove(w);
m_revMap.remove(id);
if (m_overlapButtons.tqcontains(w)) {
- (static_cast<KDockWidgetHeader*>(w->getHeader()->qt_cast("KDockWidgetHeader")))->removeButton(m_overlapButtons[w]);
+ (::tqqt_cast<KDockWidgetHeader*>(w->getHeader()))->removeButton(m_overlapButtons[w]);
m_overlapButtons.remove(w);
}
KDockContainer::removeWidget(w);
@@ -405,7 +403,7 @@ void DockContainer::tabClicked(int t)
}
m_ws->raiseWidget(t);
if (m_ws->widget(t)) {
- KDockWidget *tmpDw=static_cast<KDockWidget*>(m_ws->widget(t)->qt_cast("KDockWidget"));
+ KDockWidget *tmpDw=::tqqt_cast<KDockWidget*>(m_ws->widget(t));
if (tmpDw) {
if (tmpDw->getWidget()) tmpDw->getWidget()->setFocus();
} else kdDebug(760)<<"Something really weird is going on"<<endl;
@@ -422,8 +420,8 @@ void DockContainer::tabClicked(int t)
// try save splitter position
if ( parentDockWidget() && parentDockWidget()->parent() )
{
- KDockSplitter *sp= static_cast<KDockSplitter*>(parentDockWidget()->
- tqparent()->qt_cast("KDockSplitter"));
+ KDockSplitter *sp= ::tqqt_cast<KDockSplitter*>(parentDockWidget()->
+ tqparent());
if ( sp )
m_separatorPos = sp->separatorPos();
}
@@ -475,8 +473,8 @@ void DockContainer::save(KConfig* cfg,const TQString& group_or_prefix)
// try to save the splitter position
if ( parentDockWidget() && parentDockWidget()->parent() )
{
- KDockSplitter *sp= static_cast<KDockSplitter*>(parentDockWidget()->
- tqparent()->qt_cast("KDockSplitter"));
+ KDockSplitter *sp= ::tqqt_cast<KDockSplitter*>(parentDockWidget()->
+ tqparent());
if ( sp )
cfg->writeEntry( "separatorPosition", m_separatorPos );
}
diff --git a/kmdi/kmdi/guiclient.cpp b/kmdi/kmdi/guiclient.cpp
index c5d2ab115..6d61f16e3 100644
--- a/kmdi/kmdi/guiclient.cpp
+++ b/kmdi/kmdi/guiclient.cpp
@@ -201,8 +201,8 @@ void ToggleToolViewAction::anDWChanged()
else if ((!isChecked()) && m_dw->mayBeHide())
setChecked(true);
else if (isChecked() && (m_dw->parentDockTabGroup() &&
- ((static_cast<KDockWidget*>(m_dw->parentDockTabGroup()->
- tqparent()->qt_cast("KDockWidget")))->mayBeShow())))
+ ((::tqqt_cast<KDockWidget*>(m_dw->parentDockTabGroup()->
+ tqparent()))->mayBeShow())))
setChecked(false);
}
diff --git a/kmdi/kmdi/mainwindow.cpp b/kmdi/kmdi/mainwindow.cpp
index 4b643e3d4..26044879e 100644
--- a/kmdi/kmdi/mainwindow.cpp
+++ b/kmdi/kmdi/mainwindow.cpp
@@ -311,16 +311,16 @@ void MainWindow::setToolViewStyle(int flag)
{
d->m_styleIDEAlMode = flag; // see KMultiTabBar for the first 3 bits
- DockContainer *tmpL=(DockContainer*) (m_leftContainer->getWidget()->qt_cast("KMDI::DockContainer"));
+ DockContainer *tmpL=::tqqt_cast<KMDI::DockContainer*>(m_leftContainer->getWidget());
if (tmpL) tmpL->setStyle(flag);
- DockContainer *tmpR=(DockContainer*) (m_rightContainer->getWidget()->qt_cast("KMDI::DockContainer"));
+ DockContainer *tmpR=::tqqt_cast<KMDI::DockContainer*>(m_rightContainer->getWidget());
if (tmpR) tmpR->setStyle(flag);
- DockContainer *tmpT=(DockContainer*) (m_topContainer->getWidget()->qt_cast("KMDI::DockContainer"));
+ DockContainer *tmpT=::tqqt_cast<KMDI::DockContainer*>(m_topContainer->getWidget());
if (tmpT) tmpT->setStyle(flag);
- DockContainer *tmpB=(DockContainer*) (m_bottomContainer->getWidget()->qt_cast("KMDI::DockContainer"));
+ DockContainer *tmpB=::tqqt_cast<KMDI::DockContainer*>(m_bottomContainer->getWidget());
if (tmpB) tmpB->setStyle(flag);
d->m_toolviewStyle = flag;
diff --git a/kmdi/kmdidockcontainer.cpp b/kmdi/kmdidockcontainer.cpp
index e14d826e4..8198541fe 100644
--- a/kmdi/kmdidockcontainer.cpp
+++ b/kmdi/kmdidockcontainer.cpp
@@ -140,7 +140,7 @@ KMdiDockContainer::~KMdiDockContainer()
KDockWidget *w = it.key();
if ( m_overlapButtons.tqcontains( w ) )
{
- ( static_cast<KDockWidgetHeader*>( w->getHeader()->qt_cast( "KDockWidgetHeader" ) ) )->removeButton( m_overlapButtons[w] );
+ ( ::tqqt_cast<KDockWidgetHeader*>( w->getHeader() ) )->removeButton( m_overlapButtons[w] );
m_overlapButtons.remove( w );
}
m_map.remove( w );
@@ -172,7 +172,7 @@ void KMdiDockContainer::init()
// try to restore splitter size
if ( parentDockWidget() && parentDockWidget()->tqparent() )
{
- KDockSplitter * sp = static_cast<KDockSplitter*>( parentDockWidget()->tqparent()->qt_cast( "KDockSplitter" ) );
+ KDockSplitter * sp = ::tqqt_cast<KDockSplitter*>( parentDockWidget()->tqparent() );
if ( sp )
sp->setSeparatorPosX( m_separatorPos );
}
@@ -207,12 +207,12 @@ void KMdiDockContainer::insertWidget ( KDockWidget *dwdg, TQPixmap pixmap, const
if ( ( ( KDockWidget* ) tqparentWidget() ) ->mayBeShow() )
( ( KDockWidget* ) tqparentWidget() ) ->dockBack();
- if ( w->getHeader()->qt_cast( "KDockWidgetHeader" ) )
+ if ( ::tqqt_cast<KDockWidgetHeader*>(w->getHeader()) )
{
kdDebug( 760 ) << k_funcinfo << "The dockwidget we're adding has a header" << endl;
kdDebug( 760 ) << k_funcinfo << "Adding our overlap mode button to it" << endl;
- KDockWidgetHeader *hdr = static_cast<KDockWidgetHeader*>( w->getHeader()->qt_cast( "KDockWidgetHeader" ) );
+ KDockWidgetHeader *hdr = ::tqqt_cast<KDockWidgetHeader*>( w->getHeader() );
KDockButton_Private *btn = new KDockButton_Private( hdr, "OverlapButton" );
TQToolTip::add( btn, i18n( "Switch between overlap and side by side mode", "Overlap" ) );
@@ -272,7 +272,7 @@ bool KMdiDockContainer::eventFilter( TQObject *obj, TQEvent *event )
break;
}
- KDockWidgetHeader *hdr = static_cast<KDockWidgetHeader*>( w->getHeader()->qt_cast( "KDockWidgetHeader" ) );
+ KDockWidgetHeader *hdr = ::tqqt_cast<KDockWidgetHeader*>( w->getHeader() );
if ( !hdr )
{
kdDebug(760) << "Wrong header type in KMdiDockContainer::eventFilter" << endl;
@@ -387,7 +387,7 @@ void KMdiDockContainer::removeWidget( KDockWidget* dwdg )
m_revMap.remove( id );
if ( m_overlapButtons.tqcontains( w ) )
{
- ( static_cast<KDockWidgetHeader*>( w->getHeader() ->qt_cast( "KDockWidgetHeader" ) ) )->removeButton( m_overlapButtons[ w ] );
+ ( ::tqqt_cast<KDockWidgetHeader*>( w->getHeader() ) )->removeButton( m_overlapButtons[ w ] );
m_overlapButtons.remove( w );
}
KDockContainer::removeWidget( w );
@@ -442,7 +442,7 @@ void KMdiDockContainer::tabClicked( int t )
if ( m_ws->widget( t ) )
{
m_ws->raiseWidget( t );
- KDockWidget * tmpDw = static_cast<KDockWidget*>( m_ws->widget( t )->qt_cast( "KDockWidget" ) );
+ KDockWidget * tmpDw = ::tqqt_cast<KDockWidget*>( m_ws->widget( t ) );
if ( tmpDw )
{
if ( tmpDw->getWidget() )
@@ -467,7 +467,7 @@ void KMdiDockContainer::tabClicked( int t )
// try save splitter position
if ( parentDockWidget() && parentDockWidget()->tqparent() )
{
- KDockSplitter * sp = static_cast<KDockSplitter*>( parentDockWidget()->tqparent()->qt_cast( "KDockSplitter" ) );
+ KDockSplitter * sp = ::tqqt_cast<KDockSplitter*>( parentDockWidget()->tqparent() );
if ( sp )
m_separatorPos = sp->separatorPos();
}
@@ -638,8 +638,7 @@ void KMdiDockContainer::save( KConfig* cfg, const TQString& group_or_prefix )
// try to save the splitter position
if ( parentDockWidget() && parentDockWidget() ->tqparent() )
{
- KDockSplitter * sp = static_cast<KDockSplitter*>( parentDockWidget() ->
- tqparent() ->qt_cast( "KDockSplitter" ) );
+ KDockSplitter * sp = ::tqqt_cast<KDockSplitter*>( parentDockWidget() -> tqparent() );
if ( sp )
cfg->writeEntry( "separatorPosition", m_separatorPos );
}
diff --git a/kmdi/kmdiguiclient.cpp b/kmdi/kmdiguiclient.cpp
index c99c05b01..cebeafc4f 100644
--- a/kmdi/kmdiguiclient.cpp
+++ b/kmdi/kmdiguiclient.cpp
@@ -83,8 +83,8 @@ void ToggleToolViewAction::anDWChanged()
else if ( ( !isChecked() ) && m_dw->mayBeHide() )
setChecked( true );
else if ( isChecked() && ( m_dw->parentDockTabGroup() &&
- ( ( static_cast<KDockWidget*>( m_dw->parentDockTabGroup() ->
- tqparent() ->qt_cast( "KDockWidget" ) ) ) ->mayBeShow() ) ) )
+ ( ( ::tqqt_cast<KDockWidget*>( m_dw->parentDockTabGroup() ->
+ tqparent() ) ) ->mayBeShow() ) ) )
setChecked( false );
}
diff --git a/kmdi/kmdimainfrm.cpp b/kmdi/kmdimainfrm.cpp
index 107c4d982..fe6c374f1 100644
--- a/kmdi/kmdimainfrm.cpp
+++ b/kmdi/kmdimainfrm.cpp
@@ -1739,28 +1739,28 @@ void KMdiMainFrm::setIDEAlModeStyle( int flags )
d->m_styleIDEAlMode = flags; // see KMultiTabBar for the first 3 bits
if ( m_leftContainer )
{
- KMdiDockContainer * tmpL = ( KMdiDockContainer* ) ( m_leftContainer->getWidget()->qt_cast( "KMdiDockContainer" ) );
+ KMdiDockContainer * tmpL = ::tqqt_cast<KMdiDockContainer*>( m_leftContainer->getWidget() );
if ( tmpL )
tmpL->setStyle( flags );
}
if ( m_rightContainer )
{
- KMdiDockContainer * tmpR = ( KMdiDockContainer* ) ( m_rightContainer->getWidget()->qt_cast( "KMdiDockContainer" ) );
+ KMdiDockContainer * tmpR = ::tqqt_cast<KMdiDockContainer*>( m_rightContainer->getWidget() );
if ( tmpR )
tmpR->setStyle( flags );
}
if ( m_topContainer )
{
- KMdiDockContainer * tmpT = ( KMdiDockContainer* ) ( m_topContainer->getWidget()->qt_cast( "KMdiDockContainer" ) );
+ KMdiDockContainer * tmpT = ::tqqt_cast<KMdiDockContainer*>( m_topContainer->getWidget() );
if ( tmpT )
tmpT->setStyle( flags );
}
if ( m_bottomContainer )
{
- KMdiDockContainer * tmpB = ( KMdiDockContainer* ) ( m_bottomContainer->getWidget()->qt_cast( "KMdiDockContainer" ) );
+ KMdiDockContainer * tmpB = ::tqqt_cast<KMdiDockContainer*>( m_bottomContainer->getWidget() );
if ( tmpB )
tmpB->setStyle( flags );
}