summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/irdaapplet/irda.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp
index e21f191..5b23330 100644
--- a/core/applets/irdaapplet/irda.cpp
+++ b/core/applets/irdaapplet/irda.cpp
@@ -104,14 +104,20 @@ int IrdaApplet::setIrdaStatus(int c) {
int IrdaApplet::checkIrdaDiscoveryStatus() {
+
QFile discovery("/proc/sys/net/irda/discovery");
- char status;
- discovery.open( IO_ReadOnly|IO_Raw );
- discovery.readBlock (&status, 1);
+ QString streamIn = "0";
+
+ if (discovery.open(IO_ReadOnly) ) {
+ QTextStream stream ( &discovery );
+ streamIn = stream.read();
+ }
+
discovery.close();
- return atoi(&status);
+ return( streamIn.toInt() );
}
+
int IrdaApplet::setIrdaDiscoveryStatus(int d) {
QFile discovery("/proc/sys/net/irda/discovery");