Commit e9138a62 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization. Avoid qtc warning

parent ecaad047
......@@ -21,8 +21,6 @@
#include <KMime/ContentIndex>
SemanticMemento::~SemanticMemento() = default;
void SemanticMemento::detach()
{
}
......
......@@ -34,7 +34,7 @@ class ContentIndex;
class SemanticMemento : public MimeTreeParser::Interface::BodyPartMemento
{
public:
~SemanticMemento();
~SemanticMemento() = default;
void detach() override;
bool isEmpty() const;
......
......@@ -43,9 +43,6 @@
#include <memory>
SemanticUrlHandler::SemanticUrlHandler() = default;
SemanticUrlHandler::~SemanticUrlHandler() = default;
bool SemanticUrlHandler::handleClick(MessageViewer::Viewer *viewerInstance, MimeTreeParser::Interface::BodyPart *part, const QString &path) const
{
Q_UNUSED(viewerInstance);
......@@ -67,7 +64,7 @@ bool SemanticUrlHandler::handleContextMenuRequest(MimeTreeParser::Interface::Bod
const auto date = dateForReservation(m);
QMenu menu;
QAction *action;
QAction *action = nullptr;
if (date.isValid()) {
action = menu.addAction(QIcon::fromTheme(QStringLiteral("view-calendar")), i18n("Show Calendar"));
QObject::connect(action, &QAction::triggered, this, [this, date](){
......@@ -181,11 +178,12 @@ void SemanticUrlHandler::showCalendar(const QDate &date) const
KCalCore::Event::Ptr SemanticUrlHandler::eventForReservation(const QVariant &reservation) const
{
if (reservation.userType() == qMetaTypeId<FlightReservation>()) {
const int reservationId = reservation.userType();
if (reservationId == qMetaTypeId<FlightReservation>()) {
return eventForFlightReservation(reservation);
} else if (reservation.userType() == qMetaTypeId<LodgingReservation>()) {
} else if (reservationId == qMetaTypeId<LodgingReservation>()) {
return eventForLodgingReservation(reservation);
} else if (reservation.userType() == qMetaTypeId<TrainReservation>()) {
} else if (reservationId == qMetaTypeId<TrainReservation>()) {
return eventForTrainReservation(reservation);
}
return {};
......
......@@ -33,8 +33,8 @@ class SemanticUrlHandler : public QObject, public MessageViewer::Interface::Body
{
Q_OBJECT
public:
SemanticUrlHandler();
~SemanticUrlHandler();
SemanticUrlHandler() = default;
~SemanticUrlHandler() = default;
bool handleClick(MessageViewer::Viewer *viewerInstance, MimeTreeParser::Interface::BodyPart *part, const QString &path) const override;
bool handleContextMenuRequest(MimeTreeParser::Interface::BodyPart *part, const QString &path, const QPoint &p) const override;
......
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