[patch] KToolInvocation: re-enable Windows code, share with UNIX, add invokeTerminal()

Ralf Habacker ralf.habacker at freenet.de
Tue Apr 1 22:10:07 BST 2008


Ralf Habacker schrieb:
> Aaron J. Seigo schrieb:
>> On Friday 28 March 2008, Jarosław Staniek wrote:
>>  
>>> 1. The following methods are identical on all platforms and thus 
>>> would be
>>> good to  move them to the common ktoolinvocation.cpp file.
>>> - KToolInvocation::invokeHelp()
>>>     identical (except and ifdef for problem with
>>> startServiceByDesktopName()) - KToolInvocation::invokeMailer() - 
>>> identical
>>> - KToolInvocation::startKdeinit() - identical except additional 
>>> --suicide
>>> arg for UNIX
>>>     
>>
>> +1
>>
>>  
>>> 2. Reneable code that was used in KDE3/win32 (and now runs fine too)
>>> - void KToolInvocation::invokeMailer(const QString &_to, const QString
>>> &_cc, const QString &_bcc,
>>>                                   const QString &subject, const QString
>>> &body, const QString & /*messageFile
>>> TODO*/, const                      QStringList &attachURLs,
>>>                                   const QByteArray& startup_id )
>>> - void KToolInvocation::invokeBrowser( const QString &url, const
>>> QByteArray& startup_id )
>>>
>>> Both methods use ShellExecute().
>>>     
>>
>> will leave for win32 devs to comment on =)
>>   
> I suggest to allow kde internal (konqueror) and external browser 
> switchable by a configuration switch. 

> Would be kdeglobals a good place for such a switch ?
I can answer these question by myself: invokeTerminal already use such a 
configuration switch

    KConfigGroup confGroup( KGlobal::config(), "General" );
    QString exec = confGroup.readPathEntry("TerminalApplication", 
"konsole");

for invokeBrowser I suggest to define a 'UseInternalBrowser' flag, for 
invokeMailer a 'UseInternalMailer' flag

the x11 implementation of invokeBrowser() should be moved to 
ktoolinvocation.cpp and renamed to

void KToolInvocation::invokeBrowserInternal( const QString &url, const 
QByteArray& startup_id ), which could be used by x11, win (and mac) 
implementation similar with the invokeMailer().

Any comments especially for the switch and methods names ?

Ralf







More information about the kde-core-devel mailing list