mirror of
https://github.com/rgriebl/brickstore.git
synced 2026-05-24 17:58:25 -05:00
Cleanup online-state handling
This commit is contained in:
@@ -616,22 +616,6 @@ void Config::setBrickLinkPassword(const QString &pass, bool doNotSave)
|
||||
}
|
||||
}
|
||||
|
||||
bool Config::onlineStatus() const
|
||||
{
|
||||
return value(u"Internet/Online"_qs, true).toBool();
|
||||
}
|
||||
|
||||
void Config::setOnlineStatus(bool b)
|
||||
{
|
||||
bool ob = onlineStatus();
|
||||
|
||||
if (b != ob) {
|
||||
setValue(u"Internet/Online"_qs, b);
|
||||
|
||||
emit onlineStatusChanged(b);
|
||||
}
|
||||
}
|
||||
|
||||
Config::PartOutMode Config::partOutMode() const
|
||||
{
|
||||
int v = value(u"General/PartOutMode"_qs).toInt();
|
||||
|
||||
@@ -76,8 +76,6 @@ public:
|
||||
void setShowInputErrors(bool b);
|
||||
bool showDifferenceIndicators() const;
|
||||
void setShowDifferenceIndicators(bool b);
|
||||
bool onlineStatus() const;
|
||||
void setOnlineStatus(bool b);
|
||||
|
||||
enum class PartOutMode {
|
||||
Ask,
|
||||
@@ -184,7 +182,6 @@ signals:
|
||||
void showDifferenceIndicatorsChanged(bool b);
|
||||
void visualChangesMarkModifiedChanged(bool b);
|
||||
void updateIntervalsChanged(const QMap<QByteArray, int> &intervals);
|
||||
void onlineStatusChanged(bool b);
|
||||
void toolBarSizeChanged(Config::UISize iconSize);
|
||||
void iconSizePercentChanged(int p);
|
||||
void fontSizePercentChanged(int p);
|
||||
|
||||
@@ -34,7 +34,8 @@ OnlineState::OnlineState(QObject *parent)
|
||||
|
||||
connect(qni, &QNetworkInformation::reachabilityChanged,
|
||||
this, [this](QNetworkInformation::Reachability r) {
|
||||
auto online = (r == QNetworkInformation::Reachability::Online);
|
||||
auto online = (r == QNetworkInformation::Reachability::Online)
|
||||
|| (r == QNetworkInformation::Reachability::Unknown);
|
||||
if (online != m_online) {
|
||||
m_online = online;
|
||||
emit onlineStateChanged(m_online);
|
||||
|
||||
Reference in New Issue
Block a user