-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (25 loc) · 687 Bytes
/
main.cpp
File metadata and controls
34 lines (25 loc) · 687 Bytes
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
26
27
28
29
30
31
32
33
34
#include "mainwindow.h"
#include <QApplication>
#include "filetypes.h"
#include "../Lib/supportfunctions.h"
#include <iostream>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("EasyNotepad") ;
a.setApplicationVersion(GITHASH) ;
MainWindow w;
QString directory = "", filename = "" ;
if (argc>1 && argv[1][0]!='-') filename=argv[1] ;
if (argc>2) directory=argv[2] ;
filename.replace("\\", "/") ;
directory.replace("\\", "/") ;
#ifdef DEBUG
for (int i=0; i<argc; i++) {
warningOkDialog(&w, "Debug", argv[i]) ;
}
#endif
w.setPath(directory, filename) ;
w.show();
return a.exec();
}