Use the icon for the device, in the file item actions

This way, we have visual information of what type of file we're sending it
to.
This commit is contained in:
Aleix Pol 2014-06-14 19:10:20 +02:00
parent b7420146eb
commit 9459001fbe

View file

@ -54,7 +54,7 @@ QList<QAction*> SendFileItemAction::actions(const KFileItemListProperties& fileI
QModelIndex idx = m.index(i);
DeviceDbusInterface* dev = m.getDevice(idx);
if(dev->isReachable() && dev->isPaired()) {
QAction* action = new QAction(dev->name(), parentWidget);
QAction* action = new QAction(QIcon::fromTheme(dev->iconName()), dev->name(), parentWidget);
action->setProperty("id", idx.data(DevicesModel::IdModelRole));
action->setProperty("urls", QVariant::fromValue(fileItemInfos.urlList()));
action->setProperty("parentWidget", QVariant::fromValue(parentWidget));
@ -71,7 +71,6 @@ QList<QAction*> SendFileItemAction::actions(const KFileItemListProperties& fileI
} else {
if(actions.count() == 1) {
actions.first()->setText(i18n("Send to '%1' via KDE Connect", actions.first()->text()));
actions.first()->setIcon(QIcon::fromTheme("preferences-system-network"));
}
return actions;
}