mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: slightly better exec extraction in KOpenWithDialog
the matching could try basename and possibly second argument match tho, e.g. the Exec key value could be relative or full path and interpreter may be the first argument with the actual program (or script rather) second making the matching kinda hard to get right Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
aee3b7b3da
commit
25d81b76b9
1 changed files with 5 additions and 8 deletions
|
@ -55,14 +55,11 @@
|
|||
|
||||
static QString simplifiedExecLineFromService(const QString& fullExec)
|
||||
{
|
||||
QString exec = fullExec;
|
||||
exec.remove("%u", Qt::CaseInsensitive);
|
||||
exec.remove("%f", Qt::CaseInsensitive);
|
||||
exec.remove("-caption %c");
|
||||
exec.remove("-caption \"%c\"");
|
||||
exec.remove("%i");
|
||||
exec.remove("%m");
|
||||
return exec.simplified();
|
||||
QStringList args = KShell::splitArgs(fullExec);
|
||||
if (args.isEmpty()) {
|
||||
return QString();
|
||||
}
|
||||
return args.first().simplified();
|
||||
}
|
||||
|
||||
namespace KDEPrivate {
|
||||
|
|
Loading…
Add table
Reference in a new issue