showpic now without -showpic= possible

This commit is contained in:
Rafael 2016-03-21 22:47:08 +01:00
parent efe1727170
commit 53daa7c92d

View file

@ -21,7 +21,7 @@
#include <QApplication> #include <QApplication>
#include <QStringList> #include <QStringList>
#include <QString> #include <QString>
#include <QDebug> #include <QFile>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -30,6 +30,7 @@ int main(int argc, char *argv[])
QStringList applicationArgs = a.arguments(); QStringList applicationArgs = a.arguments();
QString selectedAction; QString selectedAction;
QString arg1; QString arg1;
applicationArgs.removeAt(0);
foreach(QString currentArg, applicationArgs) foreach(QString currentArg, applicationArgs)
{ {
@ -40,6 +41,15 @@ int main(int argc, char *argv[])
arg1 = reworkedArg; arg1 = reworkedArg;
selectedAction = "showpic"; selectedAction = "showpic";
} }
else if (selectedAction == "")
{
QFile argumentFile(currentArg);
if (argumentFile.exists())
{
arg1 = currentArg;
selectedAction = "showpic";
}
}
} }
if (selectedAction == "showpic") if (selectedAction == "showpic")