aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
blob: ce62399d4667237389b2fdd227a66ef93aa18268 (plain)
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
35
36
#include <QTranslator>
#include <QApplication>
#include <QDebug>
#include <QFile>

#include "MainUI.h"
#include <LUtils.h>
#include <LuminaThemes.h>

int main(int argc, char ** argv)
{
  LTHEME::LoadCustomEnvSettings();
  QApplication a(argc, argv);
    a.setAttribute(Qt::AA_UseHighDpiPixmaps);
  LUtils::LoadTranslation(&a, "l-fileinfo");


  //Read the input variables
  QString path = "";
  QString flag = "";
  for(int i=1; i<argc; i++){
    QString tmp(argv[i]);
    if( tmp=="--new-application" ){ flag = "APP"; }
    else if( tmp=="--new-link" ){ flag = "LINK"; }
    else if(!tmp.startsWith("-")){ path = QString(argv[i]); break; }
  }
  //Check the input variables
  // - path
  if(!path.isEmpty()){ path = LUtils::PathToAbsolute(path); }
  if(path.isEmpty() && flag.isEmpty()){ flag = "APP"; }
    MainUI w;
    w.LoadFile(path, flag);
    w.show();
    int retCode = a.exec();
    return retCode;
}
bgstack15