CommandLineOptions ParseCommandLineOptions(unsigned int argc, char* argv[]) { bool AutoFixPlaylists = false; bool AutoFixAlbums= false; bool SimulateTransfers= false; bool DebugOutput = false; for (unsigned int i =0; i < argc; i ++) { QString str(argv[i]); str = str.toLower(); cout << "param: " << str.toStdString() << endl; if (str == "--fixbadplaylists") { AutoFixPlaylists = true; cout << "FOUND PL FIX!!!" << endl; } else if (str == "--autofixalbums") { AutoFixAlbums = true; cout << "FOUND ALBUM FIX!!!" << endl; } else if (str == "--simulate") { SimulateTransfers = true; cout << "FOUND SIMULATE TRANSFERS FIX!!!" << endl; } else if (str == "--debug") { DebugOutput = true; } } return CommandLineOptions(AutoFixPlaylists, AutoFixAlbums, SimulateTransfers, DebugOutput); }
int main(int argc, char* argv[]){ if (argc > 1 ){ CommandLineOptions(argc, argv); } QApplication app(argc, argv); MainWindow tux(argc>1 ? argv[1] : ""); app.setMainWidget( &tux ); return app.exec(); }