21 : QtService<QCoreApplication>(argc, argv, name)
25 for (
int i = 0; i < argc; ++i)
26 args.append(QString::fromLocal8Bit(argv[i]));
29 QString a = args.at(1);
30 if (a == QLatin1String(
"-s") || a == QLatin1String(
"-save"))
32 createApplication(argc, argv);
33 application()->setApplicationName(appName);
38 szDir = RabbitCommon::CDir::Instance()->GetDirUserConfig();
44 foreach(
auto p, m_Plugins->m_Plugins)
48 CService* pService = p->NewService();
50 pService->SaveConfigure(szDir);
55 QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(),
56 QSettings::IniFormat);
60 application()->quit();
63 }
else if (a == QLatin1String(
"-h") || a == QLatin1String(
"-help")) {
65 printf(
"\t-s(ave) [Directory] \t: Generate configuration file in [Directory]\n");
66 throw std::invalid_argument(
"Help argument");
71 QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(),
72 QSettings::IniFormat);