summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
blob: a5582d4268318e4913946878eaa8fdc0824f9e2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <QApplication>
#include <fstream>
#include "mainwindow.h"


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

  // Check if file exists
  std::fstream f;
  try {
    f.open(argv[2], std::ios::in);
  } catch (std::fstream::failure e) {
    return 3;
  }
  f.close();

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