summaryrefslogtreecommitdiff
path: root/HamlibTransceiver.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2018-12-19 23:01:50 +0100
committerChristoph Berg <myon@debian.org>2018-12-19 23:01:50 +0100
commit5c60c77adff9a54fd5f94f9915b22ccd8c4c5a3b (patch)
tree410fa358a5f73260a579b4d669730f319a4d2609 /HamlibTransceiver.cpp
parent6c82050de806dcdafaed0077400a6c3396a4a159 (diff)
parente0737c56c1e384e05064a0c6e1ac46979371041b (diff)
Update upstream source from tag 'upstream/2.0.0+repack'
Update to upstream version '2.0.0+repack' with Debian dir 55dbb3a6a7eb189e187dd79f732623ca0b56116d
Diffstat (limited to 'HamlibTransceiver.cpp')
-rw-r--r--HamlibTransceiver.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/HamlibTransceiver.cpp b/HamlibTransceiver.cpp
index 473f761d..f2e55bb4 100644
--- a/HamlibTransceiver.cpp
+++ b/HamlibTransceiver.cpp
@@ -261,12 +261,7 @@ HamlibTransceiver::HamlibTransceiver (int model_number, TransceiverFactory::Para
//
// user defined Hamlib settings
//
- auto settings_file_name = QStandardPaths::locate (
-#if QT_VERSION >= 0x050500
- QStandardPaths::AppConfigLocation
-#else
- QStandardPaths::ConfigLocation
-#endif
+ auto settings_file_name = QStandardPaths::locate (QStandardPaths::AppConfigLocation
, "hamlib_settings.json");
if (!settings_file_name.isEmpty ())
{
@@ -316,14 +311,21 @@ HamlibTransceiver::HamlibTransceiver (int model_number, TransceiverFactory::Para
set_conf ("rig_pathname", params.serial_port.toLatin1 ().data ());
}
set_conf ("serial_speed", QByteArray::number (params.baud).data ());
- set_conf ("data_bits", TransceiverFactory::seven_data_bits == params.data_bits ? "7" : "8");
- set_conf ("stop_bits", TransceiverFactory::one_stop_bit == params.stop_bits ? "1" : "2");
+ if (params.data_bits != TransceiverFactory::default_data_bits)
+ {
+ set_conf ("data_bits", TransceiverFactory::seven_data_bits == params.data_bits ? "7" : "8");
+ }
+ if (params.stop_bits != TransceiverFactory::default_stop_bits)
+ {
+ set_conf ("stop_bits", TransceiverFactory::one_stop_bit == params.stop_bits ? "1" : "2");
+ }
switch (params.handshake)
{
case TransceiverFactory::handshake_none: set_conf ("serial_handshake", "None"); break;
case TransceiverFactory::handshake_XonXoff: set_conf ("serial_handshake", "XONXOFF"); break;
case TransceiverFactory::handshake_hardware: set_conf ("serial_handshake", "Hardware"); break;
+ default: break;
}
if (params.force_dtr)