BibleTime
Namespaces | Functions
util::directory Namespace Reference

Namespaces

namespace  anonymous_namespace{directory.cpp}
 

Functions

::qint64 getDirSizeRecursive (QString const &dir)
 
const QDir & getDisplayTemplatesDir ()
 
QString getHandbook ()
 
QString getHowto ()
 
QDir const & getIconDir ()
 
QString const & getLicensePath ()
 
const QDir & getLocaleDir ()
 
const QDir & getPicsDir ()
 
const QDir & getUserBaseDir ()
 
const QDir & getUserCacheDir ()
 
const QDir & getUserDisplayTemplatesDir ()
 
const QDir & getUserHomeDir ()
 
const QDir & getUserHomeSwordDir ()
 
const QDir & getUserIndexDir ()
 
bool initDirectoryCache ()
 Initializes the directory cache and returns whether it was successful.
 

Detailed Description

Tools for working with directories.

Function Documentation

◆ getDirSizeRecursive()

qint64 util::directory::getDirSizeRecursive ( QString const &  dir)
Returns
the size of the directory including the size of all it's files and it's subdirs.

Returns the size of the directory including the size of all its files and its subdirs.

Todo:
Check if it's suitable for huge dir trees, as it holds a QDir object for each of it at the same time in the deepest recursion. For really deep dir tree this may lead to a stack overflow.
Returns
The size of the dir in bytes

Definition at line 208 of file directory.cpp.

References BT_ASSERT, and getDirSizeRecursive().

Referenced by getDirSizeRecursive().

◆ getDisplayTemplatesDir()

const QDir & util::directory::getDisplayTemplatesDir ( )

Return the path to the default display template files.

Definition at line 308 of file directory.cpp.

◆ getHandbook()

QString util::directory::getHandbook ( )
Returns
an absolute path to a handbook or QString() if not found.

Definition at line 304 of file directory.cpp.

Referenced by BibleTime::openOnlineHelp_Handbook().

◆ getHowto()

QString util::directory::getHowto ( )
Returns
an absolute path to a howto or QString() if not found.

Definition at line 306 of file directory.cpp.

Referenced by BibleTime::openOnlineHelp_Howto().

◆ getIconDir()

const QDir & util::directory::getIconDir ( )

Return the path to the icons.

Definition at line 243 of file directory.cpp.

◆ getLicensePath()

QString const & util::directory::getLicensePath ( )

Return the path to the license.

Definition at line 250 of file directory.cpp.

Referenced by BtAboutDialog::BtAboutDialog().

◆ getLocaleDir()

const QDir & util::directory::getLocaleDir ( )

Return the path to the translation files.

Definition at line 261 of file directory.cpp.

◆ getPicsDir()

const QDir & util::directory::getPicsDir ( )

Return the path to the pictures.

Definition at line 257 of file directory.cpp.

◆ getUserBaseDir()

const QDir & util::directory::getUserBaseDir ( )

Return the path to the user's settings directory.

Definition at line 312 of file directory.cpp.

Referenced by BtBookmarksModelPrivate::defaultBookmarksFile(), and BtConfig::initBtConfig().

◆ getUserCacheDir()

const QDir & util::directory::getUserCacheDir ( )

Return the path to the user's cache directory.

Definition at line 324 of file directory.cpp.

◆ getUserDisplayTemplatesDir()

const QDir & util::directory::getUserDisplayTemplatesDir ( )

Return the path to the user's custom display templates directory.

Definition at line 332 of file directory.cpp.

◆ getUserHomeDir()

const QDir & util::directory::getUserHomeDir ( )

Return the path to the user's home directory. APPDATA% on Windows $HOME on linux

Definition at line 316 of file directory.cpp.

Referenced by main().

◆ getUserHomeSwordDir()

const QDir & util::directory::getUserHomeSwordDir ( )

Return the path to the user's home .sword (or Sword) directory. APPDATA%\Sword on Windows $HOME.sword on linux

Definition at line 320 of file directory.cpp.

Referenced by BtInstallBackend::configPath(), BibleTimeApp::initBackends(), and CSwordBackend::swordDirList().

◆ getUserIndexDir()

const QDir & util::directory::getUserIndexDir ( )

Return the path to the user's indices directory.

Definition at line 328 of file directory.cpp.

Referenced by CSwordModuleInfo::getGlobalBaseIndexLocation().

◆ initDirectoryCache()

bool util::directory::initDirectoryCache ( )

Initializes the directory cache and returns whether it was successful.

Note
When this function returns unsuccessfully, the program should exit.
Todo:
Check and comment whether this is needed:

Definition at line 59 of file directory.cpp.