From ed00382b28bd14285607e2dd9c52d3355cf237ce Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 4 Dec 2017 23:15:47 +0200 Subject: [PATCH] [sharing] Show account icon on sharing list. Contributes to JB#35260 --- lib/transfermethodinfo.cpp | 16 ++++++++++++---- lib/transfermethodinfo.h | 6 ++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/transfermethodinfo.cpp b/lib/transfermethodinfo.cpp index 564159c..7c79cf9 100644 --- a/lib/transfermethodinfo.cpp +++ b/lib/transfermethodinfo.cpp @@ -46,6 +46,7 @@ info.displayName = QLatin1String("Bluetooth"); info.userName = ""; info.accountId = ""; + info.accountIcon = QLatin1String("image://theme/icon-m-bluetooth"); info.methodId = QLatin1String("bluetooth"); info.shareUIPath = SHARE_UI_PATH + QLatin1String("/BluetoothShareUI.qml"); info.capabilitities = capabilities; @@ -75,7 +76,8 @@ TransferMethodInfo::TransferMethodInfo(): methodId(), shareUIPath(), capabilitities(), - accountId() + accountId(), + accountIcon() { } @@ -90,6 +92,7 @@ TransferMethodInfo &TransferMethodInfo::operator=(const TransferMethodInfo &othe shareUIPath = other.shareUIPath; capabilitities = other.capabilitities; accountId = other.accountId; + accountIcon = other.accountIcon; return *this; } @@ -102,7 +105,8 @@ TransferMethodInfo::TransferMethodInfo(const TransferMethodInfo &other): methodId(other.methodId), shareUIPath(other.shareUIPath), capabilitities(other.capabilitities), - accountId(other.accountId) + accountId(other.accountId), + accountIcon(other.accountIcon) { } @@ -126,7 +130,8 @@ QDBusArgument &operator<<(QDBusArgument &argument, const TransferMethodInfo &inf << info.methodId << info.shareUIPath << info.capabilitities - << info.accountId; + << info.accountId + << info.accountIcon; argument.endStructure(); return argument; @@ -143,7 +148,8 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, TransferMethodInf >> info.methodId >> info.shareUIPath >> info.capabilitities - >> info.accountId; + >> info.accountId + >> info.accountIcon; argument.endStructure(); return argument; @@ -176,6 +182,8 @@ QVariant TransferMethodInfo::value(int index) const return capabilitities; case AccountId: return accountId; + case AccountIcon: + return accountIcon; default: return QVariant(); } diff --git a/lib/transfermethodinfo.h b/lib/transfermethodinfo.h index dbc96ee..c5d8b90 100644 --- a/lib/transfermethodinfo.h +++ b/lib/transfermethodinfo.h @@ -39,8 +39,9 @@ class TransferMethodInfo enum TransferMethodInfoField { DisplayName, // e.g. Facebook UserName, // e.g. mike.myers@gmail.com - MethodId, // Id of the plugin - AccountId, // Id the account, needed in a case of multiple accounts + MethodId, // id of the plugin + AccountId, // id the account, needed in a case of multiple accounts + AccountIcon, // account icon source ShareUIPath, // path to the share ui QML plugin Capabilities // list of supported mimetypes }; @@ -64,6 +65,7 @@ class TransferMethodInfo QString shareUIPath; QStringList capabilitities; quint32 accountId; + QString accountIcon; }; #endif // TRANSFERMETHODINFO_H