Reply to topic

Use KRun to open the default file browser and select a file

silencer
Registered Member
Posts
9
Karma
0
Hi!

I have a QUrl that I'd like to open in the default file manager. I have also a string with a filename. Currently I'm doing:

Code: Select all
    QUrl url = contextManager()->currentDirUrl();
    KRun::runUrl(url, QStringLiteral("inode/directory"), Q_NULLPTR, KRun::RunFlags());

And this succesfully opens the directory with dolphin (my default file manager), but I can't find a way to make it select a file.
I could call "dolphin --select" but I don't want to tie the code to a sole file manager.

Is there any way to do this?

Thanks!

Reply to topic

Bookmarks



Who is online

Registered users: agrieg, Bing [Bot], boudewijn, Exabot [Bot], Google [Bot], jehojakim2, Majestic-12 [Bot], slowfish, Sogou [Bot], tobym, Yahoo [Bot]