Skip to content

Commit

Permalink
[mkcal] Properly save alarm when using 0 offset. Fixes TJC#219642
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaliste committed Jan 3, 2020
1 parent 65a681c commit dcf44d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sqliteformat.cpp
Expand Up @@ -753,14 +753,14 @@ bool SqliteFormat::Private::modifyAlarm(int rowid, Alarm::Ptr alarm,
sqlite3_bind_int(stmt, index, 0);
}

if (alarm->startOffset().value()) {
if (alarm->hasStartOffset()) {
sqlite3_bind_int(stmt, index, alarm->startOffset().asSeconds());
relation = QString("startTriggerRelation").toUtf8();
sqlite3_bind_text(stmt, index, relation.constData(), relation.length(), SQLITE_STATIC);
sqlite3_bind_int(stmt, index, 0); // time
sqlite3_bind_int(stmt, index, 0); // localtime
sqlite3_bind_text(stmt, index, "", 0, SQLITE_STATIC);
} else if (alarm->endOffset().value()) {
} else if (alarm->hasEndOffset()) {
sqlite3_bind_int(stmt, index, alarm->endOffset().asSeconds());
relation = QString("endTriggerRelation").toUtf8();
sqlite3_bind_text(stmt, index, relation.constData(), relation.length(), SQLITE_STATIC);
Expand Down

0 comments on commit dcf44d3

Please sign in to comment.