You probably want KIO::highlightInFileManager(), which was made for exactly this purpose.

Nate


On 10/13/2017 03:55 PM, Rodrigo Pelorosso wrote:
Hi!

I have a KService that I've found using KMimeTypeTrader::self()->preferredService and let's say I know it's Dolphin. I'd like to run Dolphin telling it to open a folder and select a file in particular. I know that from the command line I could do

dolphin --select /home/silencer/lines.svg

So I thought passing --select /home/silencer/lines.svg as parameter when executing Dolphin using KRun::runApplication would work, like this:

QList<QUrl> list;
list.append(QUrl("--select /home/silencer/lines.svg"));
KRun::runApplication(*fileBrowserApp, list, Q_NULLPTR);

but if I do that I receive the error:

Unknown option 'select /home/silencer/lines.svg'.

 From the command line I can generate this error calling Dolphin with:

dolphin --"select /home/silencer/lines.svg"

What would be the correct way of passing this kind of parameter to the app using KRun::runApplication?

Thank you in advance, and please let me know if I can provide any other information,

regards!
Rodrigo





Reply via email to