Index: /trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
===================================================================
--- /trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11615)
+++ /trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11616)
@@ -7,5 +7,5 @@
 
 #include "RawEventsViewer.h"
-#include "RawEventsViewerUi.h"
+#include "viewer.h"
 #include <math.h>
 #include <fstream>
@@ -837,29 +837,8 @@
 }
 /************************************************************
- * IS FITS. checks if a given file is a fits file.
- ************************************************************/
-bool RawDataViewer::IsFits(const char *name)
-{
-    MZlib fin(name);
-    if (!fin)
-        return 0;
-
-    unsigned char c[6];
-    fin.read((char*)c, 6);
-    if (!fin)
-        return 0;
-
-    return memcmp(c, "SIMPLE", 6)==0;
-}
-/************************************************************
  * OPEN FILE. opens a new fits file
  ************************************************************/
 void RawDataViewer::openFile(string& file)
 {
-    if (!IsFits(file.c_str()))
-    {
-        cout << "File does not seem to be fits. aborting" << endl;
-        return;
-    }
     if (inputFile)
     {
@@ -867,5 +846,12 @@
         delete inputFile;
     }
-    inputFile = new MFits(file);
+    inputFile = new fits(file);
+    if (!*inputFile)
+    {
+        cout << "Couldn't open file." << endl;
+        delete inputFile;
+        inputFile = NULL;
+        return;
+    }
     nRows = inputFile->GetInt("NAXIS2");
     nRoi = inputFile->GetInt("NROI");
