Commit 43ce7c73 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Remove unneeded scope

parent a5c43dd9
Pipeline #194490 passed with stage
in 3 minutes and 34 seconds
......@@ -141,37 +141,35 @@ void ModemMonitor::requestPin(MMModemLock lock)
qCDebug(PLASMA_NM_KDED_LOG) << "Sending unlock code";
{
ModemManager::Sim::Ptr sim;
ModemManager::ModemDevice::Ptr modemDevice = ModemManager::findModemDevice(modem->uni());
if (modemDevice && modemDevice->sim()) {
sim = modemDevice->sim();
}
if (!sim) {
return;
}
ModemManager::Sim::Ptr sim;
ModemManager::ModemDevice::Ptr modemDevice = ModemManager::findModemDevice(modem->uni());
if (modemDevice && modemDevice->sim()) {
sim = modemDevice->sim();
}
QDBusPendingCallWatcher *watcher = nullptr;
PinDialog::Type type = d->dialog.data()->type();
if (type == PinDialog::SimPin || type == PinDialog::SimPin2 //
|| type == PinDialog::ModemServiceProviderPin || type == PinDialog::ModemNetworkPin //
|| type == PinDialog::ModemPin || type == PinDialog::ModemCorporatePin //
|| type == PinDialog::ModemPhFsimPin || type == PinDialog::ModemNetworkSubsetPin) {
QDBusPendingCall reply = sim->sendPin(d->dialog.data()->pin());
watcher = new QDBusPendingCallWatcher(reply, sim.data());
} else if (type == PinDialog::SimPuk //
|| type == PinDialog::SimPuk2 || type == PinDialog::ModemServiceProviderPuk //
|| type == PinDialog::ModemNetworkPuk || type == PinDialog::ModemCorporatePuk //
|| type == PinDialog::ModemPhFsimPuk || type == PinDialog::ModemNetworkSubsetPuk) {
QDBusPendingCall reply = sim->sendPuk(d->dialog.data()->puk(), d->dialog.data()->pin());
watcher = new QDBusPendingCallWatcher(reply, sim.data());
}
if (!sim) {
return;
}
connect(watcher, &QDBusPendingCallWatcher::finished, this, &ModemMonitor::onSendPinArrived);
QDBusPendingCallWatcher *watcher = nullptr;
PinDialog::Type type = d->dialog.data()->type();
if (type == PinDialog::SimPin || type == PinDialog::SimPin2 //
|| type == PinDialog::ModemServiceProviderPin || type == PinDialog::ModemNetworkPin //
|| type == PinDialog::ModemPin || type == PinDialog::ModemCorporatePin //
|| type == PinDialog::ModemPhFsimPin || type == PinDialog::ModemNetworkSubsetPin) {
QDBusPendingCall reply = sim->sendPin(d->dialog.data()->pin());
watcher = new QDBusPendingCallWatcher(reply, sim.data());
} else if (type == PinDialog::SimPuk //
|| type == PinDialog::SimPuk2 || type == PinDialog::ModemServiceProviderPuk //
|| type == PinDialog::ModemNetworkPuk || type == PinDialog::ModemCorporatePuk //
|| type == PinDialog::ModemPhFsimPuk || type == PinDialog::ModemNetworkSubsetPuk) {
QDBusPendingCall reply = sim->sendPuk(d->dialog.data()->puk(), d->dialog.data()->pin());
watcher = new QDBusPendingCallWatcher(reply, sim.data());
}
connect(watcher, &QDBusPendingCallWatcher::finished, this, &ModemMonitor::onSendPinArrived);
}
void ModemMonitor::onSendPinArrived(QDBusPendingCallWatcher *watcher)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment