diff options
author | Weblate <noreply@weblate.org> | 2017-12-15 22:52:34 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-12-15 22:52:34 +0000 |
commit | 9155556b94b0fe25ef3d5398a7f70dcdc1841d69 (patch) | |
tree | ae5af06e4741c8767344be6d90a7307bcddb5b5d /src-qt5/desktop-utils/lumina-fileinfo/main.cpp | |
parent | Translated using Weblate (Russian) (diff) | |
parent | Another minor networking fix. (diff) | |
download | lumina-9155556b94b0fe25ef3d5398a7f70dcdc1841d69.tar.gz lumina-9155556b94b0fe25ef3d5398a7f70dcdc1841d69.tar.bz2 lumina-9155556b94b0fe25ef3d5398a7f70dcdc1841d69.zip |
Merge remote-tracking branch 'origin/master'
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; - } - - } |