Commit 9afd8099 authored by Sergio Martins's avatar Sergio Martins
Browse files

Opening an event editor when double clicking a reminder works again.

It was broken somewhen during the akonadi port.
Now korgac links directly to libincidenceeditors, no need to start korganizer.

CCMAIL: adam@kde.org
Till, As usual, please test the mac build
parent bf95d1eb
......@@ -71,6 +71,7 @@ target_link_libraries(korgac
${KDEPIMLIBS_KCALUTILS_LIBS}
kdepim
kdepimdbusinterfaces
incidenceeditorsng
)
if (RUNTIME_PLUGINS_STATIC)
......
......@@ -34,6 +34,10 @@
#include <calendarsupport/mailclient.h>
#include <calendarsupport/utils.h>
#include <incidenceeditor-ng/incidencedialog.h>
#include <incidenceeditor-ng/incidencedialogfactory.h>
#include <incidenceeditor-ng/groupwareintegration.h>
#include <KCalCore/Event>
#include <KCalCore/Todo>
#include <KCalUtils/IncidenceFormatter>
......@@ -419,7 +423,11 @@ void AlarmDialog::edit()
return;
}
openEditorThroughKOrganizer( incidence );
#ifndef KDEPIM_MOBILE_UI
openIncidenceEditorNG( selection.first()->mIncidence );
#else
openIncidenceEditorThroughKOrganizer( incidence );
#endif
}
void AlarmDialog::suspend()
......@@ -848,7 +856,7 @@ void AlarmDialog::keyPressEvent( QKeyEvent *e )
KDialog::keyPressEvent( e );
}
bool AlarmDialog::openEditorThroughKOrganizer( const Incidence::Ptr &incidence )
bool AlarmDialog::openIncidenceEditorThroughKOrganizer( const Incidence::Ptr &incidence )
{
if ( !QDBusConnection::sessionBus().interface()->isServiceRegistered( "org.kde.korganizer" ) ) {
if ( KToolInvocation::startServiceByDesktopName( "korganizer", QString() ) ) {
......@@ -903,4 +911,17 @@ bool AlarmDialog::openEditorThroughKOrganizer( const Incidence::Ptr &incidence )
return true;
}
bool AlarmDialog::openIncidenceEditorNG( const Akonadi::Item &item )
{
if ( !IncidenceEditorNG::GroupwareIntegration::isActive() ) {
//TODO: Why do we need this to have a simple editor?
IncidenceEditorNG::GroupwareIntegration::activate( mCalendar );
}
Incidence::Ptr incidence = CalendarSupport::incidence( item );
IncidenceEditorNG::IncidenceDialog *dialog = IncidenceEditorNG::IncidenceDialogFactory::create( false/*doesn't need initial saving*/,
incidence->type(), this );
dialog->load( item );
return true;
}
#include "alarmdialog.moc"
......@@ -101,7 +101,12 @@ class AlarmDialog : public KDialog
static KDateTime triggerDateForIncidence( const KCalCore::Incidence::Ptr &inc,
const QDateTime &reminderAt,
QString &displayStr );
bool openEditorThroughKOrganizer( const KCalCore::Incidence::Ptr &incidence );
// Opens through dbus, @deprecated
bool openIncidenceEditorThroughKOrganizer( const KCalCore::Incidence::Ptr &incidence );
// opens directly
bool openIncidenceEditorNG( const Akonadi::Item &incidence );
bool startKOrganizer();
ReminderListItem *searchByItem( const Akonadi::Item &incidence );
......
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