Skip to content

Commit

Permalink
Update for lib changed in Sailfish
Browse files Browse the repository at this point in the history
  • Loading branch information
abranson committed Apr 16, 2021
1 parent 78679e3 commit afafb59
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion rockwork/translations/rockpool_pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@
<message>
<location filename="../qml/pages/LocationPicker.qml" line="14"/>
<source>Cancel</source>
<translation >Cancelar</translation>
<translation>Cancelar</translation>
</message>
<message>
<location filename="../qml/pages/LocationPicker.qml" line="18"/>
Expand Down
22 changes: 11 additions & 11 deletions rockworkd/platformintegration/sailfish/organizeradapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define MANAGER_FALLBACK "memory"

OrganizerAdapter::OrganizerAdapter(QObject *parent) : QObject(parent),
_calendar(new mKCal::ExtendedCalendar(KDateTime::Spec::LocalZone())),
_calendar(new mKCal::ExtendedCalendar(QTimeZone::systemTimeZone())),
_calendarStorage(_calendar->defaultStorage(_calendar)),
_refreshTimer(new QTimer(this))
{
Expand Down Expand Up @@ -97,7 +97,7 @@ void OrganizerAdapter::refresh()
auto events = _calendar->rawExpandedEvents(startDate, endDate, true, true);
for (const auto &expanded : events) {
const QDateTime &start = expanded.first.dtStart;
KCalCore::Incidence::Ptr incidence = expanded.second;
KCalendarCore::Incidence::Ptr incidence = expanded.second;

QJsonObject calPin,pinLayout,actSnooze,actOpen;
QJsonArray reminders,actions;
Expand All @@ -124,12 +124,12 @@ void OrganizerAdapter::refresh()
}
if(m_track.contains(calPin.value("guid").toString())) {
todel.removeAll(calPin.value("guid").toString());
if(m_track.value(calPin.value("guid").toString()).toUtc() == incidence->lastModified().toUtc())
if(m_track.value(calPin.value("guid").toString()).toUTC() == incidence->lastModified().toUTC())
continue;
}
m_track.insert(calPin.value("guid").toString(),incidence->lastModified());
calPin.insert("createTime",incidence->created().toUtc().toString());
calPin.insert("updateTime",incidence->lastModified().toUtc().toString());
calPin.insert("createTime",incidence->created().toUTC().toString());
calPin.insert("updateTime",incidence->lastModified().toUTC().toString());
calPin.insert("time",start.toUTC().toString(Qt::ISODate));
calPin.insert("dataSource",QString("calendarEvent:%1").arg(PlatformInterface::SysID));
if(incidence->hasDuration())
Expand All @@ -148,8 +148,8 @@ void OrganizerAdapter::refresh()
}

QStringList attendees;
foreach (const QSharedPointer<KCalCore::Attendee> attendee, incidence->attendees()) {
attendees.append(attendee->fullName());
foreach (const KCalendarCore::Attendee attendee, incidence->attendees()) {
attendees.append(attendee.fullName());
}
if(!incidence->comments().isEmpty()) {
headings.append("Comments");
Expand All @@ -165,15 +165,15 @@ void OrganizerAdapter::refresh()
}
calPin.insert("layout",pinLayout);

foreach (const QSharedPointer<KCalCore::Alarm> alarm, incidence->alarms()) {
foreach (const QSharedPointer<KCalendarCore::Alarm> alarm, incidence->alarms()) {
if (alarm->enabled()) {
QString reminderTime;
if(alarm->hasStartOffset()) {
reminderTime = start.toUTC().addSecs(alarm->startOffset().asSeconds()).toString(Qt::ISODate);
} else if(alarm->hasTime()) {
reminderTime = incidence->recurs() ?
alarm->nextTime(KDateTime::currentDateTime(KDateTime::Spec::LocalZone()), false).toUtc().toString()
: alarm->time().toUtc().toString();
alarm->nextTime(QDateTime::currentDateTime(), false).toUTC().toString()
: alarm->time().toUTC().toString();
} else {
qDebug() << "Skipping reminder, has no time";
continue;
Expand All @@ -182,7 +182,7 @@ void OrganizerAdapter::refresh()
QJsonObject rem,rLy;
rem.insert("time",reminderTime);
rLy.insert("type",QString("genericReminder"));
rLy.insert("title",(alarm->type() == KCalCore::Alarm::Display) ? alarm->text() : pinLayout.value("title"));
rLy.insert("title",(alarm->type() == KCalendarCore::Alarm::Display) ? alarm->text() : pinLayout.value("title"));
if(pinLayout.contains("locationName"))
rLy.insert("locationName",pinLayout.value("locationName"));
rLy.insert("tinyIcon",QString("system://images/NOTIFICATION_REMINDER"));
Expand Down
2 changes: 1 addition & 1 deletion rockworkd/platformintegration/sailfish/organizeradapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private slots:
private:
QString normalizeCalendarName(QString name);
void setSchedule(int interval);
QHash<QString,KDateTime> m_track;
QHash<QString,QDateTime> m_track;
bool m_disabled = false;
mKCal::ExtendedCalendar::Ptr _calendar;
mKCal::ExtendedStorage::Ptr _calendarStorage;
Expand Down
4 changes: 2 additions & 2 deletions rockworkd/rockworkd.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ CONFIG += link_pkgconfig
INCLUDEPATH += $$[QT_HOST_PREFIX]/include/quazip/
LIBS += -lquazip5

PKGCONFIG += qt5-boostable libmkcal-qt5 libkcalcoren-qt5 dbus-1 mpris-qt5 timed-qt5 Qt5WebSockets
INCLUDEPATH += /usr/include/mkcal-qt5 /usr/include/kcalcoren-qt5
PKGCONFIG += qt5-boostable libmkcal-qt5 KF5CalendarCore dbus-1 mpris-qt5 timed-qt5 Qt5WebSockets
#INCLUDEPATH += /usr/include/mkcal-qt5 /usr/include/kcalcoren-qt5

SOURCES += main.cpp \
libpebble/watchconnection.cpp \
Expand Down
2 changes: 1 addition & 1 deletion rpm/rockpool.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BuildRequires: pkgconfig(sailfishapp) >= 0.0.10
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libmkcal-qt5)
BuildRequires: pkgconfig(libkcalcoren-qt5)
BuildRequires: pkgconfig(KF5CalendarCore)
BuildRequires: quazip-devel
BuildRequires: desktop-file-utils
BuildRequires: qt5-qttools-linguist
Expand Down

0 comments on commit afafb59

Please sign in to comment.