Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline the handling of configurations #2107

Closed
dforsi opened this issue May 9, 2024 · 3 comments
Closed

Streamline the handling of configurations #2107

dforsi opened this issue May 9, 2024 · 3 comments

Comments

@dforsi
Copy link
Contributor

dforsi commented May 9, 2024

This issue is for describing the state as of commit 75afe41 of 2024/05/12 and modify the code, the online manual, or just have a place to document it.

Configuration file written twice when exiting sdrangel

The file ~/.config/f4exb/SDRangel.conf is written twice on Linux in a short time because MainSettings::save is called twice when quitting sdrangel when clicking the X button or pressing Ctrl+Q:

     
1 MainSettings::save mainsettings.cpp 173
2 MainWindow::closeEvent mainwindow.cpp 1745
     
     
1 MainSettings::save mainsettings.cpp 173
2 MainWindow::~MainWindow mainwindow.cpp 322

This is unnecessary and wasteful.
Issue #379 might be related.

Preferences::resetToDefaults called multiple times

Preferences::resetToDefaults is called 3 times when there is no configuration file (such as when sdrangel is run for the first time) and 2 times when there is a configuration file.

When there is no configuration:

     
1 Preferences::resetToDefaults preferences.cpp 48
2 Preferences::Preferences preferences.cpp 25
3 MainSettings::MainSettings mainsettings.cpp 30
4 MainCore::MainCore maincore.cpp 76
5 Holder::Holder maincore.cpp 92
6 (anonymous namespace)::Q_QGS_mainCore::innerFunction maincore.cpp 92
7 QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::operator QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::Type * qglobalstatic.h 137
8 MainCore::instance maincore.cpp 95
9 MainWindow::MainWindow mainwindow.cpp 128
10 runQtApplication main.cpp 196
11 main main.cpp 248
     
     
1 Preferences::resetToDefaults preferences.cpp 48
2 Preferences::Preferences preferences.cpp 25
3 MainSettings::MainSettings mainsettings.cpp 30
4 MainCore::MainCore maincore.cpp 76
5 Holder::Holder maincore.cpp 92
6 (anonymous namespace)::Q_QGS_mainCore::innerFunction maincore.cpp 92
7 QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::operator QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::Type * qglobalstatic.h 137
8 MainCore::instance maincore.cpp 95
9 MainWindow::MainWindow mainwindow.cpp 128
10 runQtApplication main.cpp 196
11 main main.cpp 248
     
     
1 Preferences::resetToDefaults preferences.cpp 48
2 Preferences::Preferences preferences.cpp 25
3 MainSettings::MainSettings mainsettings.cpp 30
4 MainCore::MainCore maincore.cpp 76
5 Holder::Holder maincore.cpp 92
6 (anonymous namespace)::Q_QGS_mainCore::innerFunction maincore.cpp 92
7 QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::operator QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::Type * qglobalstatic.h 137
8 MainCore::instance maincore.cpp 95
9 MainWindow::MainWindow mainwindow.cpp 128
10 runQtApplication main.cpp 196
11 main main.cpp 248

When there is a configuration:

     
1 Preferences::resetToDefaults preferences.cpp 48
2 Preferences::Preferences preferences.cpp 25
3 MainSettings::MainSettings mainsettings.cpp 30
4 MainCore::MainCore maincore.cpp 76
5 Holder::Holder maincore.cpp 92
6 (anonymous namespace)::Q_QGS_mainCore::innerFunction maincore.cpp 92
7 QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::operator QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::Type * qglobalstatic.h 137
8 MainCore::instance maincore.cpp 95
9 MainWindow::MainWindow mainwindow.cpp 128
10 runQtApplication main.cpp 196
11 main main.cpp 248
     
     
1 Preferences::resetToDefaults preferences.cpp 48
2 MainSettings::resetToDefaults mainsettings.cpp 235
3 MainSettings::MainSettings mainsettings.cpp 32
4 MainCore::MainCore maincore.cpp 76
5 Holder::Holder maincore.cpp 92
6 (anonymous namespace)::Q_QGS_mainCore::innerFunction maincore.cpp 92
7 QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::operator QGlobalStatic<MainCore, (anonymous namespace)::Q_QGS_mainCore::innerFunction, (anonymous namespace)::Q_QGS_mainCore::guard>::Type * qglobalstatic.h 137
8 MainCore::instance maincore.cpp 95
9 MainWindow::MainWindow mainwindow.cpp 128
10 runQtApplication main.cpp 196
11 main main.cpp 248

Station Position changed unexpectedly

It may happen that the position saved in the configuration for a station that didn't move (such as as desktop PC without a GPS receiver and whose public IP didn't change, with the "geoclue2" provider) when the "Auto-update from GPS" option is selected.
This is unnecessary and wasteful but it is outside of the control of sdrangel so possible fixes are:

  • deselect the auto-update option and type the desired position by hand
  • install a GPS receiver

The label of the checkbox and the tooltip of the button could also be changed to refer to a generic GNSS and to suggest that position could be:

  • the label could be changed from "Auto-update from GPS" to "Auto-update from GNSS"
  • the tooltip could be changed from "Set position from GPS (if available)" to "Set position from GNSS (or other source if available)"

Order of presets changed after second run

The configuration that is automatically created the first time that sdrangel is run, contains presets for NOAA 18 and NOAA 19 (in this order), but after subsequent runs, the order is unnecessarily swapped in the .conf file.

@dforsi dforsi changed the title Configuration file written twice when exiting sdrangel Streamline the handling of configurations May 12, 2024
Copy link

This issue is going to be closed due to inactivity

@dforsi
Copy link
Contributor Author

dforsi commented Jun 23, 2024

The method Preferences::resetToDefaults called multiple times called multiple times seems due to the fact that it is called also by m_audioDeviceManager(nullptr), on line 30 here, and the directly on line 32:

MainSettings::MainSettings() :
m_audioDeviceManager(nullptr)
{
resetToDefaults();
qInfo("MainSettings::MainSettings: settings file: format: %d location: %s", getFileFormat(), qPrintable(getFileLocation()));
}

Copy link

github-actions bot commented Aug 3, 2024

This issue is going to be closed due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant