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.

00035 {
00036     switch (type)
00037     {
00038         case TQT_DBusError::InvalidError:
00039             Q_ASSERT(false);
00040             return TQString();
00041 
00042         case TQT_DBusError::Failed:
00043             return TQString::fromUtf8(DBUS_ERROR_FAILED);
00044         case TQT_DBusError:: NoMemory:
00045             return TQString::fromUtf8(DBUS_ERROR_NO_MEMORY);
00046         case TQT_DBusError:: ServiceUnknown:
00047             return TQString::fromUtf8(DBUS_ERROR_SERVICE_UNKNOWN);
00048         case TQT_DBusError:: NameHasNoOwner:
00049             return TQString::fromUtf8(DBUS_ERROR_NAME_HAS_NO_OWNER);
00050         case TQT_DBusError:: NoReply:
00051             return TQString::fromUtf8(DBUS_ERROR_NO_REPLY);
00052         case TQT_DBusError:: IOError:
00053             return TQString::fromUtf8(DBUS_ERROR_IO_ERROR);
00054         case TQT_DBusError:: BadAddress:
00055             return TQString::fromUtf8(DBUS_ERROR_BAD_ADDRESS);
00056         case TQT_DBusError:: NotSupported:
00057             return TQString::fromUtf8(DBUS_ERROR_NOT_SUPPORTED);
00058         case TQT_DBusError:: LimitsExceeded:
00059             return TQString::fromUtf8(DBUS_ERROR_LIMITS_EXCEEDED);
00060         case TQT_DBusError:: AccessDenied:
00061             return TQString::fromUtf8(DBUS_ERROR_ACCESS_DENIED);
00062         case TQT_DBusError:: AuthFailed:
00063             return TQString::fromUtf8(DBUS_ERROR_AUTH_FAILED);
00064         case TQT_DBusError:: NoServer:
00065             return TQString::fromUtf8(DBUS_ERROR_NO_SERVER);
00066         case TQT_DBusError:: Timeout:
00067             return TQString::fromUtf8(DBUS_ERROR_TIMEOUT);
00068         case TQT_DBusError:: NoNetwork:
00069             return TQString::fromUtf8(DBUS_ERROR_NO_NETWORK);
00070         case TQT_DBusError:: Disconnected:
00071             return TQString::fromUtf8(DBUS_ERROR_DISCONNECTED);
00072         case TQT_DBusError:: InvalidArgs:
00073             return TQString::fromUtf8(DBUS_ERROR_INVALID_ARGS);
00074         case TQT_DBusError:: FileNotFound:
00075             return TQString::fromUtf8(DBUS_ERROR_FILE_NOT_FOUND);
00076         case TQT_DBusError:: FileExists:
00077             return TQString::fromUtf8(DBUS_ERROR_FILE_EXISTS);
00078         case TQT_DBusError:: UnknownMethod:
00079             return TQString::fromUtf8(DBUS_ERROR_UNKNOWN_METHOD);
00080         case TQT_DBusError:: TimedOut:
00081             return TQString::fromUtf8(DBUS_ERROR_TIMED_OUT);
00082         case TQT_DBusError:: InvalidSignature:
00083             return TQString::fromUtf8(DBUS_ERROR_INVALID_SIGNATURE);
00084 
00085         case TQT_DBusError::UserDefined:
00086             Q_ASSERT(false);
00087             return TQString();
00088     }
00089 
00090     Q_ASSERT(false);
00091     return TQString();
00092 }

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.

00095 {
00096     for (int i = TQT_DBusError::InvalidError + 1; i < TQT_DBusError::UserDefined; ++i)
00097     {
00098         TQT_DBusError::ErrorType type = static_cast<TQT_DBusError::ErrorType>(i);
00099         errorTypesByName[qDBusErrorNameForType(type)] = type;
00100     }
00101 }

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.

00104 {
00105     if (name.isEmpty()) return TQT_DBusError::InvalidError;
00106 
00107     if (errorTypesByName.isEmpty())
00108         qDBusErrorSetupNameMapping();
00109 
00110     ErrorNameMap::const_iterator it = errorTypesByName.find(name);
00111     if (it != errorTypesByName.end()) return it.data();
00112 
00113     return TQT_DBusError::UserDefined;
00114 }

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.

Generated on Fri Apr 26 16:30:20 2019 for DBus-1-TQt by  doxygen 1.6.3