From 80055aea8702e8e3de20e2c519296f6e4dbb6646 Mon Sep 17 00:00:00 2001 From: stv Date: Mon, 27 Jun 2005 11:22:33 +0000 Subject: [PATCH] Default pixmap for non existing pixmap files. --- src/Qtx/QtxResourceMgr.cxx | 56 ++++++++++++++++++-------------------- src/Qtx/QtxResourceMgr.h | 9 +++++- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index 7b791d5bc..3257154fc 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -13,32 +13,9 @@ #include -/* XPM */ -static const char* pixmap_not_found_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #A80000", -" ", -" ", -" . . ", -" .+. .+. ", -" .+++. .+++. ", -" .+++.+++. ", -" .+++++. ", -" .+++. ", -" .+++++. ", -" .+++.+++. ", -" .+++. .+++. ", -" .+. .+. ", -" . . ", -" ", -" ", -" "}; - /*! - Class: QtxResourceMgr::Resources - Level: Internal + Class: QtxResourceMgr::Resources + Level: Internal */ QtxResourceMgr::Resources::Resources( const QString& fileName ) @@ -431,7 +408,7 @@ bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMaploadPixmap( resSection(), prefix, name ); - if ( pix.isNull() && useDefault ) - return defaultPixmap; + if ( pix.isNull() ) + pix = defPix; return pix; } diff --git a/src/Qtx/QtxResourceMgr.h b/src/Qtx/QtxResourceMgr.h index 4c657e73c..6b0262bc8 100644 --- a/src/Qtx/QtxResourceMgr.h +++ b/src/Qtx/QtxResourceMgr.h @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -93,10 +94,15 @@ public: QString option( const QString& ) const; void setOption( const QString&, const QString& ); + QPixmap defaultPixmap() const; + virtual void setDefaultPixmap( const QPixmap& ); + QString resSection() const; QString langSection() const; - QPixmap loadPixmap( const QString&, const QString&, const bool = true ) const; + QPixmap loadPixmap( const QString&, const QString& ) const; + QPixmap loadPixmap( const QString&, const QString&, const bool ) const; + QPixmap loadPixmap( const QString&, const QString&, const QPixmap& ) const; void loadLanguage( const QString& = QString::null, const QString& = QString::null ); void raiseTranslators( const QString& ); @@ -142,6 +148,7 @@ private: ResList myResources; TransListMap myTranslator; QString myCurSection; + QPixmap myDefaultPix; }; class QTX_EXPORT QtxResourceMgr::Format -- 2.39.2