mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
Ref T592, sometimes using verify or default values instead of ASSERTs
This commit is contained in:
committed by
Mat Sutcliffe
parent
097dfe0a24
commit
d33b913e62
@@ -14,6 +14,7 @@
|
|||||||
#include "blackgui/stylesheetutility.h"
|
#include "blackgui/stylesheetutility.h"
|
||||||
#include "blackmisc/icons.h"
|
#include "blackmisc/icons.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
|
#include "blackmisc/verify.h"
|
||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
@@ -404,6 +405,7 @@ namespace BlackGui
|
|||||||
this->initStatusBarAndProperties();
|
this->initStatusBarAndProperties();
|
||||||
|
|
||||||
// for the first time resize
|
// for the first time resize
|
||||||
|
BLACK_VERIFY(!m_preferredSizeWhenFloating.isNull());
|
||||||
if (!m_preferredSizeWhenFloating.isNull())
|
if (!m_preferredSizeWhenFloating.isNull())
|
||||||
{
|
{
|
||||||
m_initialDockedMinimumSize = this->minimumSize();
|
m_initialDockedMinimumSize = this->minimumSize();
|
||||||
@@ -584,14 +586,22 @@ namespace BlackGui
|
|||||||
|
|
||||||
CDockWidgetSettings CDockWidget::getSettings() const
|
CDockWidgetSettings CDockWidget::getSettings() const
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(!this->objectName().isEmpty(), Q_FUNC_INFO, "Need object name for settings %OwnerName%");
|
if (this->objectName().isEmpty()) { return CDockWidgetSettings(); }
|
||||||
|
|
||||||
|
// we need object name for settings %OwnerName%"
|
||||||
const CDockWidgetSettings s = m_settings.get();
|
const CDockWidgetSettings s = m_settings.get();
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDockWidget::saveSettings(const CDockWidgetSettings &settings)
|
void CDockWidget::saveSettings(const CDockWidgetSettings &settings)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(!this->objectName().isEmpty(), Q_FUNC_INFO, "Need object name for settings %OwnerName%");
|
BLACK_VERIFY_X(!this->objectName().isEmpty(), Q_FUNC_INFO, "Need object name for settings %OwnerName%");
|
||||||
|
if (this->objectName().isEmpty())
|
||||||
|
{
|
||||||
|
CStatusMessage(this).error(u"Settings cannot be saved!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const CStatusMessage m = m_settings.setAndSave(settings);
|
const CStatusMessage m = m_settings.setAndSave(settings);
|
||||||
if (m.isFailure())
|
if (m.isFailure())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user