Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Quassel Class Reference

#include </tmp/quassel/src/common/quassel.h>

Inheritance diagram for Quassel:
Collaboration diagram for Quassel:

Classes

struct  BuildInfo

Protected Member Functions

 Quassel ()
virtual bool init ()
virtual void quit ()
void setRunMode (RunMode mode)
void setDataDirPaths (const QStringList &paths)
QStringList findDataDirPaths () const
void disableCrashhandler ()

Private Types

enum  Feature {
  SynchronizedMarkerLine = 0x0001, SaslAuthentication = 0x0002, SaslExternal = 0x0004, HideInactiveNetworks = 0x0008,
  PasswordChange = 0x0010, NumFeatures = 0x0010
}
 A list of features that are optional in core and/or client, but need runtime checking. More...
enum  LogLevel { DebugLevel, InfoLevel, WarningLevel, ErrorLevel }

Private Member Functions

 Q_DECLARE_TR_FUNCTIONS (Quassel) public
 Q_DECLARE_FLAGS (Features, Feature)
virtual ~Quassel ()
void setupEnvironment ()
void registerMetaTypes ()
 Register our custom types with Qt's Meta Object System.

Static Private Member Functions

static Features features ()
 The features the current version of Quassel supports (.
static void setupBuildInfo ()
static const BuildInfobuildInfo ()
static RunMode runMode ()
static QString configDirPath ()
static QStringList dataDirPaths ()
 Returns a list of data directory paths.
static QString findDataFilePath (const QString &filename)
 Searches for a data file in the possible data directories.
static QString translationDirPath ()
static QStringList scriptDirPaths ()
 Returns a list of directories we look for scripts in.
static void loadTranslation (const QLocale &locale)
static void setCliParser (AbstractCliParser *cliParser)
static AbstractCliParsercliParser ()
static QString optionValue (const QString &option)
static bool isOptionSet (const QString &option)
static const QString & coreDumpFileName ()
static LogLevel logLevel ()
static QFile * logFile ()
static bool logToSyslog ()
static void logFatalMessage (const char *msg)
static void handleSignal (int signal)
 Signal handler for graceful shutdown.
static void logBacktrace (const QString &filename)

Static Private Attributes

static bool DEBUG = false
static Quassel_instance = 0
static BuildInfo _buildInfo
static AbstractCliParser_cliParser = 0
static RunMode _runMode
static bool _initialized = false
static bool _handleCrashes = true
static QString _coreDumpFileName
static QString _configDirPath
static QStringList _dataDirPaths
static QString _translationDirPath
static LogLevel _logLevel = InfoLevel
static QFile * _logFile = 0
static bool _logToSyslog = false

Detailed Description

Definition at line 32 of file quassel.h.

Member Enumeration Documentation

enum Feature
private

A list of features that are optional in core and/or client, but need runtime checking.

Some features require an uptodate counterpart, but don't justify a protocol break. This is what we use this enum for. Add such features to it and check at runtime on the other side for their existence.

This list should be cleaned up after every protocol break, as we can assume them to be present then.

Enumerator:
SynchronizedMarkerLine 
SaslAuthentication 
SaslExternal 
HideInactiveNetworks 
PasswordChange 
NumFeatures 

Definition at line 69 of file quassel.h.

enum LogLevel
private
Enumerator:
DebugLevel 
InfoLevel 
WarningLevel 
ErrorLevel 

Definition at line 128 of file quassel.h.

Constructor & Destructor Documentation

~Quassel ( )
privatevirtual

Definition at line 78 of file quassel.cpp.

References _cliParser, and logFile().

Quassel ( )
protected

Definition at line 67 of file quassel.cpp.

References _instance, and handleSignal().

Member Function Documentation

Q_DECLARE_TR_FUNCTIONS ( Quassel  )
inlineprivate

Definition at line 34 of file quassel.h.

Q_DECLARE_FLAGS ( Features  ,
Feature   
)
private
Quassel::Features features ( )
staticprivate

The features the current version of Quassel supports (.

See Also
Feature)
Returns
An ORed list of all enum values in Feature

Definition at line 353 of file quassel.cpp.

References NumFeatures.

Referenced by CoreAuthHandler::handle(), and CoreConnection::internalSessionStateReceived().

QStringList dataDirPaths ( )
staticprivate

Returns a list of data directory paths.

There are several locations for applications to install their data files in. On Unix, a common location is /usr/share; others include $PREFIX/share and additional directories specified in the env variable XDG_DATA_DIRS.

Returns
A list of directory paths to look for data files in

Definition at line 425 of file quassel.cpp.

References _dataDirPaths.

Referenced by findDataFilePath(), scriptDirPaths(), and translationDirPath().

QString findDataFilePath ( const QString &  filename)
staticprivate

Searches for a data file in the possible data directories.

Data files can reside in $DATA_DIR/apps/quassel, where $DATA_DIR is one of the directories returned by

See Also
dataDirPaths(). With KDE integration enabled, files are searched (only) in KDE's appdata dirs.
Returns
The full path to the data file if found; a null QString else

Definition at line 492 of file quassel.cpp.

References dataDirPaths().

Referenced by AppearanceSettingsPage::chooseStyleSheet(), UiStyle::loadStyleSheet(), and PresetNetworks::names().

QString translationDirPath ( )
staticprivate
QStringList scriptDirPaths ( )
staticprivate

Returns a list of directories we look for scripts in.

We look for a subdirectory named "scripts" in the configdir and in all datadir paths.

Returns
A list of directory paths containing executable scripts for /exec

Definition at line 504 of file quassel.cpp.

References configDirPath(), and dataDirPaths().

Referenced by ExecWrapper::start().

void loadTranslation ( const QLocale &  locale)
staticprivate

Definition at line 531 of file quassel.cpp.

References translationDirPath().

Referenced by Core::Core(), AppearanceSettingsPage::load(), and QtUi::QtUi().

void setCliParser ( AbstractCliParser cliParser)
inlinestaticprivate

Definition at line 184 of file quassel.h.

References _cliParser.

Referenced by main().

AbstractCliParser * cliParser ( )
inlinestaticprivate

Definition at line 185 of file quassel.h.

References _cliParser.

Referenced by init(), isOptionSet(), and optionValue().

QString optionValue ( const QString &  option)
inlinestaticprivate
const QString & coreDumpFileName ( )
staticprivate
Quassel::LogLevel logLevel ( )
inlinestaticprivate

Definition at line 189 of file quassel.h.

References _logLevel.

Referenced by Logger::log().

QFile * logFile ( )
inlinestaticprivate

Definition at line 190 of file quassel.h.

References _logFile.

Referenced by Logger::log(), and ~Quassel().

bool logToSyslog ( )
inlinestaticprivate

Definition at line 191 of file quassel.h.

References _logToSyslog.

Referenced by Logger::log().

void logFatalMessage ( const char *  msg)
staticprivate

Definition at line 337 of file quassel.cpp.

References coreDumpFileName().

Referenced by Logger::logMessage(), and Client::logMessage().

void quit ( )
protectedvirtual

Reimplemented in QtUiApplication.

Definition at line 164 of file quassel.cpp.

Referenced by handleSignal().

void setRunMode ( RunMode  mode)
inlineprotected
void setDataDirPaths ( const QStringList &  paths)
inlineprotected

Definition at line 181 of file quassel.h.

References _dataDirPaths.

QStringList findDataDirPaths ( ) const
protected

Definition at line 431 of file quassel.cpp.

void disableCrashhandler ( )
inlineprotected
void setupEnvironment ( )
private

Definition at line 218 of file quassel.cpp.

Referenced by init().

void registerMetaTypes ( )
private

Register our custom types with Qt's Meta Object System.

This makes them available for QVariant and in signals/slots, among other things.

Definition at line 174 of file quassel.cpp.

Referenced by init().

void handleSignal ( int  signal)
staticprivate

Signal handler for graceful shutdown.

Definition at line 312 of file quassel.cpp.

References _instance, coreDumpFileName(), logBacktrace(), and quit().

Referenced by init(), and Quassel().

void logBacktrace ( const QString &  filename)
staticprivate

Definition at line 33 of file logbacktrace_unix.cpp.

Referenced by handleSignal().

Member Data Documentation

bool DEBUG = false
staticprivate

Definition at line 126 of file quassel.h.

Referenced by init().

Quassel * _instance = 0
staticprivate

Definition at line 158 of file quassel.h.

Referenced by handleSignal(), and Quassel().

Quassel::BuildInfo _buildInfo
staticprivate

Definition at line 159 of file quassel.h.

Referenced by buildInfo(), coreDumpFileName(), and setupBuildInfo().

AbstractCliParser * _cliParser = 0
staticprivate

Definition at line 160 of file quassel.h.

Referenced by cliParser(), setCliParser(), and ~Quassel().

Quassel::RunMode _runMode
staticprivate

Definition at line 161 of file quassel.h.

Referenced by runMode(), and setRunMode().

bool _initialized = false
staticprivate

Definition at line 162 of file quassel.h.

Referenced by init().

bool _handleCrashes = true
staticprivate

Definition at line 163 of file quassel.h.

Referenced by disableCrashhandler(), and init().

QString _coreDumpFileName
staticprivate

Definition at line 165 of file quassel.h.

Referenced by coreDumpFileName().

QString _configDirPath
staticprivate

Definition at line 166 of file quassel.h.

Referenced by configDirPath().

QStringList _dataDirPaths
staticprivate

Definition at line 167 of file quassel.h.

Referenced by dataDirPaths(), and setDataDirPaths().

QString _translationDirPath
staticprivate

Definition at line 168 of file quassel.h.

Referenced by translationDirPath().

Quassel::LogLevel _logLevel = InfoLevel
staticprivate

Definition at line 170 of file quassel.h.

Referenced by init(), and logLevel().

QFile * _logFile = 0
staticprivate

Definition at line 171 of file quassel.h.

Referenced by init(), and logFile().

bool _logToSyslog = false
staticprivate

Definition at line 172 of file quassel.h.

Referenced by init(), and logToSyslog().


The documentation for this class was generated from the following files: