From alavaliant@ra09.com  Thu Mar 19 08:56:47 2015
Received: (at submit) by bugs.x2go.org; 19 Mar 2015 07:56:49 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=ham
	version=3.3.2
Received: from thetower.ra09.com (ra09.com [202.124.104.240])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id DDB2D5DAA3
	for <submit@bugs.x2go.org>; Thu, 19 Mar 2015 08:56:46 +0100 (CET)
Received: from grigorig.ra09.com ([10.1.1.8])
	by thetower.ra09.com with esmtp (Exim 4.80)
	(envelope-from <alavaliant@ra09.com>)
	id 1YYVJq-0002Hc-I2
	for submit@bugs.x2go.org; Thu, 19 Mar 2015 20:56:42 +1300
Message-ID: <550A8157.9050203@ra09.com>
Date: Thu, 19 Mar 2015 20:57:11 +1300
From: Jason Alavaliant <alavaliant@ra09.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0
MIME-Version: 1.0
To: submit@bugs.x2go.org
Subject: hosted application doesn't support %i and %c in application exec
 param
Content-Type: multipart/mixed;
 boundary="------------000800080809020205060308"

This is a multi-part message in MIME format.
--------------000800080809020205060308
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Package: x2goclient
Version: 4.0.3.2
Tags: patch

kde based apps on my machines have Exec lines in their desktop files 
along the line of

Exec=okular %U %i -caption %c

when launched via the hosted applications mode applications menu of 
x2goclient the "%i -caption %c" get passed as arguments to the command 
directly.     That results in the program trying to load the file '%i' 
(and naturally failing) and setting the window caption to '%c'

The attached patch updates the x2go client to removes the %i param and 
replaces %c with the application name so the program is titled correctly.

Thanks
Jason

--------------000800080809020205060308
Content-Type: text/x-patch;
 name="onmainwin-icon-and-caption-exec.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="onmainwin-icon-and-caption-exec.patch"

--- old/onmainwindow.cpp	2015-03-18 20:36:52.771965135 +1300
+++ new/onmainwindow.cpp	2015-03-18 20:40:31.199962491 +1300
@@ -6442,6 +6442,8 @@
                 app.exec.replace(" %u","",Qt::CaseInsensitive);
                 app.exec.replace("%f","",Qt::CaseInsensitive);
                 app.exec.replace("%u","",Qt::CaseInsensitive);
+                app.exec.replace("%i","",Qt::CaseInsensitive);
+                app.exec.replace("%c",app.name,Qt::CaseInsensitive);
                 if (app.exec==autostartApp)
                     startAppFound=true;
                 //                 x2goDebug<<"exec: "<<app.exec<<endl;

--------------000800080809020205060308--

