-rw-r--r-- | core/applets/irdaapplet/irda.cpp | 14 |
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 | |||
@@ -103,16 +103,22 @@ int IrdaApplet::setIrdaStatus(int c) { | |||
103 | } | 103 | } |
104 | 104 | ||
105 | int IrdaApplet::checkIrdaDiscoveryStatus() { | 105 | int IrdaApplet::checkIrdaDiscoveryStatus() { |
106 | |||
106 | QFile discovery("/proc/sys/net/irda/discovery"); | 107 | QFile discovery("/proc/sys/net/irda/discovery"); |
107 | char status; | ||
108 | 108 | ||
109 | discovery.open( IO_ReadOnly|IO_Raw ); | 109 | QString streamIn = "0"; |
110 | discovery.readBlock (&status, 1); | 110 | |
111 | if (discovery.open(IO_ReadOnly) ) { | ||
112 | QTextStream stream ( &discovery ); | ||
113 | streamIn = stream.read(); | ||
114 | } | ||
115 | |||
111 | discovery.close(); | 116 | discovery.close(); |
112 | 117 | ||
113 | return atoi(&status); | 118 | return( streamIn.toInt() ); |
114 | } | 119 | } |
115 | 120 | ||
121 | |||
116 | int IrdaApplet::setIrdaDiscoveryStatus(int d) { | 122 | int IrdaApplet::setIrdaDiscoveryStatus(int d) { |
117 | QFile discovery("/proc/sys/net/irda/discovery"); | 123 | QFile discovery("/proc/sys/net/irda/discovery"); |
118 | 124 | ||