Commit 025365a9 authored by David Jarvie's avatar David Jarvie
Browse files

Remove unnecessary invocation of kmail

It doesn't need to be started before using its service.
parent 24c4e2a2
Pipeline #166017 passed with stage
in 3 minutes and 29 seconds
......@@ -115,15 +115,11 @@ struct UpdateStatusData
}
};
const QLatin1String KMAIL_DBUS_SERVICE("org.kde.kmail");
//const QLatin1String KMAIL_DBUS_IFACE("org.kde.kmail.kmail");
//const QLatin1String KMAIL_DBUS_WINDOW_PATH("/kmail/kmail_mainwindow_1");
const QLatin1String KORG_DBUS_SERVICE("org.kde.korganizer");
const QLatin1String KORG_DBUS_IFACE("org.kde.korganizer.Korganizer");
// D-Bus object path of KOrganizer's notification interface
#define KORG_DBUS_PATH "/Korganizer"
#define KORG_DBUS_LOAD_PATH "/korganizer_PimApplication"
//const QLatin1String KORG_DBUS_WINDOW_PATH("/korganizer/MainWindow_1");
const QLatin1String KORG_MIME_TYPE("application/x-vnd.akonadi.calendar.event");
const QLatin1String KORGANIZER_UID("korg-");
......@@ -1664,28 +1660,6 @@ void refreshAlarmsIfQueued()
}
}
/******************************************************************************
* Start KMail if it isn't already running, optionally minimised.
* Reply = reason for failure to run KMail
* = null string if success.
*/
QString runKMail()
{
const QDBusReply<bool> reply = QDBusConnection::sessionBus().interface()->isServiceRegistered(KMAIL_DBUS_SERVICE);
if (!reply.isValid() || !reply.value())
{
// Program is not already running, so start it
const QDBusReply<void> startReply = QDBusConnection::sessionBus().interface()->startService(KMAIL_DBUS_SERVICE);
if (!startReply.isValid())
{
const QString errmsg = startReply.error().message();
qCCritical(KALARM_LOG) << "Couldn't start KMail (" << errmsg << ")";
return xi18nc("@info", "Unable to start <application>KMail</application><nl/>(<message>%1</message>)", errmsg);
}
}
return {};
}
/******************************************************************************
* The "Don't show again" option for error messages is personal to the user on a
* particular computer. For example, he may want to inhibit error messages only
......
......@@ -99,8 +99,6 @@ void outputAlarmWarnings(QWidget* parent, const KAEvent* = nullpt
void refreshAlarms();
void refreshAlarmsIfQueued(); // must only be called from KAlarmApp::processQueue()
QString runKMail();
QStringList dontShowErrors(const EventId&);
bool dontShowErrors(const EventId&, const QString& tag);
void setDontShowErrors(const EventId&, const QStringList& tags = QStringList());
......
......@@ -1096,12 +1096,6 @@ void MessageWindow::slotShowKMailMessage()
qCDebug(KALARM_LOG) << "MessageWindow::slotShowKMailMessage";
if (mEmailId() < 0)
return;
const QString err = KAlarm::runKMail();
if (!err.isNull())
{
KAMessageBox::sorry(this, err);
return;
}
org::kde::kmail::kmail kmail(KMAIL_DBUS_SERVICE, KMAIL_DBUS_PATH, QDBusConnection::sessionBus());
// Display the message contents
QDBusReply<bool> reply = kmail.showMail(mEmailId());
......
Supports Markdown
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