Reading settings file causes crash.

This commit is contained in:
Roman Telezhynskyi 2023-02-13 19:54:17 +02:00
parent 6aaa20010d
commit 4a82ea8687
5 changed files with 4 additions and 26 deletions

View file

@ -1672,7 +1672,6 @@ void VPMainWindow::ReadSettings()
if (settings->status() == QSettings::NoError)
{
restoreGeometry(settings->GetGeometry());
restoreState(settings->GetWindowState());
restoreState(settings->GetToolbarsState(), AppVersion());
// Text under tool buton icon
@ -1698,7 +1697,6 @@ void VPMainWindow::WriteSettings()
{
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
settings->SetGeometry(saveGeometry());
settings->SetWindowState(saveState());
settings->SetToolbarsState(saveState(AppVersion()));
settings->SetDockWidgetPropertiesActive(ui->dockWidgetProperties->isEnabled());

View file

@ -3611,7 +3611,6 @@ void TMainWindow::ReadSettings()
if (settings->status() == QSettings::NoError)
{
restoreGeometry(settings->GetGeometry());
restoreState(settings->GetWindowState());
restoreState(settings->GetToolbarsState(), AppVersion());
// Text under tool buton icon
@ -3631,7 +3630,6 @@ void TMainWindow::WriteSettings()
{
VTapeSettings *settings = MApplication::VApp()->TapeSettings();
settings->SetGeometry(saveGeometry());
settings->SetWindowState(saveState());
settings->SetToolbarsState(saveState(AppVersion()));
settings->SetTapeSearchOptionMatchCase(m_search->IsMatchCase());

View file

@ -5204,7 +5204,6 @@ void MainWindow::ReadSettings()
if (settings->status() == QSettings::NoError)
{
restoreGeometry(settings->GetGeometry());
restoreState(settings->GetWindowState());
restoreState(settings->GetToolbarsState(), AppVersion());
m_groupsActive = settings->IsDockWidgetGroupsActive();
@ -5249,7 +5248,6 @@ void MainWindow::WriteSettings()
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
settings->SetGeometry(saveGeometry());
settings->SetWindowState(saveState());
settings->SetToolbarsState(saveState(AppVersion()));
settings->SetDockWidgetGroupsActive(ui->dockWidgetGroups->isVisible());

View file

@ -46,10 +46,10 @@
#include <QTextCodec>
#endif
#include "../vmisc/def.h"
#include "../vmisc/defglobal.h"
#include "../vmisc/compatibility.h"
#include "../vmisc/literals.h"
#include "def.h"
#include "defglobal.h"
#include "compatibility.h"
#include "literals.h"
const int VCommonSettings::defaultScrollingDuration = 300;
const int VCommonSettings::scrollingDurationMin = 100;
@ -120,7 +120,6 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternGraphicalOutput, (QLatin1
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralRecentFileList, (QLatin1String("recentFileList"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralRestoreFileList, (QLatin1String("restoreFileList"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralGeometry, (QLatin1String("geometry"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralWindowState, (QLatin1String("windowState"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralToolbarsState, (QLatin1String("toolbarsState"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationDarkMode, (QLatin1String("configuration/dark_mode"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPreferenceDialogSize, (QLatin1String("preferenceDialogSize"))) // NOLINT
@ -755,18 +754,6 @@ void VCommonSettings::SetGeometry(const QByteArray &value)
setValue(*settingGeneralGeometry, value);
}
//---------------------------------------------------------------------------------------------------------------------
auto VCommonSettings::GetWindowState() const -> QByteArray
{
return value(*settingGeneralWindowState).toByteArray();
}
//---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetWindowState(const QByteArray &value)
{
setValue(*settingGeneralWindowState, value);
}
//---------------------------------------------------------------------------------------------------------------------
auto VCommonSettings::GetToolbarsState() const -> QByteArray
{

View file

@ -140,9 +140,6 @@ public:
auto GetGeometry() const -> QByteArray;
void SetGeometry(const QByteArray &value);
auto GetWindowState() const -> QByteArray;
void SetWindowState(const QByteArray &value);
auto GetToolbarsState() const -> QByteArray;
void SetToolbarsState(const QByteArray &value);