From: Konstantin Ritt Date: Wed, 18 Apr 2012 19:49:02 +0000 (+0300) Subject: replace getenv("HOME") with a "centralized" QDir::homePath() X-Git-Tag: 071012110112~1563 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21eb4578e5e0da44c87fc6a7d0d664c3584194e8;p=profile%2Fivi%2Fqtbase.git replace getenv("HOME") with a "centralized" QDir::homePath() Task-number: QTBUG-4902 Change-Id: Ie9124de45be2d8e859f8b0aaea246e660145a1c5 Reviewed-by: John Layt Reviewed-by: Oswald Buddenhagen --- diff --git a/src/corelib/io/qstandardpaths_json.cpp b/src/corelib/io/qstandardpaths_json.cpp index c7cb858..8542371 100644 --- a/src/corelib/io/qstandardpaths_json.cpp +++ b/src/corelib/io/qstandardpaths_json.cpp @@ -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("${"))) { diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 75c9664..f7689c1 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -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('/');