Let qdbusxml2cpp generate code that compiles: no '-' in variable names.

org.freedesktop.Application.xml has
  <arg type='a{sv}' name='platform-data' direction='in'/>

Change-Id: I035436d48ec45da3ccad7dabe01e9cccec17b730
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
David Faure 2013-05-04 11:05:10 +02:00 committed by The Qt Project
parent b2f9839457
commit 18fe18317a
2 changed files with 5 additions and 1 deletions

View File

@ -401,6 +401,8 @@ static QStringList makeArgNames(const QDBusIntrospection::Arguments &inputArgs,
QString name = arg.name;
if (name.isEmpty())
name = QString( QLatin1String("in%1") ).arg(i);
else
name.replace(QLatin1Char('-'), QLatin1Char('_'));
while (retval.contains(name))
name += QLatin1String("_");
retval << name;
@ -410,6 +412,8 @@ static QStringList makeArgNames(const QDBusIntrospection::Arguments &inputArgs,
QString name = arg.name;
if (name.isEmpty())
name = QString( QLatin1String("out%1") ).arg(i);
else
name.replace(QLatin1Char('-'), QLatin1Char('_'));
while (retval.contains(name))
name += QLatin1String("_");
retval << name;

View File

@ -8,7 +8,7 @@
</property>
<signal name="voidSignal"/>
<signal name="stringSignal">
<arg type="s"/>
<arg type="s" name="string-data"/>
</signal>
<signal name="complexSignal">
<arg name="" type="(s)"/>