File tree Expand file tree Collapse file tree 3 files changed +24
-23
lines changed Expand file tree Collapse file tree 3 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,19 @@ FusionCLI::FusionCLI(QObject *parent) : QObject(parent)
1010}
1111
1212
13- void FusionCLI::execute (int argc, char *argv[] ) {
13+ void FusionCLI::execute (int argc, QStringList args ) {
1414
15- if (argc>1 )
15+ if (argc>1 )
1616 {
17- QString arg = argv [1 ];
17+ QString arg = args [1 ];
1818 if (arg==" -g" ||arg==" --allGames" )
1919 getAllGames ();
2020 else if (arg==" -r" ||arg==" --refresh" )
2121 refreshList ();
2222 else if (arg==" -l" ||arg==" --launch" )
23- launchByID (QString (argv [2 ]) );
23+ launchByID (args [2 ]);
2424 else if (arg==" -i" ||arg==" --gameInfo" ) {
25- getGameByID (QString (argv [2 ]) );
25+ getGameByID (args [2 ]);
2626 }
2727 }
2828}
@@ -87,7 +87,7 @@ void FusionCLI::getAllGames() {
8787 qDebug () << " Found " << gameList.length () << " games." ;
8888
8989 for (int i=0 ;i<gameList.length ();++i) {
90- games.append (getGame (& gameList[i]));
90+ games.append (getGame (gameList[i]));
9191 }
9292
9393
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class FusionCLI : public QObject
1515 Q_OBJECT
1616public:
1717 explicit FusionCLI (QObject *parent = 0 );
18- void execute (int argc, char *argv[] );
18+ void execute (int argc, QStringList args );
1919 void refreshList ();
2020 void launchByID (QString ID);
2121signals:
@@ -30,7 +30,7 @@ public slots:
3030 void print (QList<QVariant> list, QString title);
3131 void print (QVariant list);
3232 QTextStream *q;
33- QList<FGame> gameList;
33+ QList<FGame* > gameList;
3434 void getGameByID (QString ID);
3535};
3636
Original file line number Diff line number Diff line change @@ -74,29 +74,30 @@ int main(int argc, char *argv[])
7474
7575 qDebug () << " Args " <<args;
7676
77-
78-
7977 if (argc<=1 ) {
80- qout << " Fusion Commandline-Interface" << endl <<endl;
81- qout << " Usage: fusioncli [options]" << endl;
82- qout << " --allGames -g: Get all Games with all Info" << endl<<endl;
78+ qout << " Fusion Commandline-Interface" << endl <<endl;
79+ qout << " Usage: fusioncli [options]" << endl;
80+ qout << " --allGames | -g : Get all Games with all Info" << endl;
81+ qout << " --refresh | -r : Refresh Infos from Database" << endl;
82+ qout << " --launch [ID] | -l [ID]: Launch Game with ID" << endl;
83+ qout << " --gameInfo [ID] | -i [ID]: Get info for Game-ID" << endl << endl;
84+
8385
8486 QTimer::singleShot (10 , &a, SLOT (quit ()));
8587 #ifdef DEBUG_TEST
8688 dbgFile.close ();
8789 delete dbgStream;
8890 #endif
89- }
90-
91- FusionCLI cli;
92- cli.execute (argc, argv);
91+ } else {
92+ FusionCLI cli;
93+ cli.execute (argc, args);
9394
94- QTimer::singleShot (10 , &a, SLOT (quit ()));
95-
96- #ifdef DEBUG_TEST
97- dbgFile.close ();
98- delete dbgStream;
99- #endif
95+ QTimer::singleShot (10 , &a, SLOT (quit ()));
10096
97+ #ifdef DEBUG_TEST
98+ dbgFile.close ();
99+ delete dbgStream;
100+ #endif
101+ }
101102 return a.exec ();
102103}
You can’t perform that action at this time.
0 commit comments