Skip to content

Commit c2f86ea

Browse files
committed
* fix install and upgrade handling
1 parent e43cb7e commit c2f86ea

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

Src/devicebridge_installer.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,16 +334,21 @@ void DeviceBridge::install_app(instproxy_client_t& installer, afc_client_t &afc,
334334
emit InstallerStatusChanged(InstallerMode::CMD_INSTALL, bundleidentifier, 51, "Installing " + QString(bundleidentifier));
335335
instproxy_install(installer, pkgname.toUtf8().data(), client_opts, InstallerCallback, NULL);
336336
} else {
337-
emit InstallerStatusChanged(InstallerMode::CMD_INSTALL, bundleidentifier, 51, "Upgrading " + QString(bundleidentifier));
337+
emit InstallerStatusChanged(InstallerMode::CMD_UPGRADE, bundleidentifier, 51, "Upgrading " + QString(bundleidentifier));
338338
instproxy_upgrade(installer, pkgname.toUtf8().data(), client_opts, InstallerCallback, NULL);
339339
}
340340
instproxy_client_options_free(client_opts);
341341
}
342342

343343
void DeviceBridge::TriggetInstallerStatus(QJsonDocument command, QJsonDocument status)
344344
{
345-
InstallerMode pCommand = command["Command"].toString() == "Install" ? InstallerMode::CMD_INSTALL : InstallerMode::CMD_UNINSTALL;
346-
QString pBundleId = pCommand == InstallerMode::CMD_INSTALL ? command["ClientOptions"]["CFBundleIdentifier"].toString() : command["ApplicationIdentifier"].toString();
345+
InstallerMode pCommand = InstallerMode::CMD_UNINSTALL;
346+
if (command["Command"].toString() == "Install")
347+
pCommand = InstallerMode::CMD_INSTALL;
348+
else if (command["Command"].toString() == "Upgrade")
349+
pCommand = InstallerMode::CMD_UPGRADE;
350+
351+
QString pBundleId = pCommand == InstallerMode::CMD_UNINSTALL ? command["ApplicationIdentifier"].toString() : command["ClientOptions"]["CFBundleIdentifier"].toString();
347352

348353
int percentage = 0;
349354
QString pMessage = status["Status"].toString();

Src/mainwindow_appmanager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void MainWindow::OnInstallerStatusChanged(InstallerMode command, QString bundleI
3333
{
3434
switch (command)
3535
{
36+
case InstallerMode::CMD_UPGRADE:
3637
case InstallerMode::CMD_INSTALL:
3738
{
3839
QString messages = (percentage >= 0 ? ("(" + QString::number(percentage) + "%) ") : "") + message;

0 commit comments

Comments
 (0)