aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-04-25 13:08:12 -0400
committerKen Moore <moorekou@gmail.com>2016-04-25 13:08:12 -0400
commited5ecf7ea7a482b4649e66ecb35fbc60af680684 (patch)
treeacc0fa17d228259e847f55c678db9fb0a9b50f0c /src-qt5/desktop-utils/lumina-fileinfo/main.cpp
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
downloadlumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.tar.gz
lumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.tar.bz2
lumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.zip
Rearrange the Lumina source tree quite a bit:
Now the utilites are arranged by category (core, core-utils, desktop-utils), so all the -utils may be excluded by a package system (or turned into separate packages) as needed.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fileinfo/main.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-fileinfo/main.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/main.cpp b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
new file mode 100644
index 00000000..f8ba3620
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-fileinfo/main.cpp
@@ -0,0 +1,59 @@
+#include <QTranslator>
+#include <QApplication>
+#include <QDebug>
+#include <QFile>
+
+#include "MainUI.h"
+#include <LuminaUtils.h>
+#include <LuminaThemes.h>
+
+int main(int argc, char ** argv)
+{
+ LTHEME::LoadCustomEnvSettings();
+ QApplication a(argc, argv);
+ LUtils::LoadTranslation(&a, "lumina-fileinfo");
+ LuminaThemeEngine theme(&a);
+
+
+ //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]);
+ }
+ //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
+ path.clear();
+ }
+ }
+ if(!path.isEmpty()){
+ //if(!QFile::exists(path)){ LUtils::writeFile(path,QStringList()); } //create an empty file
+ 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
+ QStringList msg;
+ msg << "ERROR: Invalid input arguments";
+ msg << "Usage: \"lumina-fileinfo [-application | -link] <file>";
+ qDebug() << msg.join("\n");
+ return 1;
+ }
+
+
+} \ No newline at end of file
bgstack15