[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:04:45 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=f854856

The following commit has been merged in the master branch:
commit f8548561bc278d6ea11e44e98040199ebf2f10a9
Author: Anant Kamath <kamathanant at gmail.com>
Date:   Mon Sep 2 05:19:38 2013 +0530

    Check if MM pointers are valid
---
 plugins/pintxo/modem-combobox.cpp | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/plugins/pintxo/modem-combobox.cpp b/plugins/pintxo/modem-combobox.cpp
index 5d997b8..b703e8c 100644
--- a/plugins/pintxo/modem-combobox.cpp
+++ b/plugins/pintxo/modem-combobox.cpp
@@ -28,11 +28,15 @@
 ModemComboBox::ModemComboBox(QWidget* parent) : QComboBox(parent)
 {
     modems = ModemManager::modemInterfaces();
-    Q_FOREACH(ModemManager::ModemInterface::Ptr modem, modems) {
-        ModemManager::ModemGsmCardInterface::Ptr simCard = ModemManager::findModemInterface(modem->udi(), ModemManager::ModemInterface::GsmCard).objectCast<ModemManager::ModemGsmCardInterface>();
-        QString simIdent = simCard->getSimIdentifier();
-        QString spn = simCard->getSpn();
-        addItem(spn.isEmpty() ? QLatin1String("Unknown modem") : spn);
+    if(!modems.isEmpty()) {
+        Q_FOREACH(ModemManager::ModemInterface::Ptr modem, modems) {
+            ModemManager::ModemGsmCardInterface::Ptr simCard = ModemManager::findModemInterface(modem->udi(), ModemManager::ModemInterface::GsmCard).objectCast<ModemManager::ModemGsmCardInterface>();
+            if(!simCard.isNull()) {
+                QString simIdent = simCard->getSimIdentifier();
+                QString spn = simCard->getSpn();
+                addItem(spn.isEmpty() ? QLatin1String("Unknown modem") : spn);
+            }
+        }
     }
 }
 
@@ -43,7 +47,10 @@ ModemComboBox::~ModemComboBox()
 QString ModemComboBox::selectedSimIdentifier()
 {
     ModemManager::ModemGsmCardInterface::Ptr simCard = ModemManager::findModemInterface(modems.at(currentIndex())->udi(), ModemManager::ModemInterface::GsmCard).objectCast<ModemManager::ModemGsmCardInterface>();
-    return simCard->getSimIdentifier();
+    if(!simCard.isNull()) {
+        return simCard->getSimIdentifier();
+    }
+    return QString();
 }
 
 #include "modem-combobox.moc"

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list