summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore 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
@@ -102,18 +102,24 @@ int IrdaApplet::setIrdaStatus(int c) {
return 0;
}
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");
discovery.open( IO_WriteOnly|IO_Raw );