Simplify file loading procedure
authorunc0rr
Sat, 06 Oct 2012 23:36:43 +0400
changeset 7724 36c539c9cfb1
parent 7723 ca05b576ec74
child 7725 4ad05a478c6c
Simplify file loading procedure
QTfrontend/main.cpp
--- a/QTfrontend/main.cpp	Sat Oct 06 01:09:41 2012 +0400
+++ b/QTfrontend/main.cpp	Sat Oct 06 23:36:43 2012 +0400
@@ -272,18 +272,10 @@
 
     QFile resFile(":/res/css/" + fname);
 
-    QFile & file = (extFile.exists()?extFile:resFile);
+    QFile & file = (extFile.exists() ? extFile : resFile);
 
     if (file.open(QIODevice::ReadOnly | QIODevice::Text))
-    {
-        QTextStream in(&file);
-        while (!in.atEnd())
-        {
-            QString line = in.readLine();
-            if(!line.isEmpty())
-                style.append(line);
-        }
-    }
+        style.append(file.readAll());
 
     app.form = new HWForm(NULL, style);
     app.form->show();