- Change a way the default pixmap for resource manager is set/get.
</message>
<message>
<source>PREF_CURRENT_LOCALE</source>
- <translation>Use C locale</translation>
+ <translation>Use "C" locale</translation>
</message>
<message>
<source>PREF_GROUP_LOOK_AND_FEEL</source>
" ",
" "};
-QPixmap* QtxResourceMgr::myDefaultPix = NULL;
-
/*!
\class QtxResourceMgr::Resources
\internal
QtxResourceMgr::QtxResourceMgr( const QString& appName, const QString& resVarTemplate )
: myAppName( appName ),
myCheckExist( true ),
+ myDefaultPix( 0 ),
myIsPixmapCached( true ),
myHasUserValues( true ),
myWorkingMode( AllowUserValues )
qDeleteAll( myResources );
qDeleteAll( myFormats );
+
+ delete myDefaultPix;
}
/*!
\return default pixmap
\sa setDefaultPixmap(), loadPixmap()
*/
-QPixmap QtxResourceMgr::defaultPixmap()
+QPixmap QtxResourceMgr::defaultPixmap() const
{
- QPixmap res;
- if(!myDefaultPix)
- myDefaultPix = new QPixmap( pixmap_not_found_xpm );
-
- if ( myDefaultPix && !myDefaultPix->isNull() )
- res = *myDefaultPix;
- return res;
+ static QPixmap* defpx = 0;
+ if ( !defpx )
+ defpx = new QPixmap( pixmap_not_found_xpm );
+
+ return myDefaultPix ? *myDefaultPix : *defpx;
}
/*!
if ( pix.isNull() )
myDefaultPix = 0;
else
- myDefaultPix = new QPixmap( pix );
+ myDefaultPix = new QPixmap( pix );
}
/*!
QString option( const QString& ) const;
void setOption( const QString&, const QString& );
- static QPixmap defaultPixmap();
- static void setDefaultPixmap( const QPixmap& );
+ QPixmap defaultPixmap() const;
+ virtual void setDefaultPixmap( const QPixmap& );
QString resSection() const;
QString langSection() const;
ResList myResources; //!< resources list
bool myCheckExist; //!< "check existance" flag
TransListMap myTranslator; //!< map of loaded translators
- static QPixmap* myDefaultPix; //!< default icon
+ QPixmap* myDefaultPix; //!< default icon
bool myIsPixmapCached; //!< "cached pixmaps" flag
bool myHasUserValues; //!< \c true if user preferences has been read