diff options
author | Javier <dev.git@javispedro.com> | 2015-06-14 17:17:12 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-06-14 17:17:12 +0200 |
commit | e3c4aa5dffecc8f62958c44035b2e58de0228eb4 (patch) | |
tree | 8fb5f24098e094fe1f103092c6fed07a116cb91a /smartpensyncer.cc | |
parent | aa2999041d405215d5a7e8c494e276ebbfc089fc (diff) | |
download | scribiu-e3c4aa5dffecc8f62958c44035b2e58de0228eb4.tar.gz scribiu-e3c4aa5dffecc8f62958c44035b2e58de0228eb4.zip |
better synchronization status reporting
Diffstat (limited to 'smartpensyncer.cc')
-rw-r--r-- | smartpensyncer.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/smartpensyncer.cc b/smartpensyncer.cc index 7119812..654b0eb 100644 --- a/smartpensyncer.cc +++ b/smartpensyncer.cc @@ -58,6 +58,11 @@ Smartpen::Address SmartpenSyncer::penAddress() const return _addr; } +QString SmartpenSyncer::penName() const +{ + return _penName; +} + void SmartpenSyncer::abort() { _aborted = true; @@ -73,6 +78,7 @@ void SmartpenSyncer::run() _penName = _pen->getPenName(); qDebug() << "got pen name:" << _penName; + emit penNameChanged(); QVariantMap penInfo = _pen->getPenInfo(); if (penInfo.isEmpty()) { @@ -102,6 +108,8 @@ bool SmartpenSyncer::syncPen() QDateTime lastSyncTime = getTimestampFileDate(_penDataDir.filePath(".lastsync")); QList<Smartpen::ChangeReport> changes = _pen->getChangeList(lastSyncTime); + setTimestampFileDate(_penDataDir.filePath(".sync.lck")); + foreach(const Smartpen::ChangeReport &change, changes) { if (!change.guid.isEmpty()) { qDebug() << "Synchronizing guid: " << change.guid << change.title; @@ -117,6 +125,7 @@ bool SmartpenSyncer::syncPen() } setTimestampFileDate(_penDataDir.filePath(".lastsync")); + removeTimestampFile(_penDataDir.filePath(".sync.lck")); return true; } |