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::ErrorTypeErrorNameMap
 

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

◆ ErrorNameMap

typedef TQMap<TQString, TQT_DBusError::ErrorType> ErrorNameMap

Definition at line 31 of file tqdbuserror.cpp.

Function Documentation

◆ qDBusErrorNameForType()

static TQString qDBusErrorNameForType ( TQT_DBusError::ErrorType  type)
static

Definition at line 34 of file tqdbuserror.cpp.

35 {
36  switch (type)
37  {
39  Q_ASSERT(false);
40  return TQString();
41 
43  return TQString::fromUtf8(DBUS_ERROR_FAILED);
45  return TQString::fromUtf8(DBUS_ERROR_NO_MEMORY);
47  return TQString::fromUtf8(DBUS_ERROR_SERVICE_UNKNOWN);
49  return TQString::fromUtf8(DBUS_ERROR_NAME_HAS_NO_OWNER);
51  return TQString::fromUtf8(DBUS_ERROR_NO_REPLY);
53  return TQString::fromUtf8(DBUS_ERROR_IO_ERROR);
55  return TQString::fromUtf8(DBUS_ERROR_BAD_ADDRESS);
57  return TQString::fromUtf8(DBUS_ERROR_NOT_SUPPORTED);
59  return TQString::fromUtf8(DBUS_ERROR_LIMITS_EXCEEDED);
61  return TQString::fromUtf8(DBUS_ERROR_ACCESS_DENIED);
63  return TQString::fromUtf8(DBUS_ERROR_AUTH_FAILED);
65  return TQString::fromUtf8(DBUS_ERROR_NO_SERVER);
67  return TQString::fromUtf8(DBUS_ERROR_TIMEOUT);
69  return TQString::fromUtf8(DBUS_ERROR_NO_NETWORK);
71  return TQString::fromUtf8(DBUS_ERROR_DISCONNECTED);
73  return TQString::fromUtf8(DBUS_ERROR_INVALID_ARGS);
75  return TQString::fromUtf8(DBUS_ERROR_FILE_NOT_FOUND);
77  return TQString::fromUtf8(DBUS_ERROR_FILE_EXISTS);
79  return TQString::fromUtf8(DBUS_ERROR_UNKNOWN_METHOD);
81  return TQString::fromUtf8(DBUS_ERROR_TIMED_OUT);
83  return TQString::fromUtf8(DBUS_ERROR_INVALID_SIGNATURE);
84 
86  Q_ASSERT(false);
87  return TQString();
88  }
89 
90  Q_ASSERT(false);
91  return TQString();
92 }

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_DBusData::type(), TQT_DBusError::UnknownMethod, and TQT_DBusError::UserDefined.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDBusErrorSetupNameMapping()

static void qDBusErrorSetupNameMapping ( )
static

Definition at line 94 of file tqdbuserror.cpp.

95 {
97  {
100  }
101 }

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:

◆ qDBusErrorTypeForName()

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

Definition at line 103 of file tqdbuserror.cpp.

104 {
105  if (name.isEmpty()) return TQT_DBusError::InvalidError;
106 
107  if (errorTypesByName.isEmpty())
109 
110  ErrorNameMap::const_iterator it = errorTypesByName.find(name);
111  if (it != errorTypesByName.end()) return it.data();
112 
114 }

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ errorTypesByName

ErrorNameMap errorTypesByName
static

Definition at line 32 of file tqdbuserror.cpp.

TQT_DBusError::UnknownMethod
@ UnknownMethod
A method call addresses and unknown method.
Definition: tqdbuserror.h:218
TQT_DBusError::AuthFailed
@ AuthFailed
An authentification mechanism failed.
Definition: tqdbuserror.h:159
TQT_DBusError::FileExists
@ FileExists
Target file exists but operation does not allow overwriting.
Definition: tqdbuserror.h:211
TQT_DBusError::ErrorType
ErrorType
Enum of standard D-Bus error types.
Definition: tqdbuserror.h:59
TQT_DBusError::LimitsExceeded
@ LimitsExceeded
Use of a limited resource reached its limit.
Definition: tqdbuserror.h:141
qDBusErrorSetupNameMapping
static void qDBusErrorSetupNameMapping()
Definition: tqdbuserror.cpp:94
TQT_DBusError::InvalidSignature
@ InvalidSignature
An type signature is not valid.
Definition: tqdbuserror.h:241
TQT_DBusError::NoNetwork
@ NoNetwork
The network intended as a transport channel is not available.
Definition: tqdbuserror.h:179
TQT_DBusError::ServiceUnknown
@ ServiceUnknown
An addressed service is neither connected nor can it be activated.
Definition: tqdbuserror.h:88
TQT_DBusError::NameHasNoOwner
@ NameHasNoOwner
A non-unique name used in a message is not known.
Definition: tqdbuserror.h:97
TQT_DBusError::NotSupported
@ NotSupported
An otherwise valid operation request could not be handled.
Definition: tqdbuserror.h:134
errorTypesByName
static ErrorNameMap errorTypesByName
Definition: tqdbuserror.cpp:32
TQT_DBusError::Timeout
@ Timeout
An timeout occured during an operation.
Definition: tqdbuserror.h:174
TQT_DBusError::NoReply
@ NoReply
An call failed to send a reply but one was expected.
Definition: tqdbuserror.h:104
TQT_DBusError::BadAddress
@ BadAddress
Caused by trying to connect to a malformed address.
Definition: tqdbuserror.h:124
TQT_DBusError::AccessDenied
@ AccessDenied
Caused by security restrictions denying an operation.
Definition: tqdbuserror.h:152
TQT_DBusError::UserDefined
@ UserDefined
Generic type for all errors not matching on of the other predefined.
Definition: tqdbuserror.h:248
TQT_DBusError::IOError
@ IOError
An IO error occured during an operation.
Definition: tqdbuserror.h:114
TQT_DBusError::FileNotFound
@ FileNotFound
A file necessary for an operation is not avaiable.
Definition: tqdbuserror.h:204
qDBusErrorNameForType
static TQString qDBusErrorNameForType(TQT_DBusError::ErrorType type)
Definition: tqdbuserror.cpp:34
TQT_DBusError::NoMemory
@ NoMemory
An operation could not allocate enough memory.
Definition: tqdbuserror.h:83
TQT_DBusError::Disconnected
@ Disconnected
Caused by trying to use an unconnected D-Bus connection.
Definition: tqdbuserror.h:186
TQT_DBusError::Failed
@ Failed
Generic failure cause.
Definition: tqdbuserror.h:76
TQT_DBusError::InvalidError
@ InvalidError
TQT_DBusError specific value, to represent invalid error objects.
Definition: tqdbuserror.h:66
TQT_DBusError::NoServer
@ NoServer
Connection to a D-Bus server failed.
Definition: tqdbuserror.h:164
TQT_DBusError::TimedOut
@ TimedOut
An operation timed out.
Definition: tqdbuserror.h:226
TQT_DBusError::InvalidArgs
@ InvalidArgs
Caused by invalid arguments passed to a method call.
Definition: tqdbuserror.h:197