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:
Konstantin Ritt 2012-04-18 22:49:02 +03:00 committed by Qt by Nokia
parent 1f622c986b
commit 21eb4578e5
2 changed files with 2 additions and 2 deletions

View File

@ -193,7 +193,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
QString value = iter.value().toString();
// 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
if (!value.isEmpty() && value.contains(QLatin1String("${"))) {

View File

@ -825,7 +825,7 @@ void QUnixPrintWidgetPrivate::applyPrinterProperties(QPrinter *p)
return;
printer = p;
if (p->outputFileName().isEmpty()) {
QString home = QString::fromLocal8Bit(qgetenv("HOME").constData());
QString home = QDir::homePath();
QString cur = QDir::currentPath();
if (home.at(home.length()-1) != QLatin1Char('/'))
home += QLatin1Char('/');