aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilian Wolff <mail@milianw.de>2016-08-21 20:14:38 (GMT)
committerMilian Wolff <mail@milianw.de>2016-08-21 20:14:38 (GMT)
commitb124b0c6482d0f59e1717bdc1dff1e9769856c59 (patch)
tree5de72f5a8e7a188d49ed1b4b2fdb5aca209e4a29
parentf1009a12d38be04bf92d17b161bb5074fcfcba4e (diff)
Use QUrlQuery to access query items.
Fixes compile when deprecated features are disabled
-rw-r--r--src/contactviewer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/contactviewer.cpp b/src/contactviewer.cpp
index 856145e..50ff4ef 100644
--- a/src/contactviewer.cpp
+++ b/src/contactviewer.cpp
@@ -41,6 +41,7 @@
#include <QVBoxLayout>
#include <QIcon>
+#include <QUrlQuery>
#ifdef HAVE_PRISON
#include <prison/Prison>
#include <kcontacts/vcardconverter.h>
@@ -204,26 +205,27 @@ public:
void slotUrlClicked(const QUrl &url)
{
+ const QUrlQuery query(url);
const QString urlScheme(url.scheme());
if (urlScheme == QLatin1String("http") ||
urlScheme == QLatin1String("https")) {
Q_EMIT mParent->urlClicked(url);
} else if (urlScheme == QLatin1String("phone")) {
- const int pos = url.queryItemValue(QStringLiteral("index")).toInt();
+ const int pos = query.queryItemValue(QStringLiteral("index")).toInt();
const KContacts::PhoneNumber::List numbers = mCurrentContact.phoneNumbers();
if (pos < numbers.count()) {
Q_EMIT mParent->phoneNumberClicked(numbers.at(pos));
}
} else if (urlScheme == QLatin1String("sms")) {
- const int pos = url.queryItemValue(QStringLiteral("index")).toInt();
+ const int pos = query.queryItemValue(QStringLiteral("index")).toInt();
const KContacts::PhoneNumber::List numbers = mCurrentContact.phoneNumbers();
if (pos < numbers.count()) {
Q_EMIT mParent->smsClicked(numbers.at(pos));
}
} else if (urlScheme == QLatin1String("address")) {
- const int pos = url.queryItemValue(QStringLiteral("index")).toInt();
+ const int pos = query.queryItemValue(QStringLiteral("index")).toInt();
const KContacts::Address::List addresses = mCurrentContact.addresses();
if (pos < addresses.count()) {