aboutsummaryrefslogtreecommitdiff
path: root/smartpensyncer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'smartpensyncer.cc')
-rw-r--r--smartpensyncer.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/smartpensyncer.cc b/smartpensyncer.cc
index 794b7c5..3556f77 100644
--- a/smartpensyncer.cc
+++ b/smartpensyncer.cc
@@ -181,6 +181,12 @@ void SmartpenSyncer::run()
_penName = _pen->getPenName();
qDebug() << "got pen name:" << _penName;
+
+ if (_penName.isEmpty()) {
+ _penName = _pen->getPenSerial();
+ qDebug() << "pen with no name, using pen serial instead:" << _penName;
+ }
+
emit gotPenName(_penName);
QVariantMap penInfo = _pen->getPenInfo();
@@ -222,11 +228,11 @@ bool SmartpenSyncer::syncPen()
// Get the current user time offset from the pen
// and store it so that we have it even when the pen is offline
TimestampFile userTimeFile(_penDataDir.filePath(PEN_USER_TIME_FILE));
- Smartpen::PenTime userTime = _pen->getPenTime(Smartpen::PenUserTime);
+ Smartpen::PenTime userTime = _pen->getPenTime(Smartpen::Parameter::UserTime);
userTimeFile.set(userTime);
qDebug() << "pen time base:" << userTime << Smartpen::fromPenTime(userTime, 0);
- Smartpen::PenTime penTime = _pen->getPenTime(Smartpen::PenRtcTime);
+ Smartpen::PenTime penTime = _pen->getPenTime(Smartpen::Parameter::RtcTime);
qDebug() << "pen current time:" << penTime << Smartpen::fromPenTime(userTime, penTime);
// Read when is the last time we synchronized with this pen (in PenTime, not user time)