Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 0bc6f87d authored by Luigi Toscano's avatar Luigi Toscano

Fix the porting of KAboutData and QCommandLineParser

- set the QApplication instance as soon as possible;
- remove the entries already set in KAboutData constructor;
- set all the KAboutData entries before setting the instance;
- set all parsing options before starting the parsing.
parent 99e0b06b
......@@ -35,9 +35,7 @@ static const char description[] =
int main(int argc, char *argv[])
{
QApplication::setApplicationName(QStringLiteral("kmouth"));
QApplication::setApplicationVersion(KMOUTH_VERSION);
QApplication::setOrganizationDomain(QStringLiteral("kde.org"));
QApplication app(argc, argv);
KLocalizedString::setApplicationDomain("kmouth");
QApplication::setApplicationDisplayName(i18n("KMouth"));
......@@ -51,19 +49,18 @@ int main(int argc, char *argv[])
I18N_NOOP("http://www.schmi-dt.de/kmouth/index.en.html"),
I18N_NOOP("kmouth@schmi-dt.de"));
aboutData.addAuthor(i18n("Gunnar Schmi Dt"), QString(), QStringLiteral("kmouth@schmi-dt.de"));
QApplication app(argc, argv);
aboutData.addCredit(i18n("Olaf Schmidt"), i18n("Tips, extended phrase books"));
aboutData.setOrganizationDomain(QByteArray("kde.org"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
//PORTING SCRIPT: adapt aboutdata variable if necessary
parser.addPositionalArgument(QStringLiteral("[File]"), i18n("History file to open"));
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
parser.addPositionalArgument(QStringLiteral("[File]"), i18n("History file to open"));
aboutData.addCredit(i18n("Olaf Schmidt"), i18n("Tips, extended phrase books"));
if (app.isSessionRestored()) {
RESTORE(KMouthApp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment