Browse Source

Rafa: arreglando funcion de abrir file.

Rafael Arce Nazario 8 years ago
parent
commit
4367c91926
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      filemanip.cpp

+ 5
- 3
filemanip.cpp View File

@@ -18,10 +18,12 @@ filemanip::filemanip()
18 18
 filemanip::filemanip(QString filename){
19 19
     file = new QFile(filename);
20 20
     file->open(QIODevice::ReadOnly) ;
21
-    if(file)
21
+    if(file->exists())
22 22
         in = new QTextStream(file) ;
23
-    else
24
-        qDebug("Cant open!") ;
23
+    else {
24
+        qDebug() << "Cant open " + filename + "! Exiting program..." ;
25
+        exit(1);
26
+    }
25 27
 
26 28
 }
27 29