From 0f9955585ccaa45db582640c415b97de67bc8555 Mon Sep 17 00:00:00 2001 From: harlekin Date: Wed, 19 Jun 2002 00:37:35 +0000 Subject: no more permanent QFile::writeBlock: Write operation not permitted, and also its now more c++ rather than c style , the discovery part --- 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) { } 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"); -- cgit v0.9.0.2