KCmdLineArgs4 Question

Waldo Bastian bastian at kde.org
Mon Jan 2 20:46:01 GMT 2006


On Monday 02 January 2006 02:28, you wrote:
> On Saturday 31 December 2005 12:31, Richard Lärkäng wrote:
> > 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)
>
> Right.
>
> > 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.
>
> Patch looks good to me.
>
> It makes me realize that we leak qt_argv, but we always did, nothing new
> there.
>
> Hmm. If we want to get rid of KApplication for kde4, then we'll need to
> simply pass all argc/argv from main to QApp, and then
> KCmdLineArgs::qt_arg[cv] can go away. I'm not sure why KCmdLineArgs took
> care of filtering out non-qt options, when Qt can do that by itself
> already.

It's to handle test cases like these:

echo hello > '--reverse'; kedit -- --reverse // Open file '--reverse'
kedit --reverse // Activates reverse layout
kedit -reverse // Activates reverse layout
kedit --caption --reverse // Sets title to '--reverse'

Cheers,
Waldo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060102/8b76ebcf/attachment.sig>


More information about the kde-core-devel mailing list