Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sharing] Show account icon on sharing list. Contributes to JB#35260
  • Loading branch information
Joona Petrell committed Dec 4, 2017
1 parent e880654 commit ed00382
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 12 additions & 4 deletions lib/transfermethodinfo.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -75,7 +76,8 @@ TransferMethodInfo::TransferMethodInfo():
methodId(),
shareUIPath(),
capabilitities(),
accountId()
accountId(),
accountIcon()
{
}

Expand All @@ -90,6 +92,7 @@ TransferMethodInfo &TransferMethodInfo::operator=(const TransferMethodInfo &othe
shareUIPath = other.shareUIPath;
capabilitities = other.capabilitities;
accountId = other.accountId;
accountIcon = other.accountIcon;
return *this;
}

Expand All @@ -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)
{

}
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -176,6 +182,8 @@ QVariant TransferMethodInfo::value(int index) const
return capabilitities;
case AccountId:
return accountId;
case AccountIcon:
return accountIcon;
default:
return QVariant();
}
Expand Down
6 changes: 4 additions & 2 deletions lib/transfermethodinfo.h
Expand Up @@ -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
};
Expand All @@ -64,6 +65,7 @@ class TransferMethodInfo
QString shareUIPath;
QStringList capabilitities;
quint32 accountId;
QString accountIcon;
};

#endif // TRANSFERMETHODINFO_H

0 comments on commit ed00382

Please sign in to comment.