mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-06-26 06:55:19 -04: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
129c3ccde0
commit
605ab65e1f
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 () + '"'};
|
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
|
#if WSJT_QDEBUG_TO_FILE
|
||||||
// // open a trace file
|
// // open a trace file
|
||||||
TraceFile trace_file {QDir {QStandardPaths::writableLocation (QStandardPaths::TempLocation)}.absoluteFilePath (a.applicationName () + "_trace.log")};
|
TraceFile trace_file {QDir {QStandardPaths::writableLocation (QStandardPaths::TempLocation)}.absoluteFilePath (a.applicationName () + "_trace.log")};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user