function userFileName(). Any resource looking firstly in the user home resources then
resource directories used in the specified order. All setted resources always stored into
the resource file at the user home. Only user home resource file is saved.
+ If you want to ignore of loading of Local User Preferences, you needs setup setIngoreUserValues()
+ as true.
*/
QtxResourceMgr::QtxResourceMgr( const QString& appName, const QString& resVarTemplate )
: myAppName( appName ),
myCheckExist( true ),
- myIsPixmapCached( true )
+ myIsPixmapCached( true ),
+ myIsIgnoreUserValues( false )
{
QString envVar = !resVarTemplate.isEmpty() ? resVarTemplate : QString( "%1Resources" );
if ( envVar.contains( "%1" ) )
it.current()->clear();
}
+void QtxResourceMgr::setIgnoreUserValues( const bool val )
+{
+ myIsIgnoreUserValues = val;
+}
+
+bool QtxResourceMgr::ignoreUserValues() const
+{
+ return myIsIgnoreUserValues;
+}
+
/*!
\brief Get the resource value as integer. Returns 'true' if it successfull otherwise
returns 'false'.
initialize();
bool ok = false;
- for ( ResListIterator it( myResources ); it.current() && !ok; ++it )
+
+ ResListIterator it( myResources );
+ if ( ignoreUserValues() )
+ ++it;
+
+ for ( ; it.current() && !ok; ++it )
{
ok = it.current()->hasValue( sect, name );
if ( ok )
void clear();
+ void setIgnoreUserValues( const bool = true );
+ bool ignoreUserValues() const;
+
bool value( const QString&, const QString&, int& ) const;
bool value( const QString&, const QString&, double& ) const;
bool value( const QString&, const QString&, bool& ) const;
TransListMap myTranslator;
QPixmap myDefaultPix;
bool myIsPixmapCached;
+
+ bool myIsIgnoreUserValues;
};
/*!