From 517b8c2446029901e9062e858b723906cf20d7ef Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 5 Jun 2006 18:13:07 +0000 Subject: * qt/dbus: Add directory. I had forgotten to add this yesterday after the move... * qt/examples/Makefile.am: * qt/examples/dbus.cpp: Moved to qt/tools/dbus.cpp. * qt/tools/Makefile.am: * qt/tools/dbus.cpp: Moved from qt/examples/dbus.cpp. Added feature to get and set properties. Added validation of service, object path and interface names. * qt/tools/dbusidl2cpp.cpp: Two new features: 1) Allow specifying both the header and the source file names, by separating them with a colon. 2) Don't write an interface output if the -p switch wasn't given, but the -a was. * qt/src/*: Fix usage of Iterators and ConstIterators. Fix shadowing of variables by other variables (-Wshadow). Fix keyword-cleanliness in headers. Fix ASCII-cast (QLatin1String, QLatin1Char). Fix validation of member names. Add extra checking of introspection data during XML parsing. Various bug fixes. --- qt/src/qdbusutil.cpp | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'qt/src/qdbusutil.cpp') diff --git a/qt/src/qdbusutil.cpp b/qt/src/qdbusutil.cpp index 872434c5..22ce3a81 100644 --- a/qt/src/qdbusutil.cpp +++ b/qt/src/qdbusutil.cpp @@ -42,13 +42,11 @@ namespace QDBusUtil Returns true if this is \a ifaceName is a valid interface name. Valid interface names must: - \list - \o not be empty - \o not exceed 255 characters in length - \o be composed of dot-separated string components that contain only ASCII letters, digits - and the underscore ("_") character - \o contain at least two such components - \endlist + - not be empty + - not exceed 255 characters in length + - be composed of dot-separated string components that contain only ASCII letters, digits + and the underscore ("_") character + - contain at least two such components */ bool isValidInterfaceName(const QString& ifaceName) { @@ -96,13 +94,11 @@ namespace QDBusUtil Returns true if \a busName is a valid bus name. A valid bus name is either a valid unique connection name or follows the rules: - \list - \o is not empty - \o does not exceed 255 characters in length - \o be composed of dot-separated string components that contain only ASCII letters, digits, - hyphens or underscores ("_"), but don't start with a digit - \o contains at least two such elements - \endlist + - is not empty + - does not exceed 255 characters in length + - be composed of dot-separated string components that contain only ASCII letters, digits, + hyphens or underscores ("_"), but don't start with a digit + - contains at least two such elements \sa isValidUniqueConnectionName() */ @@ -137,7 +133,7 @@ namespace QDBusUtil if (memberName.isEmpty() || memberName.length() > DBUS_MAXIMUM_NAME_LENGTH) return false; - QRegExp regex(QLatin1String("[a-zA-Z_][a-zA-Z0-9_]+")); + QRegExp regex(QLatin1String("[a-zA-Z_][a-zA-Z0-9_]*")); return regex.exactMatch(memberName); } @@ -156,13 +152,11 @@ namespace QDBusUtil Returns true if \a path is valid object path. Valid object paths follow the rules: - \list - \o start with the slash character ("/") - \o do not end in a slash, unless the path is just the initial slash - \o do not contain any two slashes in sequence - \o contain slash-separated parts, each of which is composed of ASCII letters, digits and - underscores ("_") - \endlist + - start with the slash character ("/") + - do not end in a slash, unless the path is just the initial slash + - do not contain any two slashes in sequence + - contain slash-separated parts, each of which is composed of ASCII letters, digits and + underscores ("_") */ bool isValidObjectPath(const QString &path) { -- cgit