qtmobility/src/systeminfo/qsysteminfo_linux_common.cpp
changeset 8 71781823f776
parent 5 453da2cfceef
child 11 06b8e2af4411
--- a/qtmobility/src/systeminfo/qsysteminfo_linux_common.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/systeminfo/qsysteminfo_linux_common.cpp	Thu May 27 13:42:11 2010 +0300
@@ -113,7 +113,6 @@
         }
     }
 #endif
-  //  qDebug() << "Hal is not running";
     return false;
 }
 
@@ -357,7 +356,7 @@
             const QString versionPath = QLatin1String("/proc/version");
             QFile versionFile(versionPath);
             if(!versionFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                qWarning() << "File not opened";
+                qDebug() << "File not opened";
             } else {
                 QString  strvalue;
                 strvalue = QLatin1String(versionFile.readAll().trimmed());
@@ -507,7 +506,7 @@
                     netname = ssid;
                 }
             } else {
-                qWarning() << "no socket";
+                qDebug() << "no socket";
             }
             close(sock);
         }
@@ -605,7 +604,7 @@
 {
     int ctl = socket(PF_BLUETOOTH,SOCK_RAW,BTPROTO_BNEP);
     if (ctl < 0) {
-        qWarning() << "Cannot open bnep socket";
+        qDebug() << "Cannot open bnep socket";
         return QSystemNetworkInfo::UndefinedStatus;
     }
 
@@ -616,7 +615,7 @@
     req.cnum = 36;
 
     if (ioctl(ctl,BNEPGETCONNLIST,&req) < 0) {
-        qWarning() << "Cannot get bnep connection list.";
+        qDebug() << "Cannot get bnep connection list.";
         return QSystemNetworkInfo::UndefinedStatus;
     }
     for (uint j = 0; j< req.cnum; j++) {
@@ -917,7 +916,7 @@
             float curLevel = 0.0;
             QFile curBrightnessFile(backlightPath+brightnessFileName+"/LCD/brightness");
             if(!curBrightnessFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                qWarning()<<"File not opened";
+                qDebug()<<"File not opened";
             } else {
                 const QString strvalue = curBrightnessFile.readAll().trimmed();
                 if(strvalue.contains("levels")) {
@@ -947,7 +946,7 @@
         float curLevel = 0.0;
         QFile curBrightnessFile(backlightPath+brightnessFileName+"/brightness");
         if(!curBrightnessFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-            qWarning()<<"File not opened";
+            qDebug()<<"File not opened";
         } else {
             QString strvalue;
             strvalue = curBrightnessFile.readLine().trimmed();
@@ -956,7 +955,7 @@
 
             QFile maxBrightnessFile(backlightPath+brightnessFileName+"/max_brightness");
             if(!maxBrightnessFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                qWarning()<<"File not opened";
+                qDebug()<<"File not opened";
             } else {
                 QString strvalue;
                 strvalue = maxBrightnessFile.readLine().trimmed();
@@ -1061,7 +1060,7 @@
 
         QFile file(dmFile);
         if (!file.open(QIODevice::ReadOnly)) {
-            qWarning() << "Could not open sys file";
+            qDebug() << "Could not open sys file";
         } else {
             QTextStream sysinfo(&file);
             QString line = sysinfo.readAll();
@@ -1155,7 +1154,7 @@
                         if(halIfaceDevice->setConnections() ) {
                             if(!connect(halIfaceDevice,SIGNAL(propertyModified(int, QVariantList)),
                                         this,SLOT(halChanged(int,QVariantList)))) {
-                                qWarning() << "connection malfunction";
+                                qDebug() << "connection malfunction";
                             }
                         }
                         break;
@@ -1172,7 +1171,7 @@
                     if(halIfaceDevice->setConnections() ) {
                         if(!connect(halIfaceDevice,SIGNAL(propertyModified(int, QVariantList)),
                                     this,SLOT(halChanged(int,QVariantList)))) {
-                            qWarning() << "connection malfunction";
+                            qDebug() << "connection malfunction";
                         }
                     }
                     break;
@@ -1188,7 +1187,7 @@
                     if(halIfaceDevice->setConnections()) {
                         if(!connect(halIfaceDevice,SIGNAL(propertyModified(int, QVariantList)),
                                     this,SLOT(halChanged(int,QVariantList)))) {
-                            qWarning() << "connection malfunction";
+                            qDebug() << "connection malfunction";
                         }
                     }
                     break;
@@ -1251,10 +1250,9 @@
         QTextStream cpuinfo(&vendorId);
         return cpuinfo.readLine().trimmed();
     } else {
-        //        qWarning() << "Could not open /sys/devices/virtual/dmi/id/board_vendor";
         QFile file("/proc/cpuinfo");
         if (!file.open(QIODevice::ReadOnly)) {
-            qWarning() << "Could not open /proc/cpuinfo";
+            qDebug() << "Could not open /proc/cpuinfo";
         } else {
             QTextStream cpuinfo(&file);
             QString line = cpuinfo.readLine();
@@ -1287,7 +1285,7 @@
     }
     QFile file("/proc/cpuinfo");
     if (!file.open(QIODevice::ReadOnly)) {
-        qWarning() << "Could not open /proc/cpuinfo";
+        qDebug() << "Could not open /proc/cpuinfo";
     } else {
         QTextStream cpuinfo(&file);
         QString line = cpuinfo.readLine();
@@ -1347,7 +1345,7 @@
 
     QFile file("/etc/issue");
     if (!file.open(QIODevice::ReadOnly)) {
-        qWarning() << "Could not open /proc/cpuinfo";
+        qDebug() << "Could not open /proc/cpuinfo";
     } else {
         QTextStream prodinfo(&file);
         QString line = prodinfo.readLine();
@@ -1374,10 +1372,10 @@
         QHalInterface iface2;
         if (iface2.isValid()) {
             QStringList capList;
-            capList << QLatin1String("input.keyboard") 
+            capList << QLatin1String("input.keyboard")
                     << QLatin1String("input.keys")
-                    << QLatin1String("input.keypad") 
-                    << QLatin1String("input.mouse") 
+                    << QLatin1String("input.keypad")
+                    << QLatin1String("input.mouse")
                     << QLatin1String("input.tablet")
                     << QLatin1String("input.touchpad");
             for(int i = 0; i < capList.count(); i++) {
@@ -1418,7 +1416,7 @@
     foreach(const QString inputFileName, inputList) {
         QFile file(inputsPath+inputFileName+"/device/name");
         if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
-            qWarning()<<"File not opened";
+            qDebug()<<"File not opened";
         } else {
             QString strvalue;
             strvalue = file.readLine();
@@ -1461,12 +1459,9 @@
             foreach(const QString dev, list) {
                 QHalDeviceInterface ifaceDevice(dev);
                 if (ifaceDevice.isValid()) {
-//                    qWarning() << ifaceDevice.getPropertyString("battery.type")
-//                            << ifaceDevice.getPropertyInt("battery.charge_level.percentage");
                     if(!ifaceDevice.getPropertyBool("battery.present")
                         && (ifaceDevice.getPropertyString("battery.type") != "pda"
                              || ifaceDevice.getPropertyString("battery.type") != "primary")) {
-                        qWarning() << "XXXXXXXXXXXXX";
                         return 0;
                     } else {
                         level = ifaceDevice.getPropertyInt("battery.charge_level.percentage");
@@ -1479,7 +1474,6 @@
     } else {
         QFile infofile("/proc/acpi/battery/BAT0/info");
         if (!infofile.open(QIODevice::ReadOnly)) {
-            //   qWarning() << "Could not open /proc/acpi/battery/BAT0/info";
             return QSystemDeviceInfo::NoBatteryLevel;
         } else {
             QTextStream batinfo(&infofile);
@@ -1487,7 +1481,6 @@
             while (!line.isNull()) {
                 if(line.contains("design capacity")) {
                     levelWhenFull = line.split(" ").at(1).trimmed().toFloat();
-                    //qWarning() << levelWhenFull;
                     infofile.close();
                     break;
                 }
@@ -1498,7 +1491,6 @@
 
         QFile statefile("/proc/acpi/battery/BAT0/state");
         if (!statefile.open(QIODevice::ReadOnly)) {
-            //     qWarning() << "Could not open /proc/acpi/battery/BAT0/state";
             return QSystemDeviceInfo::NoBatteryLevel;
         } else {
             QTextStream batstate(&statefile);
@@ -1506,7 +1498,6 @@
             while (!line.isNull()) {
                 if(line.contains("remaining capacity")) {
                     level = line.split(" ").at(1).trimmed().toFloat();
-                    //qWarning() << level;
                     statefile.close();
                     break;
                 }
@@ -1554,7 +1545,6 @@
 #else
        QFile statefile("/proc/acpi/battery/BAT0/state");
        if (!statefile.open(QIODevice::ReadOnly)) {
-           //  qWarning() << "Could not open /proc/acpi/battery/BAT0/state";
        } else {
            QTextStream batstate(&statefile);
            QString line = batstate.readLine();
@@ -1597,7 +1587,7 @@
                                             "org.bluez.Adapter",
                                             "PropertyChanged",
                                             this,SLOT(bluezPropertyChanged(QString, QDBusVariant)))) {
-                     qWarning() << "bluez could not connect signal";
+                     qDebug() << "bluez could not connect signal";
                  }
              }
          }