Skip to content

Commit a270a3f

Browse files
committed
fixup-comments-and-whitespace
1 parent 51583f9 commit a270a3f

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

linux.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void migrateHomePath()
114114

115115
QString relativeInstallPath()
116116
{
117-
QFileInfo applicationFileInfo(QCoreApplication::applicationFilePath());
117+
QFileInfo applicationFileInfo(QCoreApplication::applicationFilePath());
118118
QString applicationDirectory = applicationFileInfo.absolutePath();
119119
QFile configurationFile(applicationDirectory + "/updater.conf");
120120
if (configurationFile.exists()) {
@@ -130,14 +130,17 @@ QString defaultInstallPath()
130130
// it itself
131131
migrateHomePath();
132132

133-
// Does not use QStandardPaths::AppDataLocation because
134-
// it returns "~/.local/share/unvanquished/updater"
135-
// and we want "~/.local/share/unvanquished/base"
136-
// game itself puts stuff in "~/.local/share/unvanquished"
133+
// Relative installation, install next to the updater
134+
// if there is an updater.conf file in the same directory.
137135
QString relative = relativeInstallPath();
138136
if (!relative.isNull()) {
139137
return relative;
140138
}
139+
140+
// Standard installation, do not use QStandardPaths::AppDataLocation
141+
// because it returns: ~/.local/share/unvanquished/updater
142+
// and we want: ~/.local/share/unvanquished/base
143+
// The game itself stores its own files in: ~/.local/share/unvanquished
141144
return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/unvanquished/base";
142145
}
143146

@@ -306,13 +309,17 @@ void initApplicationName()
306309
QCoreApplication::setApplicationName("updater");
307310
}
308311

309-
// Settings are stored in ~/.config/unvanquished/updater.conf
310312
QSettings* makePersistentSettings(QObject* parent)
311313
{
314+
// Relative installation, store the configuration file next to
315+
// the updater if there is already one there.
312316
QString relative = relativeInstallPath();
313317
if (!relative.isNull()) {
314318
return new QSettings(relative + "/updater.conf", QSettings::NativeFormat, parent);
315319
}
320+
321+
// Standard installation, settings are stored
322+
// in: ~/.config/unvanquished/updater.conf
316323
return new QSettings(parent);
317324
}
318325

0 commit comments

Comments
 (0)