Use org.example instead of com.trolltech for the D-Bus examples
We could use org.qtproject, but since this is an example anyway, and since example.org and example.com are reserved to IANA by RFC 2606 anyway, let's use that. Task-number: QTBUG-23274 Change-Id: Icdb1ac0390f88b72fa21b02ab362f1a98f26266c Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
This commit is contained in:
parent
c4a457f8e4
commit
5f22899a17
@ -60,7 +60,7 @@ void Ping::start(const QString &name, const QString &oldValue, const QString &ne
|
|||||||
qstdin.open(stdin, QIODevice::ReadOnly);
|
qstdin.open(stdin, QIODevice::ReadOnly);
|
||||||
|
|
||||||
// find our remote
|
// find our remote
|
||||||
iface = new QDBusInterface(SERVICE_NAME, "/", "com.trolltech.QtDBus.ComplexPong.Pong",
|
iface = new QDBusInterface(SERVICE_NAME, "/", "org.example.QtDBus.ComplexPong.Pong",
|
||||||
QDBusConnection::sessionBus(), this);
|
QDBusConnection::sessionBus(), this);
|
||||||
if (!iface->isValid()) {
|
if (!iface->isValid()) {
|
||||||
fprintf(stderr, "%s\n",
|
fprintf(stderr, "%s\n",
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
class Pong: public QDBusAbstractAdaptor
|
class Pong: public QDBusAbstractAdaptor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_CLASSINFO("D-Bus Interface", "com.trolltech.QtDBus.ComplexPong.Pong")
|
Q_CLASSINFO("D-Bus Interface", "org.example.QtDBus.ComplexPong.Pong")
|
||||||
Q_PROPERTY(QString value READ value WRITE setValue)
|
Q_PROPERTY(QString value READ value WRITE setValue)
|
||||||
public:
|
public:
|
||||||
QString m_value;
|
QString m_value;
|
||||||
|
@ -38,4 +38,4 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define SERVICE_NAME "com.trolltech.QtDBus.PingExample"
|
#define SERVICE_NAME "org.example.QtDBus.PingExample"
|
||||||
|
@ -65,7 +65,7 @@ ChatMainWindow::ChatMainWindow()
|
|||||||
com::trolltech::chat *iface;
|
com::trolltech::chat *iface;
|
||||||
iface = new com::trolltech::chat(QString(), QString(), QDBusConnection::sessionBus(), this);
|
iface = new com::trolltech::chat(QString(), QString(), QDBusConnection::sessionBus(), this);
|
||||||
//connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString)));
|
//connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString)));
|
||||||
QDBusConnection::sessionBus().connect(QString(), QString(), "com.trolltech.chat", "message", this, SLOT(messageSlot(QString,QString)));
|
QDBusConnection::sessionBus().connect(QString(), QString(), "org.example.chat", "message", this, SLOT(messageSlot(QString,QString)));
|
||||||
connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString)));
|
connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString)));
|
||||||
|
|
||||||
NicknameDialog dialog;
|
NicknameDialog dialog;
|
||||||
@ -115,7 +115,7 @@ void ChatMainWindow::textChangedSlot(const QString &newText)
|
|||||||
void ChatMainWindow::sendClickedSlot()
|
void ChatMainWindow::sendClickedSlot()
|
||||||
{
|
{
|
||||||
//emit message(m_nickname, messageLineEdit->text());
|
//emit message(m_nickname, messageLineEdit->text());
|
||||||
QDBusMessage msg = QDBusMessage::createSignal("/", "com.trolltech.chat", "message");
|
QDBusMessage msg = QDBusMessage::createSignal("/", "org.example.chat", "message");
|
||||||
msg << m_nickname << messageLineEdit->text();
|
msg << m_nickname << messageLineEdit->text();
|
||||||
QDBusConnection::sessionBus().send(msg);
|
QDBusConnection::sessionBus().send(msg);
|
||||||
messageLineEdit->setText(QString());
|
messageLineEdit->setText(QString());
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
**
|
**
|
||||||
**
|
**
|
||||||
** This file was generated by qdbusxml2cpp version 0.7
|
** This file was generated by qdbusxml2cpp version 0.7
|
||||||
** Command line was: qdbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp com.trolltech.chat.xml
|
** Command line was: qdbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp org.example.chat.xml
|
||||||
**
|
**
|
||||||
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
**
|
**
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
**
|
**
|
||||||
**
|
**
|
||||||
** This file was generated by qdbusxml2cpp version 0.7
|
** This file was generated by qdbusxml2cpp version 0.7
|
||||||
** Command line was: qdbusxml2cpp -a chat_adaptor.h: com.trolltech.chat.xml
|
** Command line was: qdbusxml2cpp -a chat_adaptor.h: org.example.chat.xml
|
||||||
**
|
**
|
||||||
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
**
|
**
|
||||||
@ -64,14 +64,14 @@ class QVariant;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adaptor class for interface com.trolltech.chat
|
* Adaptor class for interface org.example.chat
|
||||||
*/
|
*/
|
||||||
class ChatAdaptor: public QDBusAbstractAdaptor
|
class ChatAdaptor: public QDBusAbstractAdaptor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_CLASSINFO("D-Bus Interface", "com.trolltech.chat")
|
Q_CLASSINFO("D-Bus Interface", "org.example.chat")
|
||||||
Q_CLASSINFO("D-Bus Introspection", ""
|
Q_CLASSINFO("D-Bus Introspection", ""
|
||||||
" <interface name=\"com.trolltech.chat\">\n"
|
" <interface name=\"org.example.chat\">\n"
|
||||||
" <signal name=\"message\">\n"
|
" <signal name=\"message\">\n"
|
||||||
" <arg direction=\"out\" type=\"s\" name=\"nickname\"/>\n"
|
" <arg direction=\"out\" type=\"s\" name=\"nickname\"/>\n"
|
||||||
" <arg direction=\"out\" type=\"s\" name=\"text\"/>\n"
|
" <arg direction=\"out\" type=\"s\" name=\"text\"/>\n"
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
**
|
**
|
||||||
**
|
**
|
||||||
** This file was generated by qdbusxml2cpp version 0.7
|
** This file was generated by qdbusxml2cpp version 0.7
|
||||||
** Command line was: qdbusxml2cpp -i chat_interface.h -p :chat_interface.cpp com.trolltech.chat.xml
|
** Command line was: qdbusxml2cpp -i chat_interface.h -p :chat_interface.cpp org.example.chat.xml
|
||||||
**
|
**
|
||||||
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
**
|
**
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
**
|
**
|
||||||
**
|
**
|
||||||
** This file was generated by qdbusxml2cpp version 0.7
|
** This file was generated by qdbusxml2cpp version 0.7
|
||||||
** Command line was: qdbusxml2cpp -p chat_interface.h: com.trolltech.chat.xml
|
** Command line was: qdbusxml2cpp -p chat_interface.h: org.example.chat.xml
|
||||||
**
|
**
|
||||||
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
** qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
**
|
**
|
||||||
@ -60,14 +60,14 @@
|
|||||||
#include <QtDBus/QtDBus>
|
#include <QtDBus/QtDBus>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Proxy class for interface com.trolltech.chat
|
* Proxy class for interface org.example.chat
|
||||||
*/
|
*/
|
||||||
class ComTrolltechChatInterface: public QDBusAbstractInterface
|
class ComTrolltechChatInterface: public QDBusAbstractInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static inline const char *staticInterfaceName()
|
static inline const char *staticInterfaceName()
|
||||||
{ return "com.trolltech.chat"; }
|
{ return "org.example.chat"; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ComTrolltechChatInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
ComTrolltechChatInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||||
<node>
|
<node>
|
||||||
<interface name="com.trolltech.chat">
|
<interface name="org.example.chat">
|
||||||
<signal name="message">
|
<signal name="message">
|
||||||
<arg name="nickname" type="s" direction="out"/>
|
<arg name="nickname" type="s" direction="out"/>
|
||||||
<arg name="text" type="s" direction="out"/>
|
<arg name="text" type="s" direction="out"/>
|
||||||
|
@ -5,8 +5,8 @@ HEADERS += chat.h chat_adaptor.h chat_interface.h
|
|||||||
SOURCES += chat.cpp chat_adaptor.cpp chat_interface.cpp
|
SOURCES += chat.cpp chat_adaptor.cpp chat_interface.cpp
|
||||||
FORMS += chatmainwindow.ui chatsetnickname.ui
|
FORMS += chatmainwindow.ui chatsetnickname.ui
|
||||||
|
|
||||||
#DBUS_ADAPTORS += com.trolltech.chat.xml
|
#DBUS_ADAPTORS += org.example.chat.xml
|
||||||
#DBUS_INTERFACES += com.trolltech.chat.xml
|
#DBUS_INTERFACES += org.example.chat.xml
|
||||||
|
|
||||||
# install
|
# install
|
||||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/chat
|
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/chat
|
||||||
|
@ -38,4 +38,4 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define SERVICE_NAME "com.trolltech.QtDBus.PingExample"
|
#define SERVICE_NAME "org.example.QtDBus.PingExample"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||||
<node name="/com/trollech/examples/car">
|
<node name="/com/trollech/examples/car">
|
||||||
<interface name="com.trolltech.Examples.CarInterface">
|
<interface name="org.example.Examples.CarInterface">
|
||||||
<method name="accelerate"/>
|
<method name="accelerate"/>
|
||||||
<method name="decelerate"/>
|
<method name="decelerate"/>
|
||||||
<method name="turnLeft"/>
|
<method name="turnLeft"/>
|
||||||
|
@ -74,25 +74,25 @@ CarInterfaceAdaptor::~CarInterfaceAdaptor()
|
|||||||
|
|
||||||
void CarInterfaceAdaptor::accelerate()
|
void CarInterfaceAdaptor::accelerate()
|
||||||
{
|
{
|
||||||
// handle method call com.trolltech.Examples.CarInterface.accelerate
|
// handle method call org.example.Examples.CarInterface.accelerate
|
||||||
QMetaObject::invokeMethod(parent(), "accelerate");
|
QMetaObject::invokeMethod(parent(), "accelerate");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CarInterfaceAdaptor::decelerate()
|
void CarInterfaceAdaptor::decelerate()
|
||||||
{
|
{
|
||||||
// handle method call com.trolltech.Examples.CarInterface.decelerate
|
// handle method call org.example.Examples.CarInterface.decelerate
|
||||||
QMetaObject::invokeMethod(parent(), "decelerate");
|
QMetaObject::invokeMethod(parent(), "decelerate");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CarInterfaceAdaptor::turnLeft()
|
void CarInterfaceAdaptor::turnLeft()
|
||||||
{
|
{
|
||||||
// handle method call com.trolltech.Examples.CarInterface.turnLeft
|
// handle method call org.example.Examples.CarInterface.turnLeft
|
||||||
QMetaObject::invokeMethod(parent(), "turnLeft");
|
QMetaObject::invokeMethod(parent(), "turnLeft");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CarInterfaceAdaptor::turnRight()
|
void CarInterfaceAdaptor::turnRight()
|
||||||
{
|
{
|
||||||
// handle method call com.trolltech.Examples.CarInterface.turnRight
|
// handle method call org.example.Examples.CarInterface.turnRight
|
||||||
QMetaObject::invokeMethod(parent(), "turnRight");
|
QMetaObject::invokeMethod(parent(), "turnRight");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,14 +64,14 @@ class QVariant;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adaptor class for interface com.trolltech.Examples.CarInterface
|
* Adaptor class for interface org.example.Examples.CarInterface
|
||||||
*/
|
*/
|
||||||
class CarInterfaceAdaptor: public QDBusAbstractAdaptor
|
class CarInterfaceAdaptor: public QDBusAbstractAdaptor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_CLASSINFO("D-Bus Interface", "com.trolltech.Examples.CarInterface")
|
Q_CLASSINFO("D-Bus Interface", "org.example.Examples.CarInterface")
|
||||||
Q_CLASSINFO("D-Bus Introspection", ""
|
Q_CLASSINFO("D-Bus Introspection", ""
|
||||||
" <interface name=\"com.trolltech.Examples.CarInterface\">\n"
|
" <interface name=\"org.example.Examples.CarInterface\">\n"
|
||||||
" <method name=\"accelerate\"/>\n"
|
" <method name=\"accelerate\"/>\n"
|
||||||
" <method name=\"decelerate\"/>\n"
|
" <method name=\"decelerate\"/>\n"
|
||||||
" <method name=\"turnLeft\"/>\n"
|
" <method name=\"turnLeft\"/>\n"
|
||||||
|
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
new CarInterfaceAdaptor(car);
|
new CarInterfaceAdaptor(car);
|
||||||
QDBusConnection connection = QDBusConnection::sessionBus();
|
QDBusConnection connection = QDBusConnection::sessionBus();
|
||||||
connection.registerObject("/Car", car);
|
connection.registerObject("/Car", car);
|
||||||
connection.registerService("com.trolltech.CarExample");
|
connection.registerService("org.example.CarExample");
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||||
<node name="/com/trollech/examples/car">
|
<node name="/com/trollech/examples/car">
|
||||||
<interface name="com.trolltech.Examples.CarInterface">
|
<interface name="org.example.Examples.CarInterface">
|
||||||
<method name="accelerate"/>
|
<method name="accelerate"/>
|
||||||
<method name="decelerate"/>
|
<method name="decelerate"/>
|
||||||
<method name="turnLeft"/>
|
<method name="turnLeft"/>
|
||||||
|
@ -60,14 +60,14 @@
|
|||||||
#include <QtDBus/QtDBus>
|
#include <QtDBus/QtDBus>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Proxy class for interface com.trolltech.Examples.CarInterface
|
* Proxy class for interface org.example.Examples.CarInterface
|
||||||
*/
|
*/
|
||||||
class ComTrolltechExamplesCarInterfaceInterface: public QDBusAbstractInterface
|
class ComTrolltechExamplesCarInterfaceInterface: public QDBusAbstractInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static inline const char *staticInterfaceName()
|
static inline const char *staticInterfaceName()
|
||||||
{ return "com.trolltech.Examples.CarInterface"; }
|
{ return "org.example.Examples.CarInterface"; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ComTrolltechExamplesCarInterfaceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
ComTrolltechExamplesCarInterfaceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
|
||||||
|
@ -47,7 +47,7 @@ Controller::Controller(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
car = new com::trolltech::Examples::CarInterface("com.trolltech.CarExample", "/Car",
|
car = new com::trolltech::Examples::CarInterface("org.example.CarExample", "/Car",
|
||||||
QDBusConnection::sessionBus(), this);
|
QDBusConnection::sessionBus(), this);
|
||||||
startTimer(1000);
|
startTimer(1000);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user