KCmdLineArgs4 Question

Richard Lärkäng nouseforaname at home.se
Sat Dec 31 11:31:44 GMT 2005


Hi!

On Wednesday 28 December 2005 21:52, Allen Winter wrote:
> Hi Core Devs,
>
> [I asked Waldo about this and he suggested I ask here instead]
>
> I'm using the new KCmdLineArgs from kdelibs4_snapshot and running into a
> problem.
>
> Recall that konsolekalendar should not support any Qt or KDE options since
> it is a CLI program.  IOW: I don't want 'konsolekalendar --help' to show
> any Qt or KDE specific command line args.
>
> When I have
>   KCmdLineArgs::init( argc, argv, &aboutData,
> KCmdLineArgs::CmdLineArgNone); in konsolekalendar's main.cpp the result is
>
> % ./konsolekalendar --help-all
> ASSERT: "args" in file
> /misc/shared/kde/branches/work/kdelibs4_snapshot/kdecore/kcmdlineargs.cpp,
> line 748 Aborted
>
> What am I doing wrong?
> Regards,
> Allen

I ran in to the same problem when checking if audiocd:/ worked. The problem 
seems to be that in KDE 3 the qt args are added anyway (in 
KApplication::addCmdLineOptions) so the assert wasn't triggered. But in 
kdelibs from trunk the qt args are only added if requested (KCmdLineArgs::
addStdCmdLineOptions)

So I made a patch so it only checks for the qt args in qt_argc and qt_argv if 
they are requested, and otherwise returns just the application name as argv.

Could anyone have a look at the attached patch?

/Richard Lärkäng
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kcmdlineargs.patch
Type: text/x-diff
Size: 1650 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20051231/acd40bf8/attachment.patch>


More information about the kde-core-devel mailing list