[applets/digitalclock] Rename lauchOrganizer to launchCalendar

We want to be able to lauch other services than KOrganizer, so make the name more generic and appropriate
wilder-5.24
Nicolas Fella 4 years ago
parent 57511e183e
commit cc9afb7af2
  1. 4
      applets/digital-clock/package/contents/ui/CalendarView.qml
  2. 12
      applets/digital-clock/plugin/applicationintegration.cpp
  3. 8
      applets/digital-clock/plugin/applicationintegration.h

@ -91,11 +91,11 @@ PlasmaExtras.Representation {
elide: Text.ElideRight
}
PlasmaComponents3.ToolButton {
visible: agenda.visible && ApplicationIntegration.korganizerInstalled
visible: agenda.visible && ApplicationIntegration.calendarInstalled
text: i18nc("@action:button Add event", "Add…")
Layout.rightMargin: calendar.paddings
icon.name: "list-add"
onClicked: ApplicationIntegration.launchKorganizer()
onClicked: ApplicationIntegration.launchCalendar()
}
}
}

@ -6,19 +6,19 @@
ApplicationIntegration::ApplicationIntegration(QObject *parent)
: QObject(parent)
, m_korganizerService(KService::serviceByDesktopName(QStringLiteral("org.kde.korganizer")))
, m_calendarService(KService::serviceByDesktopName(QStringLiteral("org.kde.korganizer")))
{
}
bool ApplicationIntegration::korganizerInstalled() const
bool ApplicationIntegration::calendarInstalled() const
{
return m_korganizerService != nullptr;
return m_calendarService != nullptr;
}
void ApplicationIntegration::launchKorganizer() const
void ApplicationIntegration::launchCalendar() const
{
Q_ASSERT(m_korganizerService);
Q_ASSERT(m_calendarService);
auto job = new KIO::ApplicationLauncherJob(m_korganizerService);
auto job = new KIO::ApplicationLauncherJob(m_calendarService);
job->start();
}

@ -8,15 +8,15 @@
class ApplicationIntegration : public QObject
{
Q_OBJECT
Q_PROPERTY(bool korganizerInstalled READ korganizerInstalled CONSTANT)
Q_PROPERTY(bool calendarInstalled READ calendarInstalled CONSTANT)
public:
explicit ApplicationIntegration(QObject *parent = nullptr);
~ApplicationIntegration() = default;
bool korganizerInstalled() const;
Q_INVOKABLE void launchKorganizer() const;
bool calendarInstalled() const;
Q_INVOKABLE void launchCalendar() const;
private:
KService::Ptr m_korganizerService;
KService::Ptr m_calendarService;
};

Loading…
Cancel
Save