Commit bfd68e55 authored by Allen Winter's avatar Allen Winter
Browse files

koeventpopupmenu.cpp - remove last traces of KOrg dependency

now I can move the menu to eventviews and use it in
other applications, not just Korganizer.
parent a50b49a9
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "koeventpopupmenu.h" #include "koeventpopupmenu.h"
#include "korganizer_debug.h" #include "korganizer_debug.h"
#include "actionmanager.h" // needed for finding the schedule_forward action
#include <AkonadiCore/ItemCreateJob> #include <AkonadiCore/ItemCreateJob>
#include <Akonadi/Notes/NoteUtils> #include <Akonadi/Notes/NoteUtils>
...@@ -34,8 +33,6 @@ ...@@ -34,8 +33,6 @@
#include <CalendarSupport/NoteEditDialog> #include <CalendarSupport/NoteEditDialog>
#include <CalendarSupport/Utils> #include <CalendarSupport/Utils>
#include <KActionCollection> // needed for finding the schedule_forward action
#include <KCalendarCore/CalFormat> #include <KCalendarCore/CalFormat>
#include <IncidenceEditor/IncidenceDialog> #include <IncidenceEditor/IncidenceDialog>
...@@ -148,7 +145,6 @@ void KOEventPopupMenu::appendReminderOnlyItems() ...@@ -148,7 +145,6 @@ void KOEventPopupMenu::appendReminderOnlyItems()
mToggleReminder = addAction(QIcon::fromTheme(QStringLiteral("appointment-reminder")), mToggleReminder = addAction(QIcon::fromTheme(QStringLiteral("appointment-reminder")),
i18nc("@action:inmenu", "&Toggle Reminder"), i18nc("@action:inmenu", "&Toggle Reminder"),
this, &KOEventPopupMenu::toggleAlarm); this, &KOEventPopupMenu::toggleAlarm);
mReminderOnlyItems.append(mToggleReminder); mReminderOnlyItems.append(mToggleReminder);
} }
...@@ -249,6 +245,7 @@ void KOEventPopupMenu::showIncidencePopup(const Akonadi::Item &item, const QDate ...@@ -249,6 +245,7 @@ void KOEventPopupMenu::showIncidencePopup(const Akonadi::Item &item, const QDate
(*it)->setEnabled(true); (*it)->setEnabled(true);
} }
// Show the menu now
popup(QCursor::pos()); popup(QCursor::pos());
} }
...@@ -332,17 +329,13 @@ void KOEventPopupMenu::dissociateOccurrences() ...@@ -332,17 +329,13 @@ void KOEventPopupMenu::dissociateOccurrences()
void KOEventPopupMenu::forward() void KOEventPopupMenu::forward()
{ {
KOrg::MainWindow *w = ActionManager::findInstance(QUrl()); if (CalendarSupport::hasIncidence(mCurrentIncidence)) {
if (!w || !CalendarSupport::hasIncidence(mCurrentIncidence)) { KCalendarCore::Incidence::Ptr incidence = CalendarSupport::incidence(mCurrentIncidence);
return; if (incidence) {
} Akonadi::ITIPHandler handler(this);
handler.setCalendar(mCalendar);
KActionCollection *ac = w->getActionCollection(); handler.sendAsICalendar(incidence, this);
QAction *action = ac->action(QStringLiteral("schedule_forward")); }
if (action) {
action->trigger();
} else {
qCCritical(KORGANIZER_LOG) << "What happened to the schedule_forward action?";
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment