Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Functions
picstatus.cpp File Reference
#include <qtable.h>
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qtoolbutton.h>
#include <qstringlist.h>
#include <qtextstream.h>
#include <qtooltip.h>
#include <qcursor.h>
#include <qpainter.h>
#include <cstdio>
#include "picstatus.h"
#include "picstatus.moc"
#include "picsearch.h"
#include "picsearchoptions.h"
#include "scribusdoc.h"
#include "pageitem.h"
#include "filesearch.h"
#include "scribuscore.h"
#include "commonstrings.h"
#include "effectsdialog.h"
#include "extimageprops.h"

Go to the source code of this file.

Functions

QPixmap loadIcon (QString nam)

Function Documentation

QPixmap loadIcon ( QString  nam)

Definition at line 224 of file util.cpp.

{
       static ScPixmapCache<QString> pxCache;
       if (pxCache.contains(nam))
              return *pxCache[nam];

       QString iconFilePath(QString("%1%2").arg(ScPaths::instance().iconDir()).arg(nam));
       QPixmap *pm = new QPixmap();
       
       if (!QFile::exists(iconFilePath))
              qWarning("Unable to load icon %s: File not found", iconFilePath.ascii());
       else
       {
              pm->load(iconFilePath);
              if (pm->isNull())
                     qWarning("Unable to load icon %s: Got null pixmap", iconFilePath.ascii());
       }
       pxCache.insert(nam, pm);
       return *pm;
}