Commit 48400d2a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor

parent d99fb0e3
...@@ -72,5 +72,5 @@ Akonadi::CalendarBase::Ptr MemoryCalendarMemento::calendar() const ...@@ -72,5 +72,5 @@ Akonadi::CalendarBase::Ptr MemoryCalendarMemento::calendar() const
void MemoryCalendarMemento::detach() void MemoryCalendarMemento::detach()
{ {
disconnect(this, &MemoryCalendarMemento::update, 0, 0); disconnect(this, &MemoryCalendarMemento::update, nullptr, nullptr);
} }
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
using namespace Akonadi; using namespace Akonadi;
SyncItipHandler::SyncItipHandler(const QString &receiver, const QString &iCal, const QString &type, const Akonadi::CalendarBase::Ptr &calendar, QObject *parent) : QObject(parent) SyncItipHandler::SyncItipHandler(const QString &receiver, const QString &iCal, const QString &type, const Akonadi::CalendarBase::Ptr &calendar, QObject *parent)
: QObject(parent)
, m_result(Akonadi::ITIPHandler::ResultSuccess) , m_result(Akonadi::ITIPHandler::ResultSuccess)
{ {
Q_ASSERT(calendar); Q_ASSERT(calendar);
......
...@@ -296,7 +296,7 @@ public: ...@@ -296,7 +296,7 @@ public:
Attendee::Ptr findMyself(const Incidence::Ptr &incidence, const QString &receiver) const Attendee::Ptr findMyself(const Incidence::Ptr &incidence, const QString &receiver) const
{ {
Attendee::List attendees = incidence->attendees(); const Attendee::List attendees = incidence->attendees();
Attendee::List::ConstIterator it; Attendee::List::ConstIterator it;
Attendee::Ptr myself; Attendee::Ptr myself;
// Find myself. There will always be all attendees listed, even if // Find myself. There will always be all attendees listed, even if
...@@ -317,7 +317,7 @@ public: ...@@ -317,7 +317,7 @@ public:
static bool heuristicalRSVP(const Incidence::Ptr &incidence) static bool heuristicalRSVP(const Incidence::Ptr &incidence)
{ {
bool rsvp = true; // better send superfluously than not at all bool rsvp = true; // better send superfluously than not at all
Attendee::List attendees = incidence->attendees(); const Attendee::List attendees = incidence->attendees();
Attendee::List::ConstIterator it; Attendee::List::ConstIterator it;
Attendee::List::ConstIterator end(attendees.constEnd()); Attendee::List::ConstIterator end(attendees.constEnd());
for (it = attendees.constBegin(); it != end; ++it) { for (it = attendees.constBegin(); it != end; ++it) {
...@@ -336,7 +336,7 @@ public: ...@@ -336,7 +336,7 @@ public:
static Attendee::Role heuristicalRole(const Incidence::Ptr &incidence) static Attendee::Role heuristicalRole(const Incidence::Ptr &incidence)
{ {
Attendee::Role role = Attendee::OptParticipant; Attendee::Role role = Attendee::OptParticipant;
Attendee::List attendees = incidence->attendees(); const Attendee::List attendees = incidence->attendees();
Attendee::List::ConstIterator it; Attendee::List::ConstIterator it;
Attendee::List::ConstIterator end = attendees.constEnd(); Attendee::List::ConstIterator end = attendees.constEnd();
...@@ -715,15 +715,17 @@ public: ...@@ -715,15 +715,17 @@ public:
// If result is ResultCancelled, then we don't show the message box and return false so kmail // If result is ResultCancelled, then we don't show the message box and return false so kmail
// doesn't delete the e-mail. // doesn't delete the e-mail.
qCDebug(TEXT_CALENDAR_LOG) << "ITIPHandler result was " << itipHandler->result(); qCDebug(TEXT_CALENDAR_LOG) << "ITIPHandler result was " << itipHandler->result();
if (itipHandler->result() == Akonadi::ITIPHandler::ResultError) { const Akonadi::ITIPHandler::Result res = itipHandler->result();
if (res == Akonadi::ITIPHandler::ResultError) {
const QString errorMessage = itipHandler->errorMessage(); const QString errorMessage = itipHandler->errorMessage();
if (!errorMessage.isEmpty()) { if (!errorMessage.isEmpty()) {
qCCritical(TEXT_CALENDAR_LOG) << "Error while processing invitation: " << errorMessage; qCCritical(TEXT_CALENDAR_LOG) << "Error while processing invitation: " << errorMessage;
KMessageBox::error(nullptr, errorMessage); KMessageBox::error(nullptr, errorMessage);
} }
return false;
} }
return itipHandler->result() == Akonadi::ITIPHandler::ResultSuccess; return res;
} }
bool cancelPastInvites(const Incidence::Ptr incidence, const QString &path) const bool cancelPastInvites(const Incidence::Ptr incidence, const QString &path) const
...@@ -933,7 +935,7 @@ public: ...@@ -933,7 +935,7 @@ public:
// find our delegator, we need to inform him as well // find our delegator, we need to inform him as well
QString delegator; QString delegator;
if (status != Attendee::NeedsAction && myself && !myself->delegator().isEmpty()) { if (status != Attendee::NeedsAction && myself && !myself->delegator().isEmpty()) {
Attendee::List attendees = incidence->attendees(); const Attendee::List attendees = incidence->attendees();
Attendee::List::ConstIterator end = attendees.constEnd(); Attendee::List::ConstIterator end = attendees.constEnd();
for (Attendee::List::ConstIterator it = attendees.constBegin(); for (Attendee::List::ConstIterator it = attendees.constBegin();
it != end; ++it) { it != end; ++it) {
...@@ -1022,7 +1024,7 @@ public: ...@@ -1022,7 +1024,7 @@ public:
QDesktopServices::openUrl(QUrl(attachment->uri())); QDesktopServices::openUrl(QUrl(attachment->uri()));
} else { } else {
// put the attachment in a temporary file and launch it // put the attachment in a temporary file and launch it
QTemporaryFile *file; QTemporaryFile *file{nullptr};
QMimeDatabase db; QMimeDatabase db;
QStringList patterns = db.mimeTypeForName(attachment->mimeType()).globPatterns(); QStringList patterns = db.mimeTypeForName(attachment->mimeType()).globPatterns();
if (!patterns.empty()) { if (!patterns.empty()) {
...@@ -1059,7 +1061,7 @@ public: ...@@ -1059,7 +1061,7 @@ public:
if (saveAsFile.isEmpty() if (saveAsFile.isEmpty()
|| (QFileInfo::exists(saveAsFile) || (QFileInfo::exists(saveAsFile)
&& (KMessageBox::warningContinueCancel( && (KMessageBox::warningContinueCancel(
0, nullptr,
xi18nc("@info", xi18nc("@info",
"File <filename>%1</filename> exists.<nl/> Do you want to replace it?", "File <filename>%1</filename> exists.<nl/> Do you want to replace it?",
saveAsFile)) != KMessageBox::Continue))) { saveAsFile)) != KMessageBox::Continue))) {
...@@ -1073,7 +1075,7 @@ public: ...@@ -1073,7 +1075,7 @@ public:
stat = job->exec(); stat = job->exec();
} else { } else {
// put the attachment in a temporary file and save it // put the attachment in a temporary file and save it
QTemporaryFile *file; QTemporaryFile *file{nullptr};
QMimeDatabase db; QMimeDatabase db;
QStringList patterns = db.mimeTypeForName(a->mimeType()).globPatterns(); QStringList patterns = db.mimeTypeForName(a->mimeType()).globPatterns();
if (!patterns.empty()) { if (!patterns.empty()) {
...@@ -1327,7 +1329,7 @@ public: ...@@ -1327,7 +1329,7 @@ public:
QString summary; QString summary;
int response int response
= KMessageBox::questionYesNoCancel( = KMessageBox::questionYesNoCancel(
0, nullptr,
i18nc("@info", i18nc("@info",
"The organizer is not expecting a reply to this invitation " "The organizer is not expecting a reply to this invitation "
"but you can send them an email message if you desire.\n\n" "but you can send them an email message if you desire.\n\n"
......
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