diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fileinfo/main.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/main.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp index a602f290..ce62399d 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp @@ -11,46 +11,26 @@ int main(int argc, char ** argv) { LTHEME::LoadCustomEnvSettings(); QApplication a(argc, argv); - a.setAttribute(Qt::AA_UseHighDpiPixmaps); + a.setAttribute(Qt::AA_UseHighDpiPixmaps); LUtils::LoadTranslation(&a, "l-fileinfo"); - //LuminaThemeEngine theme(&a); //Read the input variables QString path = ""; QString flag = ""; for(int i=1; i<argc; i++){ - if( QString(argv[i]).startsWith("-") ){ flag = QString(argv[i]); } - else{ path = QString(argv[i]); break; } + 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); } - // - flag - if(!flag.isEmpty()){ - if(flag=="-application"){ - flag = "APP"; //for internal use - }else if(flag=="-link"){ - flag = "LINK"; //for internal use - }else{ - //Invalid flag - clear the path as well - flag.clear(); - path.clear(); - } - } - if(!path.isEmpty() || !flag.isEmpty()){ + if(path.isEmpty() && flag.isEmpty()){ flag = "APP"; } MainUI w; - //QObject::connect(&theme, SIGNAL(updateIcons()), &w, SLOT(UpdateIcons()) ); w.LoadFile(path, flag); w.show(); int retCode = a.exec(); return retCode; - }else{ - //Show an error text and exit - qDebug() << "ERROR: Invalid input arguments"; - qDebug() << "Usage: \"lumina-fileinfo [-application | -link] [file]"; - return 1; - } - - } |