[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: kdesu
From:       Barış_Metin <baris () uludag ! org ! tr>
Date:       2005-05-18 20:59:36
Message-ID: 200505182359.36707.baris () uludag ! org ! tr
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


à ‡arÃ… Ÿamba 18 May 2005 23:56 tarihinde, Nathan Toone Ã… ŸunlarÄ ± yazmÄ ±Ã… \
ŸtÄ ±: 
> Is there some documentation somewhere that explains how to use kdesu from
> within an application?  I'd like to have certain options in my application
> have root priviliges (after prompting the user for the root password)...

KProcess is what you need.
http://developer.kde.org/documentation/library/cvs-api/kdecore/html/classKProcess.html


In your case something like below can be usable. Probably this is not what you need \
but can be a start point :).

// Warning: untested
QString su = KStandardDirs::findExe("kdesu");
if (!su.isEmpty())
{
        KProcess p;
        p << kdesu;
        p << QString("konsole");
        p.start();
}

regards,
-- 
BarÄ ±Ã… Ÿ Metin


[Attachment #5 (text/html)]

<html><head><meta name="qrichtext" content="1" /></head><body \
style="font-size:10pt;font-family:Bitstream Vera Sans"> <p>Çarşamba 18 May 2005 \
23:56 tarihinde, Nathan Toone şunları yazmıştı: </p> <p><span \
style="color:#008000">&gt; Is there some documentation somewhere that explains how to \
use kdesu from</span></p> <p><span style="color:#008000">&gt; within an application?  \
I'd like to have certain options in my application</span></p> <p><span \
style="color:#008000">&gt; have root priviliges (after prompting the user for the \
root password)...</span></p> <p></p>
<p>KProcess is what you need.</p>
<p>http://developer.kde.org/documentation/library/cvs-api/kdecore/html/classKProcess.html</p>
 <p></p>
<p>In your case something like below can be usable. Probably this is not what you \
need but can be a start point :).</p> <p></p>
<p>// Warning: untested</p>
<p>QString su = KStandardDirs::findExe(&quot;kdesu&quot;);</p>
<p>if (!su.isEmpty())</p>
<p>{</p>
<p>        KProcess p;</p>
<p>        p &lt;&lt; kdesu;</p>
<p>        p &lt;&lt; QString(&quot;konsole&quot;);</p>
<p>        p.start();</p>
<p>}</p>
<p></p>
<p>regards,</p>
<p>-- </p>
<p>Barış Metin</p>
</body></html>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic