Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Classes | Functions
helpbrowser.cpp File Reference
#include "helpbrowser.h"
#include "helpbrowser.moc"
#include <qvariant.h>
#include <qstring.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qheader.h>
#include <qtextbrowser.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qfileinfo.h>
#include <qfiledialog.h>
#include <qtextcodec.h>
#include <qdom.h>
#include <qdir.h>
#include <qsplitter.h>
#include <qmime.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qmessagebox.h>
#include <qaccel.h>
#include <qinputdialog.h>
#include <qmenubar.h>
#include <qpixmap.h>
#include <qprocess.h>
#include <qpopupmenu.h>
#include <qprinter.h>
#include <qpainter.h>
#include <qpaintdevicemetrics.h>
#include <qsimplerichtext.h>
#include <qxml.h>
#include <qcursor.h>
#include "scpaths.h"
#include "util.h"
#include "scconfig.h"
#include "prefsmanager.h"
#include "prefsfile.h"

Go to the source code of this file.

Classes

class  BookmarkParser
 XML parsef for documantation bookmarks. More...
class  HistoryParser
 XML parsef for documantation history. More...

Functions

QPixmap loadIcon (QString nam)
QString bookmarkFile ()
 Returns the name of the cfg file for bookmarks.
QString historyFile ()
 Returns the name of the cfg file for persistent history.

Function Documentation

QString bookmarkFile ( )

Returns the name of the cfg file for bookmarks.

A helper function.

Author:
Petr Vanek petr@.nosp@m.yarp.nosp@m.en.cz

Definition at line 86 of file helpbrowser.cpp.

{
       QString appDataDir(ScPaths::getApplicationDataDir());
       QString fname(appDataDir + "doc/bookmarks.xml");
       if (!QFile::exists(fname))
       {
              QDir d(QDir::convertSeparators(appDataDir));
              d.mkdir("doc");
       }
       return fname;
}
QString historyFile ( )

Returns the name of the cfg file for persistent history.

A helper function.

Author:
Petr Vanek petr@.nosp@m.yarp.nosp@m.en.cz

Definition at line 103 of file helpbrowser.cpp.

{
       QString appDataDir(ScPaths::getApplicationDataDir());
       QString fname(appDataDir + "doc/history.xml");
       if (!QFile::exists(fname))
       {
              QDir d(QDir::convertSeparators(appDataDir));
              d.mkdir("doc");
       }
       return fname;
}
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;
}