replace getenv("HOME") with a "centralized" QDir::homePath()
Task-number: QTBUG-4902 Change-Id: Ie9124de45be2d8e859f8b0aaea246e660145a1c5 Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
parent
1f622c986b
commit
21eb4578e5
@ -193,7 +193,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
|
|||||||
QString value = iter.value().toString();
|
QString value = iter.value().toString();
|
||||||
|
|
||||||
// optimize for a common case
|
// optimize for a common case
|
||||||
value.replace(QLatin1String("${HOME}"), QFile::decodeName(qgetenv("HOME")));
|
value.replace(QLatin1String("${HOME}"), QDir::homePath());
|
||||||
|
|
||||||
// Do ${} format environment variable substitution if necessary
|
// Do ${} format environment variable substitution if necessary
|
||||||
if (!value.isEmpty() && value.contains(QLatin1String("${"))) {
|
if (!value.isEmpty() && value.contains(QLatin1String("${"))) {
|
||||||
|
@ -825,7 +825,7 @@ void QUnixPrintWidgetPrivate::applyPrinterProperties(QPrinter *p)
|
|||||||
return;
|
return;
|
||||||
printer = p;
|
printer = p;
|
||||||
if (p->outputFileName().isEmpty()) {
|
if (p->outputFileName().isEmpty()) {
|
||||||
QString home = QString::fromLocal8Bit(qgetenv("HOME").constData());
|
QString home = QDir::homePath();
|
||||||
QString cur = QDir::currentPath();
|
QString cur = QDir::currentPath();
|
||||||
if (home.at(home.length()-1) != QLatin1Char('/'))
|
if (home.at(home.length()-1) != QLatin1Char('/'))
|
||||||
home += QLatin1Char('/');
|
home += QLatin1Char('/');
|
||||||
|
Loading…
Reference in New Issue
Block a user