DBus-1-TQt  1.0
tqdbuserror.cpp File Reference
#include "tqdbuserror.h"
#include <dbus/dbus.h>
#include <tqmap.h>
+ Include dependency graph for tqdbuserror.cpp:

Go to the source code of this file.

Typedefs

typedef TQMap< TQString,
TQT_DBusError::ErrorType
ErrorNameMap

Functions

static TQString qDBusErrorNameForType (TQT_DBusError::ErrorType type)
static void qDBusErrorSetupNameMapping ()
static TQT_DBusError::ErrorType qDBusErrorTypeForName (const TQString &name)

Variables

static ErrorNameMap errorTypesByName

Typedef Documentation

typedef TQMap<TQString, TQT_DBusError::ErrorType> ErrorNameMap

Definition at line 31 of file tqdbuserror.cpp.


Function Documentation

static TQString qDBusErrorNameForType ( TQT_DBusError::ErrorType  type) [static]

Definition at line 34 of file tqdbuserror.cpp.

References TQT_DBusError::AccessDenied, TQT_DBusError::AuthFailed, TQT_DBusError::BadAddress, TQT_DBusError::Disconnected, TQT_DBusError::Failed, TQT_DBusError::FileExists, TQT_DBusError::FileNotFound, TQT_DBusError::InvalidArgs, TQT_DBusError::InvalidError, TQT_DBusError::InvalidSignature, TQT_DBusError::IOError, TQT_DBusError::LimitsExceeded, TQT_DBusError::NameHasNoOwner, TQT_DBusError::NoMemory, TQT_DBusError::NoNetwork, TQT_DBusError::NoReply, TQT_DBusError::NoServer, TQT_DBusError::NotSupported, TQT_DBusError::ServiceUnknown, TQT_DBusError::TimedOut, TQT_DBusError::Timeout, TQT_DBusError::UnknownMethod, and TQT_DBusError::UserDefined.

{
    switch (type)
    {
        case TQT_DBusError::InvalidError:
            Q_ASSERT(false);
            return TQString();

        case TQT_DBusError::Failed:
            return TQString::fromUtf8(DBUS_ERROR_FAILED);
        case TQT_DBusError:: NoMemory:
            return TQString::fromUtf8(DBUS_ERROR_NO_MEMORY);
        case TQT_DBusError:: ServiceUnknown:
            return TQString::fromUtf8(DBUS_ERROR_SERVICE_UNKNOWN);
        case TQT_DBusError:: NameHasNoOwner:
            return TQString::fromUtf8(DBUS_ERROR_NAME_HAS_NO_OWNER);
        case TQT_DBusError:: NoReply:
            return TQString::fromUtf8(DBUS_ERROR_NO_REPLY);
        case TQT_DBusError:: IOError:
            return TQString::fromUtf8(DBUS_ERROR_IO_ERROR);
        case TQT_DBusError:: BadAddress:
            return TQString::fromUtf8(DBUS_ERROR_BAD_ADDRESS);
        case TQT_DBusError:: NotSupported:
            return TQString::fromUtf8(DBUS_ERROR_NOT_SUPPORTED);
        case TQT_DBusError:: LimitsExceeded:
            return TQString::fromUtf8(DBUS_ERROR_LIMITS_EXCEEDED);
        case TQT_DBusError:: AccessDenied:
            return TQString::fromUtf8(DBUS_ERROR_ACCESS_DENIED);
        case TQT_DBusError:: AuthFailed:
            return TQString::fromUtf8(DBUS_ERROR_AUTH_FAILED);
        case TQT_DBusError:: NoServer:
            return TQString::fromUtf8(DBUS_ERROR_NO_SERVER);
        case TQT_DBusError:: Timeout:
            return TQString::fromUtf8(DBUS_ERROR_TIMEOUT);
        case TQT_DBusError:: NoNetwork:
            return TQString::fromUtf8(DBUS_ERROR_NO_NETWORK);
        case TQT_DBusError:: Disconnected:
            return TQString::fromUtf8(DBUS_ERROR_DISCONNECTED);
        case TQT_DBusError:: InvalidArgs:
            return TQString::fromUtf8(DBUS_ERROR_INVALID_ARGS);
        case TQT_DBusError:: FileNotFound:
            return TQString::fromUtf8(DBUS_ERROR_FILE_NOT_FOUND);
        case TQT_DBusError:: FileExists:
            return TQString::fromUtf8(DBUS_ERROR_FILE_EXISTS);
        case TQT_DBusError:: UnknownMethod:
            return TQString::fromUtf8(DBUS_ERROR_UNKNOWN_METHOD);
        case TQT_DBusError:: TimedOut:
            return TQString::fromUtf8(DBUS_ERROR_TIMED_OUT);
        case TQT_DBusError:: InvalidSignature:
            return TQString::fromUtf8(DBUS_ERROR_INVALID_SIGNATURE);

        case TQT_DBusError::UserDefined:
            Q_ASSERT(false);
            return TQString();
    }

    Q_ASSERT(false);
    return TQString();
}

+ Here is the caller graph for this function:

static void qDBusErrorSetupNameMapping ( ) [static]

Definition at line 94 of file tqdbuserror.cpp.

References errorTypesByName, TQT_DBusError::InvalidError, qDBusErrorNameForType(), TQT_DBusData::type(), and TQT_DBusError::UserDefined.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static TQT_DBusError::ErrorType qDBusErrorTypeForName ( const TQString &  name) [static]

Definition at line 103 of file tqdbuserror.cpp.

References errorTypesByName, TQT_DBusError::InvalidError, qDBusErrorSetupNameMapping(), and TQT_DBusError::UserDefined.

{
    if (name.isEmpty()) return TQT_DBusError::InvalidError;

    if (errorTypesByName.isEmpty())
        qDBusErrorSetupNameMapping();

    ErrorNameMap::const_iterator it = errorTypesByName.find(name);
    if (it != errorTypesByName.end()) return it.data();

    return TQT_DBusError::UserDefined;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


Variable Documentation

Definition at line 32 of file tqdbuserror.cpp.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines