QAmqpClient: Fix attempt to assign const QString

How on earth did I expect that to work?  Morning cup of tea hasn't
kicked in yet, of course I can't assign a const QString passed by
reference.

Fix egregious PEBKAC-caused compile error.
This commit is contained in:
Stuart Longland 2015-04-10 05:59:09 +10:00
parent 2622a482b4
commit bca3f5f8bd
1 changed files with 4 additions and 3 deletions

View File

@ -672,15 +672,16 @@ QAmqpExchange *QAmqpClient::createExchange(const QString &name, int channelNumbe
if (!name.isEmpty())
exchange->setName(name);
else if (name.isNull())
if (name.isNull())
/*
* We don't want two copies of the default exchange, one referenced by
* QString() and the other by QString(""). QString() != QString("") So
* if it's null, overwrite with the empty string, since that's its
* official name.
*/
name = "";
d->exchanges[name] = exchange;
d->exchanges[""] = exchange;
else
d->exchanges[name] = exchange;
return exchange;
}