From fcbc2d62b33db57308ea1668ec70de41d15e3fcd Mon Sep 17 00:00:00 2001 From: stv Date: Thu, 28 Jul 2005 09:40:26 +0000 Subject: [PATCH] no message --- src/Qtx/QtxDockAction.cxx | 33 +-- src/Qtx/QtxDockAction.h | 2 +- src/Qtx/QtxMRUAction.cxx | 2 +- src/Qtx/QtxResourceMgr.cxx | 533 +++++++++++++++++++++++++------------ src/Qtx/QtxResourceMgr.h | 44 +-- src/Qtx/QtxWorkstack.h | 7 +- 6 files changed, 398 insertions(+), 223 deletions(-) diff --git a/src/Qtx/QtxDockAction.cxx b/src/Qtx/QtxDockAction.cxx index a4c95128e..2c88abb4f 100755 --- a/src/Qtx/QtxDockAction.cxx +++ b/src/Qtx/QtxDockAction.cxx @@ -415,7 +415,7 @@ void QtxDockAction::saveGeometry( QtxResourceMgr* resMgr, const QString& section collectNames( i, that->myNames ); if ( clear ) - resMgr->removeSection( sec ); + resMgr->remove( sec ); resMgr->setValue( sec, "windows_list", myNames.join( "|" ) ); @@ -798,7 +798,7 @@ void QtxDockAction::loadPlaceInfo() const winList.append( mIt.data() ); QMap winMap; - QMap geomMap; + QMap geomMap; for ( QPtrListIterator it( winList ); it.current(); ++it ) { @@ -809,11 +809,12 @@ void QtxDockAction::loadPlaceInfo() const if ( !myGeom.contains( name ) ) continue; - GeomInfo inf( myGeom[name] ); + //! collect pointer of info to have fresh info data after processEvents(); + GeomInfo* inf = (GeomInfo*)&( myGeom[name] ); geomMap.insert( it.current(), inf ); - if ( !winMap.contains( inf.place ) ) - winMap.insert( inf.place, DockWinList() ); - winMap[inf.place].append( it.current() ); + if ( !winMap.contains( inf->place ) ) + winMap.insert( inf->place, DockWinList() ); + winMap[inf->place].append( it.current() ); } loadPlaceArea( DockMinimized, mw, 0, @@ -831,15 +832,15 @@ void QtxDockAction::loadPlaceInfo() const void QtxDockAction::loadPlaceArea( const int place, QMainWindow* mw, QDockArea* area, const QPtrList& dockList, - const QMap& geomMap ) const + const QMap& geomMap ) const { for ( QPtrListIterator it( dockList ); it.current(); ++it ) { if ( !geomMap.contains( it.current() ) ) continue; - const GeomInfo& inf = geomMap[it.current()]; - mw->moveDockWindow( it.current(), (Qt::Dock)place, inf.newLine, inf.index, inf.offset ); + GeomInfo* inf = geomMap[it.current()]; + mw->moveDockWindow( it.current(), (Qt::Dock)place, inf->newLine, inf->index, inf->offset ); } if ( !area ) @@ -853,17 +854,17 @@ void QtxDockAction::loadPlaceArea( const int place, QMainWindow* mw, QDockArea* if ( !geomMap.contains( dw ) ) continue; - const GeomInfo& inf = geomMap[dw]; + GeomInfo* inf = geomMap[dw]; if ( place != DockTornOff ) { - dw->setNewLine( inf.newLine ); - dw->setOffset( inf.offset ); - dw->setFixedExtentWidth( inf.fixW ); - dw->setFixedExtentHeight( inf.fixH ); + dw->setNewLine( inf->newLine ); + dw->setOffset( inf->offset ); + dw->setFixedExtentWidth( inf->fixW ); + dw->setFixedExtentHeight( inf->fixH ); } - dw->setGeometry( inf.x, inf.y, inf.w, inf.h ); + dw->setGeometry( inf->x, inf->y, inf->w, inf->h ); - inf.vis ? dw->show() : dw->hide(); + inf->vis ? dw->show() : dw->hide(); } QWidget* wid = area; diff --git a/src/Qtx/QtxDockAction.h b/src/Qtx/QtxDockAction.h index 48b79233e..8e443be9a 100755 --- a/src/Qtx/QtxDockAction.h +++ b/src/Qtx/QtxDockAction.h @@ -120,7 +120,7 @@ private: const QString&, const GeomInfo& ) const; void loadPlaceArea( const int, QMainWindow*, QDockArea*, const QPtrList&, - const QMap& ) const; + const QMap& ) const; private: InfoMap myInfo; diff --git a/src/Qtx/QtxMRUAction.cxx b/src/Qtx/QtxMRUAction.cxx index a281d584d..4e0074bc4 100755 --- a/src/Qtx/QtxMRUAction.cxx +++ b/src/Qtx/QtxMRUAction.cxx @@ -387,7 +387,7 @@ void QtxMRUAction::saveLinks( QtxResourceMgr* resMgr, const QString& section, co return; if ( clear ) - resMgr->removeSection( section ); + resMgr->remove( section ); QStringList lst; QMap map; diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index c53e97c42..b9249875b 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -274,7 +274,7 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMapload(); } +/*! + \brief Removes all resources from the manager. +*/ void QtxResourceMgr::clear() { for ( ResListIterator it( myResources ); it.current(); ++it ) it.current()->clear(); } -QString QtxResourceMgr::currentSection() const -{ - return myCurSection; -} - -void QtxResourceMgr::setCurrentSection( const QString& str ) -{ - myCurSection = str; -} - -bool QtxResourceMgr::value( const QString& name, int& val ) const -{ - return value( currentSection(), name, val ); -} - -bool QtxResourceMgr::value( const QString& name, double& val ) const -{ - return value( currentSection(), name, val ); -} - -bool QtxResourceMgr::value( const QString& name, bool& val ) const -{ - return value( currentSection(), name, val ); -} - -bool QtxResourceMgr::value( const QString& name, QColor& val ) const -{ - return value( currentSection(), name, val ); -} - -bool QtxResourceMgr::value( const QString& name, QFont& val ) const -{ - return value( currentSection(), name, val ); -} - -bool QtxResourceMgr::value( const QString& name, QString& val, const bool subst ) const -{ - return value( currentSection(), name, val, subst ); -} - +/*! + \brief Get the resource value as integer. Returns 'true' if it successfull otherwise + returns 'false'. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param iVal - Reference on the variable which should contains the resource output. +*/ bool QtxResourceMgr::value( const QString& sect, const QString& name, int& iVal ) const { QString val; @@ -692,6 +737,13 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, int& iVal return ok; } +/*! + \brief Get the resource value as double. Returns 'true' if it successfull otherwise + returns 'false'. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param dVal - Reference on the variable which should contains the resource output. +*/ bool QtxResourceMgr::value( const QString& sect, const QString& name, double& dVal ) const { QString val; @@ -704,6 +756,13 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, double& dV return ok; } +/*! + \brief Get the resource value as boolean. Returns 'true' if it successfull otherwise + returns 'false'. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param bVal - Reference on the variable which should contains the resource output. +*/ bool QtxResourceMgr::value( const QString& sect, const QString& name, bool& bVal ) const { QString val; @@ -731,6 +790,13 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, bool& bVal return res; } +/*! + \brief Get the resource value as color. Returns 'true' if it successfull otherwise + returns 'false'. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param cVal - Reference on the variable which should contains the resource output. +*/ bool QtxResourceMgr::value( const QString& sect, const QString& name, QColor& cVal ) const { QString val; @@ -756,45 +822,61 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QColor& cV return res; } +/*! + \brief Get the resource value as font. Returns 'true' if it successfull otherwise + returns 'false'. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param fVal - Reference on the variable which should contains the resource output. +*/ bool QtxResourceMgr::value( const QString& sect, const QString& name, QFont& fVal ) const { - QString val = stringValue( sect, name, "" ); - QStringList font_values = QStringList::split( ",", val ); - if( font_values.count()<2 || font_values.count()>5 ) + QString val; + if ( !value( sect, name, val, true ) ) + return false; + + QStringList fontDescr = QStringList::split( ",", val ); + + if ( fontDescr.count() < 2 ) + return false; + + QString family = fontDescr[0]; + if ( family.isEmpty() ) return false; - - QString family = font_values[0]; - bool isBold = false, isItalic = false, isUnderline = false, isOk = false; - int pSize = -1; - for( int i=1, n=font_values.count(); i0 && !family.isEmpty() ) - { - fVal = QFont( family, pSize ); - fVal.setBold( isBold ); - fVal.setItalic( isItalic ); - fVal.setUnderline( isUnderline ); - return true; - } - else - return false; + return true; } +/*! + \brief Get the resource value as string (native format). Returns 'true' if it + successfull otherwise returns 'false'. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param val - Reference on the variable which should contains the resource output. + \param subst - If 'true' then manager substitute reference on environment variables + and other resources by thier values. Default value of this parameter + is 'true' +*/ bool QtxResourceMgr::value( const QString& sect, const QString& name, QString& val, const bool subst ) const { initialize(); @@ -810,36 +892,13 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QString& v return ok; } -int QtxResourceMgr::integerValue( const QString& name, const int def ) const -{ - return integerValue( currentSection(), name, def ); -} - -double QtxResourceMgr::doubleValue( const QString& name, const double def ) const -{ - return doubleValue( currentSection(), name, def ); -} - -bool QtxResourceMgr::booleanValue( const QString& name, const bool def ) const -{ - return booleanValue( currentSection(), name, def ); -} - -QFont QtxResourceMgr::fontValue( const QString& name, const QFont& def ) const -{ - return fontValue( currentSection(), name, def ); -} - -QColor QtxResourceMgr::colorValue( const QString& name, const QColor& def ) const -{ - return colorValue( currentSection(), name, def ); -} - -QString QtxResourceMgr::stringValue( const QString& name, const char* def ) const -{ - return stringValue( currentSection(), name, def ); -} - +/*! + \brief Returns the integer resource value. If resource can not be found or converted + then specified default value will be returned. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param def - Default resource value which will be used when resource not found. +*/ int QtxResourceMgr::integerValue( const QString& sect, const QString& name, const int def ) const { int val; @@ -848,6 +907,13 @@ int QtxResourceMgr::integerValue( const QString& sect, const QString& name, cons return val; } +/*! + \brief Returns the double resource value. If resource can not be found or converted + then specified default value will be returned. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param def - Default resource value which will be used when resource not found. +*/ double QtxResourceMgr::doubleValue( const QString& sect, const QString& name, const double def ) const { double val; @@ -856,6 +922,13 @@ double QtxResourceMgr::doubleValue( const QString& sect, const QString& name, co return val; } +/*! + \brief Returns the boolean resource value. If resource can not be found or converted + then specified default value will be returned. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param def - Default resource value which will be used when resource not found. +*/ bool QtxResourceMgr::booleanValue( const QString& sect, const QString& name, const bool def ) const { bool val; @@ -864,6 +937,13 @@ bool QtxResourceMgr::booleanValue( const QString& sect, const QString& name, con return val; } +/*! + \brief Returns the font resource value. If resource can not be found or converted + then specified default value will be returned. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param def - Default resource value which will be used when resource not found. +*/ QFont QtxResourceMgr::fontValue( const QString& sect, const QString& name, const QFont& def ) const { QFont font; @@ -872,6 +952,13 @@ QFont QtxResourceMgr::fontValue( const QString& sect, const QString& name, const return font; } +/*! + \brief Returns the color resource value. If resource can not be found or converted + then specified default value will be returned. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param def - Default resource value which will be used when resource not found. +*/ QColor QtxResourceMgr::colorValue( const QString& sect, const QString& name, const QColor& def ) const { QColor val; @@ -880,7 +967,14 @@ QColor QtxResourceMgr::colorValue( const QString& sect, const QString& name, con return val; } -QString QtxResourceMgr::stringValue( const QString& sect, const QString& name, const char* def ) const +/*! + \brief Returns the string resource value. If resource can not be found or converted + then specified default value will be returned. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. + \param def - Default resource value which will be used when resource not found. +*/ +QString QtxResourceMgr::stringValue( const QString& sect, const QString& name, const QString& def ) const { QString val; if ( !value( sect, name, val ) ) @@ -888,11 +982,11 @@ QString QtxResourceMgr::stringValue( const QString& sect, const QString& name, c return val; } -bool QtxResourceMgr::hasValue( const QString& name ) const -{ - return hasValue( currentSection(), name ); -} - +/*! + \brief Checks existance of the specified resource. + \param sect - Resource section name which contains resource. + \param name - Name of the resource. +*/ bool QtxResourceMgr::hasValue( const QString& sect, const QString& name ) const { initialize(); @@ -904,6 +998,10 @@ bool QtxResourceMgr::hasValue( const QString& sect, const QString& name ) const return ok; } +/*! + \brief Checks existance of the specified resource section. + \param sect - Resource section name which contains resource. +*/ bool QtxResourceMgr::hasSection( const QString& sect ) const { initialize(); @@ -915,100 +1013,134 @@ bool QtxResourceMgr::hasSection( const QString& sect ) const return ok; } -void QtxResourceMgr::setValue( const QString& name, int val ) +/*! + \brief Sets the integer resource value. + \param sect - Resource section name. + \param name - Name of the resource. + \param val - Resource value. +*/ +void QtxResourceMgr::setValue( const QString& sect, const QString& name, int val ) { - setValue( currentSection(), name, val ); -} + int res; + if ( checkExisting() && value( sect, name, res ) && res == val ) + return; -void QtxResourceMgr::setValue( const QString& name, double val ) -{ - setValue( currentSection(), name, val ); + setResource( sect, name, QString::number( val ) ); } -void QtxResourceMgr::setValue( const QString& name, bool val ) +/*! + \brief Sets the double resource value. + \param sect - Resource section name. + \param name - Name of the resource. + \param val - Resource value. +*/ +void QtxResourceMgr::setValue( const QString& sect, const QString& name, double val ) { - setValue( currentSection(), name, val ); -} + double res; + if ( checkExisting() && value( sect, name, res ) && res == val ) + return; -void QtxResourceMgr::setValue( const QString& name, const QColor& val ) -{ - setValue( currentSection(), name, val ); + setResource( sect, name, QString::number( val, 'g', 12 ) ); } -void QtxResourceMgr::setValue( const QString& name, const QFont& val ) +/*! + \brief Sets the boolean resource value. + \param sect - Resource section name. + \param name - Name of the resource. + \param val - Resource value. +*/ +void QtxResourceMgr::setValue( const QString& sect, const QString& name, bool val ) { - setValue( currentSection(), name, val ); -} + bool res; + if ( checkExisting() && value( sect, name, res ) && res == val ) + return; -void QtxResourceMgr::setValue( const QString& name, const QString& val ) -{ - setValue( currentSection(), name, val ); + setResource( sect, name, QString( val ? "true" : "false" ) ); } -void QtxResourceMgr::setValue( const QString& sect, const QString& name, int val ) +/*! + \brief Sets the color resource value. + \param sect - Resource section name. + \param name - Name of the resource. + \param val - Resource value. +*/ +void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QColor& val ) { - setValue( sect, name, QString::number( val ) ); -} + QColor res; + if ( checkExisting() && value( sect, name, res ) && res == val ) + return; -void QtxResourceMgr::setValue( const QString& sect, const QString& name, double val ) -{ - setValue( sect, name, QString::number( val, 'g', 12 ) ); + setResource( sect, name, QString( "%1, %2, %3" ).arg( val.red() ).arg( val.green() ).arg( val.blue() ) ); } -void QtxResourceMgr::setValue( const QString& sect, const QString& name, bool val ) +/*! + \brief Sets the font resource value. + \param sect - Resource section name. + \param name - Name of the resource. + \param val - Resource value. +*/ +void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QFont& val ) { - setValue( sect, name, QString( val ? "true" : "false" ) ); -} + QFont res; + if ( checkExisting() && value( sect, name, res ) && res == val ) + return; -void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QColor& val ) -{ - setValue( sect, name, QString( "%1, %2, %3").arg( val.red() ).arg( val.green() ).arg( val.blue() ) ); -} + QStringList fontDescr; + fontDescr.append( val.family() ); + if ( val.bold() ) + fontDescr.append( "Bold" ); + if ( val.italic() ) + fontDescr.append( "Italic" ); + if ( val.underline() ) + fontDescr.append( "Underline" ); + fontDescr.append( QString( "%1" ).arg( val.pointSize() ) ); -void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QFont& f ) -{ - QStringList val; - val.append( f.family() ); - if( f.bold() ) - val.append( "Bold" ); - if( f.italic() ) - val.append( "Italic" ); - if( f.underline() ) - val.append( "Underline" ); - val.append( QString( "%1" ).arg( f.pointSize() ) ); - - setValue( sect, name, val.join( "," ) ); + setResource( sect, name, fontDescr.join( "," ) ); } +/*! + \brief Sets the string resource value. + \param sect - Resource section name. + \param name - Name of the resource. + \param val - Resource value. +*/ void QtxResourceMgr::setValue( const QString& sect, const QString& name, const QString& val ) { - initialize(); - - if ( !myResources.isEmpty() ) - myResources.first()->setValue( sect, name, val ); -} + QString res; + if ( checkExisting() && value( sect, name, res ) && res == val ) + return; -void QtxResourceMgr::remove( const QString& name ) -{ - remove( currentSection(), name ); + setResource( sect, name, val ); } -void QtxResourceMgr::remove( const QString& sect, const QString& name ) +/*! + \brief Remove the all specified resource section. + \param sect - Resource section name. +*/ +void QtxResourceMgr::remove( const QString& sect ) { initialize(); for ( ResListIterator it( myResources ); it.current(); ++it ) - it.current()->removeValue( sect, name ); + it.current()->removeSection( sect ); } -void QtxResourceMgr::removeSection( const QString& sect ) +/*! + \brief Remove the specified resource. + \param sect - Resource section name. + \param name - Name of the resource. +*/ +void QtxResourceMgr::remove( const QString& sect, const QString& name ) { initialize(); for ( ResListIterator it( myResources ); it.current(); ++it ) - it.current()->removeSection( sect ); + it.current()->removeValue( sect, name ); } +/*! + \brief Returns the current format which operates with resource files. +*/ QString QtxResourceMgr::currentFormat() const { QString fmt; @@ -1017,6 +1149,10 @@ QString QtxResourceMgr::currentFormat() const return fmt; } +/*! + \brief Sets the current format which operates with resource files. + \param fmt - Resource format name. +*/ void QtxResourceMgr::setCurrentFormat( const QString& fmt ) { Format* form = format( fmt ); @@ -1038,6 +1174,10 @@ void QtxResourceMgr::setCurrentFormat( const QString& fmt ) resIt.current()->setFile( Qtx::addSlash( *it ) + globalFileName( appName() ) ); } +/*! + \brief Returns the resource format object by it name. + \param fmt - Resource format name. +*/ QtxResourceMgr::Format* QtxResourceMgr::format( const QString& fmt ) const { Format* form = 0; @@ -1050,22 +1190,38 @@ QtxResourceMgr::Format* QtxResourceMgr::format( const QString& fmt ) const return form; } +/*! + \brief Add the resource format to the manager. Newly added become current. + \param form - Resource format object. +*/ void QtxResourceMgr::installFormat( QtxResourceMgr::Format* form ) { if ( !myFormats.contains( form ) ) myFormats.prepend( form ); } +/*! + \brief Remove the resource format from the manager. + \param form - Resource format object. +*/ void QtxResourceMgr::removeFormat( QtxResourceMgr::Format* form ) { myFormats.remove( form ); } +/*! + \brief Returns the string list of the resource format options names. +*/ QStringList QtxResourceMgr::options() const { return myOptions.keys(); } +/*! + \brief Returns the string value for the specified option. If option doesn't exist + then empty string will be returned. + \param opt - Option name. +*/ QString QtxResourceMgr::option( const QString& opt ) const { QString val; @@ -1074,11 +1230,19 @@ QString QtxResourceMgr::option( const QString& opt ) const return val; } +/*! + \brief Sets the string value for the specified option. + \param opt - Option name. + \param val - Option value. +*/ void QtxResourceMgr::setOption( const QString& opt, const QString& val ) { myOptions.insert( opt, val ); } +/*! + \brief Load the all resources from the resource files. +*/ bool QtxResourceMgr::load() { initialize( false ); @@ -1094,6 +1258,9 @@ bool QtxResourceMgr::load() return res; } +/*! + \brief Save the changed resources in to the user resource file. +*/ bool QtxResourceMgr::save() { initialize( false ); @@ -1108,6 +1275,9 @@ bool QtxResourceMgr::save() return fmt->save( myResources.getFirst() ); } +/*! + \brief Returns the string list of the existing section names.. +*/ QStringList QtxResourceMgr::sections() const { initialize(); @@ -1127,6 +1297,10 @@ QStringList QtxResourceMgr::sections() const return res; } +/*! + \brief Returns the string list of the existing resource names in the specified section. + \param sec - Resource section name. +*/ QStringList QtxResourceMgr::parameters( const QString& sec ) const { initialize(); @@ -1308,10 +1482,27 @@ void QtxResourceMgr::refresh() { QStringList pl = parameters( *it ); for ( QStringList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr ) - setValue( *it, *itr, stringValue( *it, *itr ) ); + setResource( *it, *itr, stringValue( *it, *itr ) ); } } +void QtxResourceMgr::setDirList( const QStringList& dl ) +{ + myDirList = dl; + for ( ResListIterator it( myResources ); it.current(); ++it ) + delete it.current(); + + myResources.clear(); +} + +void QtxResourceMgr::setResource( const QString& sect, const QString& name, const QString& val ) +{ + initialize(); + + if ( !myResources.isEmpty() ) + myResources.first()->setValue( sect, name, val ); +} + QString QtxResourceMgr::userFileName( const QString& appName ) const { QString fileName; diff --git a/src/Qtx/QtxResourceMgr.h b/src/Qtx/QtxResourceMgr.h index d91a58c05..1785a6b36 100644 --- a/src/Qtx/QtxResourceMgr.h +++ b/src/Qtx/QtxResourceMgr.h @@ -35,17 +35,10 @@ public: QString appName() const; QStringList dirList() const; - void clear(); - - QString currentSection() const; - void setCurrentSection( const QString& ); + bool checkExisting() const; + virtual void setCheckExisting( const bool ); - bool value( const QString&, int& ) const; - bool value( const QString&, double& ) const; - bool value( const QString&, bool& ) const; - bool value( const QString&, QColor& ) const; - bool value( const QString&, QFont& ) const; - bool value( const QString&, QString&, const bool = true ) const; + void clear(); bool value( const QString&, const QString&, int& ) const; bool value( const QString&, const QString&, double& ) const; @@ -54,41 +47,25 @@ public: bool value( const QString&, const QString&, QFont& ) const; bool value( const QString&, const QString&, QString&, const bool = true ) const; - int integerValue( const QString&, const int = 0 ) const; - double doubleValue ( const QString&, const double = 0 ) const; - bool booleanValue( const QString&, const bool = false ) const; - QColor colorValue ( const QString&, const QColor& = QColor() ) const; - QFont fontValue ( const QString&, const QFont& = QFont() ) const; - QString stringValue ( const QString&, const char* = 0 ) const; - int integerValue( const QString&, const QString&, const int = 0 ) const; - double doubleValue ( const QString&, const QString&, const double = 0 ) const; + double doubleValue( const QString&, const QString&, const double = 0 ) const; bool booleanValue( const QString&, const QString&, const bool = false ) const; - QColor colorValue ( const QString&, const QString&, const QColor& = QColor() ) const; - QFont fontValue ( const QString&, const QString&, const QFont& = QFont() ) const; - QString stringValue ( const QString&, const QString&, const char* = 0 ) const; + QFont fontValue( const QString&, const QString&, const QFont& = QFont() ) const; + QColor colorValue( const QString&, const QString&, const QColor& = QColor() ) const; + QString stringValue( const QString&, const QString&, const QString& = QString::null ) const; bool hasSection( const QString& ) const; - bool hasValue( const QString& ) const; bool hasValue( const QString&, const QString& ) const; - void setValue( const QString&, const int ); - void setValue( const QString&, const double ); - void setValue( const QString&, const bool ); - void setValue( const QString&, const QColor& ); - void setValue( const QString&, const QFont& ); - void setValue( const QString&, const QString& ); - void setValue( const QString&, const QString&, const int ); void setValue( const QString&, const QString&, const double ); void setValue( const QString&, const QString&, const bool ); - void setValue( const QString&, const QString&, const QColor& ); void setValue( const QString&, const QString&, const QFont& ); + void setValue( const QString&, const QString&, const QColor& ); void setValue( const QString&, const QString&, const QString& ); void remove( const QString& ); void remove( const QString&, const QString& ); - void removeSection( const QString& ); QString currentFormat() const; void setCurrentFormat( const QString& ); @@ -127,7 +104,8 @@ public: void refresh(); protected: - void setDirList( const QStringList& ); + virtual void setDirList( const QStringList& ); + virtual void setResource( const QString&, const QString&, const QString& ); virtual QString userFileName( const QString& ) const; virtual QString globalFileName( const QString& ) const; @@ -153,8 +131,8 @@ private: FormatList myFormats; OptionsMap myOptions; ResList myResources; + bool myCheckExist; TransListMap myTranslator; - QString myCurSection; QPixmap myDefaultPix; }; diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index ac71afdc2..5b7d10d54 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -197,9 +197,14 @@ private: QtxWorkstackChild* child( QWidget* ) const; private: + struct WidgetInfo + { + WidgetInfo() : id( 0 ), vis( false ) {} + int id; bool vis; + }; + typedef QMap BlockMap; typedef QMap ChildMap; - typedef struct { int id; bool vis; } WidgetInfo; typedef QMap WidgetInfoMap; private: -- 2.39.2