Hi
According to Nikhil's suggestions,im attaching a new patch for a
review.Please test it :)
Regards
Rohan Garg
www.launchpad.net/~rohangarg
On Mon, Jul 5, 2010 at 2:27 AM, Nikhil Marathe <[email protected]> wrote:
> On Mon, Jul 5, 2010 at 12:29 AM, Rohan Garg <[email protected]> wrote:
> > Hi
> > After working for about half an hour on this,i came up with the attached
> > patch for apturl support in rekonq.It would be nice if this can be
> > incorporated in the 0.5 release.
>
> Hey Rohan,
>
> I have a couple of comments about the patch.
>
> 1. Could you move the initialisation of the QStringList and the url
> handling inside the if conditional for the "apt" url.
> Prevents unnecessary init and allocation.
>
> 2. I believe you should check for KProcess exit status and report it.
> BTW does just passing the URL to the exec() make it interpret it
> correctly.
>
> 3. How do you handle non-debian systems. Like if I execute this on a
> archlinux system it should have a well defined behaviour. Perhaps you
> could check if the 'apt' program exists?
>
> Nikhil
>
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index 568aa40..1f84b42 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -53,6 +53,7 @@
#include <KJob>
#include <kio/udsentry.h>
#include <KMessageBox>
+#include <kprocess.h>
// Qt Includes
#include <QLatin1String>
@@ -118,6 +119,22 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
return true;
}
+ // "apturl" handling
+ if (_url.protocol() == QL1S ("apt"))
+ {
+ //Declare apturl as QString
+ QString apturl="apturl";
+ //We need to convert the url to QStringList to pass as a argument to apturl
+ QStringList host;
+ host << _url.url();
+
+ if ( KProcess::execute (apturl,host)==0)
+ return true;
+ else
+ return false;
+
+ }
+
// "abp" handling
if (_url.protocol() == QL1S("abp"))
{
_______________________________________________
rekonq mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/rekonq