Changeset View
Changeset View
Standalone View
Standalone View
fileitemactionplugin/sendfileitemaction.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 58 | for (const QString& id : devices) { | |||
---|---|---|---|---|---|
67 | action->setProperty("id", id); | 67 | action->setProperty("id", id); | ||
68 | action->setProperty("urls", QVariant::fromValue(fileItemInfos.urlList())); | 68 | action->setProperty("urls", QVariant::fromValue(fileItemInfos.urlList())); | ||
69 | action->setProperty("parentWidget", QVariant::fromValue(parentWidget)); | 69 | action->setProperty("parentWidget", QVariant::fromValue(parentWidget)); | ||
70 | connect(action, &QAction::triggered, this, &SendFileItemAction::sendFile); | 70 | connect(action, &QAction::triggered, this, &SendFileItemAction::sendFile); | ||
71 | actions += action; | 71 | actions += action; | ||
72 | } | 72 | } | ||
73 | 73 | | |||
74 | if (actions.count() > 1) { | 74 | if (actions.count() > 1) { | ||
75 | QAction* menuAction = new QAction(QIcon::fromTheme(QStringLiteral("preferences-system-network")), i18n("Send via KDE Connect"), parentWidget); | 75 | QAction* menuAction = new QAction(QIcon::fromTheme(QStringLiteral("kdeconnect")), i18n("Send via KDE Connect"), parentWidget); | ||
76 | QMenu* menu = new QMenu(parentWidget); | 76 | QMenu* menu = new QMenu(parentWidget); | ||
77 | menu->addActions(actions); | 77 | menu->addActions(actions); | ||
78 | menuAction->setMenu(menu); | 78 | menuAction->setMenu(menu); | ||
79 | return QList<QAction*>() << menuAction; | 79 | return QList<QAction*>() << menuAction; | ||
80 | } else { | 80 | } else { | ||
81 | if(actions.count() == 1) { | 81 | if(actions.count() == 1) { | ||
82 | actions.first()->setText(i18n("Send to '%1' via KDE Connect", actions.first()->text())); | 82 | actions.first()->setText(i18n("Send to '%1' via KDE Connect", actions.first()->text())); | ||
83 | } | 83 | } | ||
Show All 16 Lines |