| 258 | } |
| 259 | |
| 260 | void FlatpakPlugin::executeOnRemoteDevice() |
| 261 | { |
| 262 | const auto runtime = qobject_cast<FlatpakRuntime*>(ICore::self()->runtimeController()->currentRuntime()); |
| 263 | Q_ASSERT(runtime); |
| 264 | |
| 265 | KConfigGroup group(KSharedConfig::openConfig(), QStringLiteral("Flatpak")); |
| 266 | const QString lastDeviceAddress = group.readEntry("DeviceAddress"); |
| 267 | const QString host = QInputDialog::getText( |
| 268 | ICore::self()->uiController()->activeMainWindow(), i18nc("@title:window", "Choose Tag Name"), |
| 269 | i18nc("@label:textbox", "Device hostname:"), |
| 270 | QLineEdit::Normal, lastDeviceAddress |
| 271 | ); |
| 272 | if (host.isEmpty()) |
| 273 | return; |
| 274 | group.writeEntry("DeviceAddress", host); |
| 275 | |
| 276 | auto* file = new QTemporaryFile(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + runtime->name() + QLatin1String("XXXXXX.flatpak")); |
| 277 | file->open(); |
| 278 | file->close(); |
| 279 | auto job = runtime->executeOnDevice(host, file->fileName()); |
| 280 | file->setParent(file); |
| 281 | |
| 282 | ICore::self()->runController()->registerJob(job); |
| 283 | } |
| 284 | |
| 285 | #include "flatpakplugin.moc" |
| 286 | #include "moc_flatpakplugin.cpp" |
nothing calls this directly
no test coverage detected