Commit cf55014e authored by Yoann Laissus's avatar Yoann Laissus

Port K4AboutData to KAboutData and use QCommandLineParser.

parent 048a5bac
......@@ -25,15 +25,15 @@
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <k4aboutdata.h>
#include <kaboutdata.h>
#include <kxmlguifactory.h>
#include <kmenu.h>
#include <kmenubar.h>
#include <kaction.h>
#include <kstandardshortcut.h>
#include <kstandardaction.h>
#include <kactioncollection.h>
#include <QApplication>
#include <QCommandLineParser>
static const char description[] =
I18N_NOOP("KDE free disk space utility");
......@@ -69,14 +69,38 @@ void KDFTopLevel::closeEvent(QCloseEvent *event)
/***************************************************************/
int main(int argc, char **argv)
{
K4AboutData aboutData( "kdf", 0, ki18n("KDiskFree"),
KDF_VERSION_STRING, ki18n(description), K4AboutData::License_GPL,
ki18n("(c) 1998-2001, Michael Kropfberger"), KLocalizedString(),
"http://utils.kde.org/projects/kdf");
aboutData.addAuthor(ki18n("Michael Kropfberger"),KLocalizedString(), "michael.kropfberger@gmx.net");
KCmdLineArgs::init( argc, argv, &aboutData );
KApplication app;
QApplication app(argc, argv);
KAboutData aboutData(QStringLiteral("kdf"),
i18n("KDiskFree"),
QStringLiteral(KDF_VERSION_STRING),
i18n(description),
KAboutLicense::GPL,
i18n("(c) 1998-2001, Michael Kropfberger"),
QStringLiteral(),
QStringLiteral("http://utils.kde.org/projects/kdf"),
QStringLiteral()
);
aboutData.setOrganizationDomain("kde.org");
aboutData.addAuthor(i18n("Michael Kropfberger"),
QString(),
QStringLiteral("michael.kropfberger@gmx.net"));
QCommandLineParser parser;
parser.setApplicationDescription(aboutData.shortDescription());
parser.addHelpOption();
parser.addVersionOption();
aboutData.setupCommandLine(&parser);
KAboutData::setApplicationData(aboutData);
// do the command line parsing
parser.process(app);
// handle standard options
aboutData.processCommandLine(&parser);
if( app.isSessionRestored() ) //SessionManagement
{
......
......@@ -34,9 +34,7 @@
#include "kdf_debug.h"
#include <klocale.h>
#include <kapplication.h>
#include <k4aboutdata.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <khelpclient.h>
#include <kmessagebox.h>
#include <kmenu.h>
......@@ -44,6 +42,8 @@
#include <ktoolinvocation.h>
#include <kshell.h>
#include <QApplication>
#include <QCommandLineParser>
#include <QFile>
#include <QAbstractEventDispatcher>
#include <QPainter>
......@@ -316,20 +316,40 @@ void KwikDisk::invokeHelp()
int main(int argc, char **argv)
{
K4AboutData about("kwikdisk", "kdf", ki18n("KwikDisk"), KDF_VERSION_STRING, ki18n(description),
K4AboutData::License_GPL, ki18n("(C) 2004 Stanislav Karchebny"),
KLocalizedString(), "http://utils.kde.org/projects/kdf",
"Stanislav.Karchebny@kdemail.net");
about.addAuthor( ki18n("Michael Kropfberger"), ki18n("Original author"),
"michael.kropfberger@gmx.net" );
about.addAuthor( ki18n("Espen Sand"), ki18n("KDE 2 changes"));
about.addAuthor( ki18n("Stanislav Karchebny"), ki18n("KDE 3 changes"),
"Stanislav.Karchebny@kdemail.net" );
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
QApplication app(argc, argv);
KAboutData aboutData(QStringLiteral("kwikdisk"),
i18n("KwikDisk"),
QStringLiteral(KDF_VERSION_STRING),
i18n(description),
KAboutLicense::GPL,
i18n("(C) 2004 Stanislav Karchebny"),
QStringLiteral(),
QStringLiteral("http://utils.kde.org/projects/kdf"),
QStringLiteral("Stanislav.Karchebny@kdemail.net"));
aboutData.addAuthor(i18n("Michael Kropfberger"),
i18n("Original author"),
QStringLiteral("michael.kropfberger@gmx.net"));
aboutData.addAuthor(i18n("Espen Sand"),
i18n("KDE 2 changes"));
aboutData.addAuthor(i18n("Stanislav Karchebny"),
i18n("KDE 3 changes"),
QStringLiteral("Stanislav.Karchebny@kdemail.net"));
QCommandLineParser parser;
parser.setApplicationDescription(aboutData.shortDescription());
parser.addHelpOption();
parser.addVersionOption();
aboutData.setupCommandLine(&parser);
KAboutData::setApplicationData(aboutData);
// do the command line parsing
parser.process(app);
// handle standard options
aboutData.processCommandLine(&parser);
KwikDisk mainWin;
......
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