Commit 26703555 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

USe new kurllabel api

parent 5f919dcb
......@@ -26,7 +26,7 @@
#include "apptsummarywidget.h"
#include "korganizerplugin.h"
#include "summaryeventinfo.h"
#include <kwidgetsaddons_version.h>
#include "korganizerinterface.h"
#include <CalendarSupport/Utils>
......@@ -209,11 +209,19 @@ void ApptSummaryWidget::updateView()
urlLabel->setWordWrap(true);
mLayout->addWidget(urlLabel, counter, 3);
mLabels.append(urlLabel);
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 65, 0)
connect(urlLabel, QOverload<const QString &>::of(
&KUrlLabel::leftClickedUrl), this, &ApptSummaryWidget::viewEvent);
connect(urlLabel, QOverload<const QString &>::of(
&KUrlLabel::rightClickedUrl), this, &ApptSummaryWidget::popupMenu);
#else
connect(urlLabel, &KUrlLabel::leftClickedUrl, this, [this, urlLabel] {
viewEvent(urlLabel->url());
});
connect(urlLabel, &KUrlLabel::rightClickedUrl, this, [this, urlLabel] {
popupMenu(urlLabel->url());
});
#endif
if (!event->summaryTooltip.isEmpty()) {
urlLabel->setToolTip(event->summaryTooltip);
}
......
......@@ -26,7 +26,7 @@
#include "todosummarywidget.h"
#include "todoplugin.h"
#include "korganizerinterface.h"
#include <kwidgetsaddons_version.h>
#include <CalendarSupport/Utils>
#include <CalendarSupport/CalendarSingleton>
......@@ -281,12 +281,19 @@ void TodoSummaryWidget::updateView()
urlLabel->setWordWrap(true);
mLayout->addWidget(urlLabel, counter, 4);
mLabels.append(urlLabel);
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 65, 0)
connect(urlLabel, QOverload<const QString &>::of(
&KUrlLabel::leftClickedUrl), this, &TodoSummaryWidget::viewTodo);
connect(urlLabel, QOverload<const QString &>::of(
&KUrlLabel::rightClickedUrl), this, &TodoSummaryWidget::popupMenu);
#else
connect(urlLabel, &KUrlLabel::leftClickedUrl, this, [this, urlLabel] {
viewTodo(urlLabel->url());
});
connect(urlLabel, &KUrlLabel::rightClickedUrl, this, [this, urlLabel] {
popupMenu(urlLabel->url());
});
#endif
// State text label
str = stateStr(todo);
label = new QLabel(str, this);
......
......@@ -27,6 +27,7 @@
#include "korganizer_kontactplugins_specialdates_debug.h"
#include <KontactInterface/Core>
#include <KontactInterface/Plugin>
#include <kwidgetsaddons_version.h>
#include <CalendarSupport/Utils>
#include <CalendarSupport/CalendarSingleton>
......@@ -561,11 +562,19 @@ void SDSummaryWidget::createLabels()
urlLabel->setWordWrap(true);
mLayout->addWidget(urlLabel, counter, 4);
mLabels.append(urlLabel);
#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 65, 0)
connect(urlLabel, qOverload<const QString &>(&KUrlLabel::leftClickedUrl),
this, &SDSummaryWidget::mailContact);
connect(urlLabel, qOverload<const QString &>(&KUrlLabel::rightClickedUrl),
this, &SDSummaryWidget::popupMenu);
#else
connect(urlLabel, &KUrlLabel::leftClickedUrl, this, [this, urlLabel] {
mailContact(urlLabel->url());
});
connect(urlLabel, &KUrlLabel::rightClickedUrl, this, [this, urlLabel] {
popupMenu(urlLabel->url());
});
#endif
} else {
label = new QLabel(this);
label->setText((*addrIt).summary);
......
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