Qt 4.8
Functions
qdbusabstractinterface.cpp File Reference
#include "qdbusabstractinterface.h"
#include "qdbusabstractinterface_p.h"
#include <qthread.h>
#include "qdbusargument.h"
#include "qdbuspendingcall.h"
#include "qdbusmessage_p.h"
#include "qdbusmetaobject_p.h"
#include "qdbusmetatype_p.h"
#include "qdbusutil_p.h"
#include <qdebug.h>
#include "moc_qdbusabstractinterface.cpp"

Go to the source code of this file.

Functions

static QDBusError checkIfValid (const QString &service, const QString &path, const QString &interface, bool isDynamic, bool isPeer)
 

Function Documentation

◆ checkIfValid()

static QDBusError checkIfValid ( const QString service,
const QString path,
const QString interface,
bool  isDynamic,
bool  isPeer 
)
static

Definition at line 60 of file qdbusabstractinterface.cpp.

62 {
63  // We should be throwing exceptions here... oh well
65 
66  // dynamic interfaces (QDBusInterface) can have empty interfaces, but not service and object paths
67  // non-dynamic is the opposite: service and object paths can be empty, but not the interface
68  if (!isDynamic) {
69  // use assertion here because this should never happen, at all
70  Q_ASSERT_X(!interface.isEmpty(), "QDBusAbstractInterface", "Interface name cannot be empty");
71  }
72  if (!QDBusUtil::checkBusName(service, (isDynamic && !isPeer) ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error))
73  return error;
74  if (!QDBusUtil::checkObjectPath(path, isDynamic ? QDBusUtil::EmptyNotAllowed : QDBusUtil::EmptyAllowed, &error))
75  return error;
76  if (!QDBusUtil::checkInterfaceName(interface, QDBusUtil::EmptyAllowed, &error))
77  return error;
78 
79  // no error
80  return QDBusError();
81 }
#define error(msg)
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
Definition: qdbuserror.h:60
bool checkBusName(const QString &name, AllowEmptyFlag empty, QDBusError *error)
Definition: qdbusutil_p.h:111
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
bool checkObjectPath(const QString &path, AllowEmptyFlag empty, QDBusError *error)
Definition: qdbusutil_p.h:123
bool checkInterfaceName(const QString &name, AllowEmptyFlag empty, QDBusError *error)
Definition: qdbusutil_p.h:99