Browse files

Make sure that the sysFlag watcher can properly read the flag content…

…s as text.
  • Loading branch information...
1 parent 64e9ae2 commit e93d2a05257f5461438ddebd6e889b518d52d533 @beanpole135 beanpole135 committed Mar 26, 2014
Showing with 5 additions and 2 deletions.
  1. +4 −2 src-qt4/libpcbsd/utils/pcbsd-sysFlags.cpp
  2. +1 −0 src-qt4/libpcbsd/utils/pcbsd-sysFlags.h
View
6 src-qt4/libpcbsd/utils/pcbsd-sysFlags.cpp
@@ -63,8 +63,10 @@ QString SystemFlagWatcher::quickRead(QString filepath){
QFile file(filepath);
if( !file.open(QIODevice::ReadOnly | QIODevice::Text) ){ return ""; }
QStringList ret;
- while( !file.atEnd() ){
- ret << QString( file.readLine() );
+ QTextStream in(&file);
+ while( !in.atEnd() ){
+ ret << QString( in.readLine() );
}
+ file.close();
return ret.join("\n");
}
View
1 src-qt4/libpcbsd/utils/pcbsd-sysFlags.h
@@ -9,6 +9,7 @@
#include <QFile>
#include <QDir>
#include <QTimer>
+#include <QTextStream>
#include <unistd.h>

0 comments on commit e93d2a0

Please sign in to comment.