/*************************************************************************** * * * Copyright: SUSE Linux AG, Nuernberg * * * * Authors: Olli Ries * * * * * * * * * ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include "config.h" #include #include "susehwitemhandler.h" static const KCmdLineOptions options[] = { { "sessioninit", I18N_NOOP("Check for new hardware on session startup."), 0}, { "+[UDI]", I18N_NOOP("HAL UDI to process."), 0}, KCmdLineLastOption }; extern "C" int kdemain (int argc, char* argv[]) { KAboutData aboutData ("suseplugger", I18N_NOOP("SUSEPlugger"), VERSION); aboutData.addAuthor ("Stephan Kulow", 0, "kde-maintainers@suse.de"); KCmdLineArgs::init (argc, argv, &aboutData); KCmdLineArgs::addCmdLineOptions( options ); KApplication app; HWItemHandler *suseplugger = new HWItemHandler(); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); if (args->isSet("sessioninit")) QTimer::singleShot(0, suseplugger, SLOT(sessioninit())); else { if (args->count() != 1) { fprintf(stderr, "Usage: suseplugger [--sessioninit] \n"); exit(1); } if (!suseplugger->handle(args->arg(0))) exit(0); } int exitCode = app.exec(); delete suseplugger; return exitCode; }