[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: KAboutData / KCmdLineArgs
From: Waldo Bastian <bastian () suse ! de>
Date: 2000-01-09 23:20:40
[Download RAW message or body]
Hiya,
I have updated KAboutData / KCmdLineArgs.
KAboutData now takes 'const char*' pointers instead of QStrings and
translates (some of) the strings when you query them, not when you set
them.
KCmdLineArgs can now take a pointer to a KAboutData object as well.
The init() function automatically calls
KApplication::addCmdLineOptions() so you do not have to worry about
Qt/KApplication options any longer. If you don't want these options you
can tell init not to do this.
A typical KDE application now looks like:
static KCmdLineOptions options[] =
{
{ "silent", I18N_NOOP("Start without a default window."), 0 },
{ "+[URL]", I18N_NOOP("Location to open."), 0 },
{ 0, 0, 0}
};
int main( int argc, char **argv )
{
KAboutData aboutData( "konqueror", I18N_NOOP("Konqueror"),
KONQUEROR_VERSION,
I18N_NOOP("Web browser, file manager, ..."),
KAboutData::GPL,
"(c) 1999-2000, The Konqueror developers" );
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KApplication app;
....
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
.... handle command line args...
delete args;
app.exec();
return 0;
}
Cheers,
Waldo
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic