Commit b950c8c1 authored by Lorenz Haas's avatar Lorenz Haas Committed by David Schulz
Browse files

Beautifier: Small, paranoid local caching in the hope for gaining speed

Avoid that QDir::home() is potentially called twice.

Change-Id: I9fca53f800be74f05d941cf9baa34eecb6c899cb
Reviewed-by: default avatarOrgad Shaneh <>
Reviewed-by: default avatarDavid Schulz <>
parent 991e1bfa
......@@ -117,11 +117,12 @@ void ArtisticStyle::formatFile()
if (cfgFileName.isEmpty() && m_settings->useHomeFile()) {
QString file = QDir::home().filePath(QLatin1String(".astylerc"));
const QDir homeDirectory = QDir::home();
QString file = homeDirectory.filePath(QLatin1String(".astylerc"));
if (QFile::exists(file)) {
cfgFileName = file;
} else {
file = QDir::home().filePath(QLatin1String("astylerc"));
file = homeDirectory.filePath(QLatin1String("astylerc"));
if (QFile::exists(file))
cfgFileName = file;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment