aboutsummaryrefslogtreecommitdiff
path: root/smartpenmanager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'smartpenmanager.cc')
-rw-r--r--smartpenmanager.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/smartpenmanager.cc b/smartpenmanager.cc
index 1750589..0ac56e2 100644
--- a/smartpenmanager.cc
+++ b/smartpenmanager.cc
@@ -65,7 +65,7 @@ QStringList SmartpenManager::pensBeingSynchronized() const
QString name = it.value()->penName();
if (name.isEmpty()) {
Smartpen::Address addr = it.value()->penAddress();
- name = QString("%1-%2").arg(addr.first, addr.second);
+ name = QString("%1-%2").arg(addr.first).arg(addr.second);
}
pens.append(name);
}
@@ -89,10 +89,20 @@ void SmartpenManager::handleSyncerFinished()
{
SmartpenSyncer *syncer = static_cast<SmartpenSyncer*>(sender());
Smartpen::Address addr = syncer->penAddress();
+
qDebug() << "Finished synchronization with pen with address:" << addr;
+
_syncers.remove(addr);
- syncer->deleteLater();
emit pensBeingSynchronizedChanged();
+
+ if (syncer->hasErrors()) {
+ qWarning() << "Synchronization with address" << addr << "failed";
+ emit syncFailed(syncer->penName());
+ } else {
+ emit syncComplete(syncer->penName());
+ }
+
+ syncer->deleteLater();
}
void SmartpenManager::processDevice(udev_device *dev)