From e7ab2281e0a87e8b0628415a7fea8ae6026837e4 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 28 Jun 2006 13:19:52 +0000 Subject: [PATCH] no message --- src/ObjBrowser/OB_ListItem.cxx | 6 +++++- src/Qtx/QtxListAction.cxx | 5 ++++- src/Qtx/QtxResourceMgr.h | 2 ++ src/Qtx/QtxWorkstack.cxx | 11 ++++++----- src/STD/STD_Application.cxx | 8 ++++++-- src/SUIT/SUIT_ResourceMgr.cxx | 1 + src/SUIT/SUIT_Session.cxx | 4 ++++ 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/ObjBrowser/OB_ListItem.cxx b/src/ObjBrowser/OB_ListItem.cxx index b91b92e2d..728e3ddc5 100755 --- a/src/ObjBrowser/OB_ListItem.cxx +++ b/src/ObjBrowser/OB_ListItem.cxx @@ -28,6 +28,10 @@ #include using namespace std; +#ifdef WNT +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif + /*! Constructor */ @@ -221,7 +225,7 @@ void OB_ListItem::paintCell( QPainter* p, const QColorGroup& cg, int c, int w, i if ( listView() && !listView()->allColumnsShowFocus() ) W = width( p->fontMetrics(), listView(), c ); - QListViewItem::paintCell( p, col_group, c, min( W, w ), align ); + QListViewItem::paintCell( p, col_group, c, min( W, w ), align ); } /*! diff --git a/src/Qtx/QtxListAction.cxx b/src/Qtx/QtxListAction.cxx index e3c4a8484..52f093039 100755 --- a/src/Qtx/QtxListAction.cxx +++ b/src/Qtx/QtxListAction.cxx @@ -144,8 +144,11 @@ myRaise( false ) QtxListAction::~QtxListAction() { - if ( myFrame ) + if ( myFrame ) { myFrame->myAction = 0; + delete myFrame; + myFrame = 0; + } } /*! diff --git a/src/Qtx/QtxResourceMgr.h b/src/Qtx/QtxResourceMgr.h index 0bf57831c..0071fe5f4 100644 --- a/src/Qtx/QtxResourceMgr.h +++ b/src/Qtx/QtxResourceMgr.h @@ -175,6 +175,8 @@ private: bool myIsPixmapCached; bool myIsIgnoreUserValues; + + friend class QtxResourceMgr::Format; }; /*! diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 16bdb04b1..f35752e4b 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -1424,7 +1424,8 @@ void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, // get splitter sizes and store it in the map for future setting QValueList sizes; QStringList sizesLst = QStringList::split( ':', ::getValue( params, "sizes" ) ); - for ( QStringList::Iterator it = sizesLst.begin(); it != sizesLst.end(); ++it ) + QStringList::Iterator it; + for ( it = sizesLst.begin(); it != sizesLst.end(); ++it ) sizes.append( (*it).toInt() ); sMap[ splitter ] = sizes; @@ -1442,7 +1443,7 @@ void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, // for ( QStringList::Iterator tit = children.begin(); tit != children.end(); ++tit ) // printf (" |-> child = [%s]\n", (*tit).latin1() ); - for ( QStringList::Iterator it = children.begin(); it != children.end(); ++it ) { + for ( it = children.begin(); it != children.end(); ++it ) { if ( (*it).startsWith( "(splitter" ) ) { QSplitter* newSplitter = new QSplitter( splitter ); setSplitter( newSplitter, *it, sMap ); @@ -1450,7 +1451,7 @@ void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, else if ( (*it).startsWith( "(views" ) ) { QtxWorkstackArea* newArea = createArea( splitter ); QString activeViewName = ::getValue( *it, "active" ); - QWidget* activeView( 0 ); + QWidget* activeView = 0; activeViewName = activeViewName.mid( 1, activeViewName.length()-2 ); // chop off ' symbols int i = 0; QString viewName = ::getViewName( *it, i ); @@ -1499,8 +1500,8 @@ QtxWorkstack& QtxWorkstack::operator<<( const QString& parameters ) qApp->processEvents(); // restore splitters' sizes (map of sizes is filled in setSplitters) - for ( QMap< QSplitter*, QValueList >::Iterator it = sMap.begin(); it != sMap.end(); ++it ) - it.key()->setSizes( it.data() ); + for ( QMap< QSplitter*, QValueList >::Iterator itm = sMap.begin(); itm != sMap.end(); ++itm ) + itm.key()->setSizes( itm.data() ); return (*this); } diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 5a74b4785..b845b1112 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -64,6 +64,7 @@ myActiveViewMgr( 0 ) /*!Destructor.*/ STD_Application::~STD_Application() { + clearViewManagers(); } /*! \retval QString "StdApplication"*/ @@ -691,8 +692,11 @@ void STD_Application::clearViewManagers() ViewManagerList lst; viewManagers( lst ); - for ( QPtrListIterator it( lst ); it.current(); ++it ) - removeViewManager( it.current() ); + for ( QPtrListIterator it( lst ); it.current(); ++it ) { + SUIT_ViewManager* vm = it.current(); + removeViewManager( vm ); + delete vm; + } } /*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/ diff --git a/src/SUIT/SUIT_ResourceMgr.cxx b/src/SUIT/SUIT_ResourceMgr.cxx index c184037fa..9e67db054 100755 --- a/src/SUIT/SUIT_ResourceMgr.cxx +++ b/src/SUIT/SUIT_ResourceMgr.cxx @@ -20,6 +20,7 @@ #include #include +#include /*! Constructor diff --git a/src/SUIT/SUIT_Session.cxx b/src/SUIT/SUIT_Session.cxx index 6d5f0669d..0b9aa1ee8 100755 --- a/src/SUIT/SUIT_Session.cxx +++ b/src/SUIT/SUIT_Session.cxx @@ -58,6 +58,10 @@ SUIT_Session::~SUIT_Session() { myAppList.clear(); + if (myResMgr) { + delete myResMgr; + myResMgr = 0; + } mySession = 0; } -- 2.39.2