Do not try to open a missing Hamlib settings file

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6349 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-01-05 17:29:24 +00:00
parent da7fbe947b
commit 6595c329a8

View File

@ -240,13 +240,16 @@ HamlibTransceiver::HamlibTransceiver (int model_number, TransceiverFactory::Para
// //
// user defined Hamlib settings // user defined Hamlib settings
// //
QFile settings_file {QStandardPaths::locate ( auto settings_file_name = QStandardPaths::locate (
#if QT_VERSION >= 0x050500 #if QT_VERSION >= 0x050500
QStandardPaths::AppConfigLocation QStandardPaths::AppConfigLocation
#else #else
QStandardPaths::ConfigLocation QStandardPaths::ConfigLocation
#endif #endif
, "hamlib_settings.json")}; , "hamlib_settings.json");
if (!settings_file_name.isEmpty ())
{
QFile settings_file {settings_file_name};
if (settings_file.open (QFile::ReadOnly)) if (settings_file.open (QFile::ReadOnly))
{ {
QJsonParseError status; QJsonParseError status;
@ -281,6 +284,7 @@ HamlibTransceiver::HamlibTransceiver (int model_number, TransceiverFactory::Para
} }
} }
} }
}
if (RIG_MODEL_DUMMY != model_number) if (RIG_MODEL_DUMMY != model_number)
{ {