Auto opening detect if is Snapmatic picture or Savegame file
This commit is contained in:
parent
c126840e4c
commit
89919b9f7f
1 changed files with 16 additions and 2 deletions
14
main.cpp
14
main.cpp
|
@ -25,8 +25,10 @@
|
||||||
#include "SavegameData.h"
|
#include "SavegameData.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
@ -58,11 +60,23 @@ int main(int argc, char *argv[])
|
||||||
else if (selectedAction == "")
|
else if (selectedAction == "")
|
||||||
{
|
{
|
||||||
QFile argumentFile(currentArg);
|
QFile argumentFile(currentArg);
|
||||||
|
QFileInfo argumentFileInfo(argumentFile);
|
||||||
if (argumentFile.exists())
|
if (argumentFile.exists())
|
||||||
|
{
|
||||||
|
QString argumentFileName = argumentFileInfo.fileName();
|
||||||
|
QString argumentFileType = argumentFileName.left(4);
|
||||||
|
|
||||||
|
if (argumentFileType == "PGTA")
|
||||||
{
|
{
|
||||||
arg1 = currentArg;
|
arg1 = currentArg;
|
||||||
selectedAction = "showpic";
|
selectedAction = "showpic";
|
||||||
}
|
}
|
||||||
|
else if (argumentFileType == "SGTA")
|
||||||
|
{
|
||||||
|
arg1 = currentArg;
|
||||||
|
selectedAction = "showsgd";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue