aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-06-30 22:18:18 -0400
committerKen Moore <moorekou@gmail.com>2016-06-30 22:18:18 -0400
commit668066f1910a694b874271622bcf42ac0dff7141 (patch)
tree497013386963eef79e48c12eb57563c2fcad73be /src-qt5/desktop-utils/lumina-fileinfo/main.cpp
parentAdd in the last 2 converted pages (session_[locale/options]). Leave the new U... (diff)
downloadlumina-668066f1910a694b874271622bcf42ac0dff7141.tar.gz
lumina-668066f1910a694b874271622bcf42ac0dff7141.tar.bz2
lumina-668066f1910a694b874271622bcf42ac0dff7141.zip
Setup lumina-fileinfo that that it can be used to create brand-new application registrations within the user's local applications dir. Also have it install it's own .desktop registrations on the system at install time.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fileinfo/main.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-fileinfo/main.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
index f8ba3620..394ac579 100644
--- a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
+++ b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
@@ -18,11 +18,9 @@ int main(int argc, char ** argv)
//Read the input variables
QString path = "";
QString flag = "";
- if (argc==2) {
- path = QString::fromLocal8Bit(argv[1]);
- }else if (argc==3) {
- flag = QString::fromLocal8Bit(argv[1]);
- path = QString::fromLocal8Bit(argv[2]);
+ for(int i=1; i<argc; i++){
+ if( QString(argv[i]).startsWith("-") ){ flag = QString(argv[i]); }
+ else{ path = QString(argv[i]); break; }
}
//Check the input variables
// - path
@@ -35,11 +33,11 @@ int main(int argc, char ** argv)
flag = "LINK"; //for internal use
}else{
//Invalid flag - clear the path as well
+ flag.clear();
path.clear();
}
}
- if(!path.isEmpty()){
- //if(!QFile::exists(path)){ LUtils::writeFile(path,QStringList()); } //create an empty file
+ if(!path.isEmpty() || !flag.isEmpty()){
MainUI w;
QObject::connect(&theme, SIGNAL(updateIcons()), &w, SLOT(UpdateIcons()) );
w.LoadFile(path, flag);
@@ -48,12 +46,10 @@ int main(int argc, char ** argv)
return retCode;
}else{
//Show an error text and exit
- QStringList msg;
- msg << "ERROR: Invalid input arguments";
- msg << "Usage: \"lumina-fileinfo [-application | -link] <file>";
- qDebug() << msg.join("\n");
+ qDebug() << "ERROR: Invalid input arguments";
+ qDebug() << "Usage: \"lumina-fileinfo [-application | -link] [file]";
return 1;
}
-} \ No newline at end of file
+}
bgstack15