aboutsummaryrefslogtreecommitdiff
path: root/smartpensyncer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'smartpensyncer.cc')
-rw-r--r--smartpensyncer.cc9
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;
}