mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remember status of specific cloud account in settings
What matters is that the cloud storage for a specific email address has successfully been synced - and we need to remember this across restarts of the app. This way Subsurface-mobile can work with different accounts, even if offline. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d43a2c032b
commit
c1b3de6190
2 changed files with 13 additions and 5 deletions
|
@ -42,7 +42,6 @@ extern "C" int gitProgressCB(int percent)
|
||||||
|
|
||||||
QMLManager::QMLManager() : m_locationServiceEnabled(false),
|
QMLManager::QMLManager() : m_locationServiceEnabled(false),
|
||||||
m_verboseEnabled(false),
|
m_verboseEnabled(false),
|
||||||
m_loadFromCloud(false),
|
|
||||||
reply(0)
|
reply(0)
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
|
@ -54,9 +53,9 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
|
||||||
// create location manager service
|
// create location manager service
|
||||||
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
|
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
|
||||||
set_git_update_cb(&gitProgressCB);
|
set_git_update_cb(&gitProgressCB);
|
||||||
QSettings s;
|
|
||||||
if (s.contains("setLoadFromCloud") && s.value("setLoadFromCloud").toInt() == 1)
|
// make sure we know if the current cloud repo has been successfully synced
|
||||||
setLoadFromCloud(true);
|
syncLoadFromCloud();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMLManager::finishSetup()
|
void QMLManager::finishSetup()
|
||||||
|
@ -716,10 +715,18 @@ bool QMLManager::loadFromCloud() const
|
||||||
return m_loadFromCloud;
|
return m_loadFromCloud;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QMLManager::syncLoadFromCloud()
|
||||||
|
{
|
||||||
|
QSettings s;
|
||||||
|
QString cloudMarker = QLatin1Literal("loadFromCloud") + QString(prefs.cloud_storage_email);
|
||||||
|
m_loadFromCloud = s.contains(cloudMarker) && s.value(cloudMarker).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
void QMLManager::setLoadFromCloud(bool done)
|
void QMLManager::setLoadFromCloud(bool done)
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.setValue("loadFromCloud", 1);
|
QString cloudMarker = QLatin1Literal("loadFromCloud") + QString(prefs.cloud_storage_email);
|
||||||
|
s.setValue(cloudMarker, done);
|
||||||
m_loadFromCloud = done;
|
m_loadFromCloud = done;
|
||||||
emit loadFromCloudChanged();
|
emit loadFromCloudChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public:
|
||||||
|
|
||||||
bool loadFromCloud() const;
|
bool loadFromCloud() const;
|
||||||
void setLoadFromCloud(bool done);
|
void setLoadFromCloud(bool done);
|
||||||
|
void syncLoadFromCloud();
|
||||||
|
|
||||||
QString startPageText() const;
|
QString startPageText() const;
|
||||||
void setStartPageText(const QString& text);
|
void setStartPageText(const QString& text);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue