mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 20:58:55 -05:00
Check that the settings file is writeable
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5255 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
49b969be3b
commit
3fa68143c2
9
main.cpp
9
main.cpp
@ -143,7 +143,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
throw std::runtime_error {"Cannot find a usable configuration path \"" + config_path.path ().toStdString () + '"'};
|
||||
}
|
||||
QSettings settings(config_path.absoluteFilePath (a.applicationName () + ".ini"), QSettings::IniFormat);
|
||||
|
||||
auto settings_file = config_path.absoluteFilePath (a.applicationName () + ".ini");
|
||||
QSettings settings(settings_file, QSettings::IniFormat);
|
||||
if (!settings.isWritable ())
|
||||
{
|
||||
throw std::runtime_error {QString {"Cannot access \"%1\" for writing"}.arg (settings_file).toStdString ()};
|
||||
}
|
||||
|
||||
#if WSJT_QDEBUG_TO_FILE
|
||||
// // open a trace file
|
||||
TraceFile trace_file {QDir {QStandardPaths::writableLocation (QStandardPaths::TempLocation)}.absoluteFilePath (a.applicationName () + "_trace.log")};
|
||||
|
Loading…
Reference in New Issue
Block a user