Clear QCoreApplication::applicationFilePath cache if argv[0] changes.
This allows boosters to precreate Q*Application instances. Change-Id: Ie2c1399b216d9cc996210e077fa6d42d24bf9b0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
982da20cf2
commit
e70ecc06b1
|
|
@ -1939,6 +1939,14 @@ QString QCoreApplication::applicationFilePath()
|
|||
}
|
||||
|
||||
QCoreApplicationPrivate *d = self->d_func();
|
||||
|
||||
static char *procName = d->argv[0];
|
||||
if (qstrcmp(procName, d->argv[0]) != 0) {
|
||||
// clear the cache if the procname changes, so we reprocess it.
|
||||
d->cachedApplicationFilePath = QString();
|
||||
procName = d->argv[0];
|
||||
}
|
||||
|
||||
if (!d->cachedApplicationFilePath.isNull())
|
||||
return d->cachedApplicationFilePath;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue