summaryrefslogblamecommitdiffstats
path: root/src/maingui/main.cpp
blob: f9b8bb2ad4a19384a0acdb93ff8dda7893030e5d (plain) (tree)
1
2
3
4
5
6
7
8

                       


                       
 

                                


                                
 
                         



                                                                         
   
            
 
                             
                     

                  
 
#include <QApplication>
#include <fstream>
#include "printergui.h"
#include <fcntl.h>
#include <sys/stat.h>

int main(int argc, char *argv[])
{
  // First check parameter count
  if (argc != 3)
      return 2;

  // Check if file exists
  int fh = open(argv[2], O_RDONLY);
  if (fh < 0) {
    fprintf(stderr, "ERROR: Could not open %s for reading..\n", argv[2]);
	 return 2;
  }
  close(fh);

  QApplication a(argc, argv);
  PrinterGui w(argv);
  w.show();
  return a.exec();
}