This forum has been archived. All content is frozen. Please use KDE Discuss instead.

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

Tags: None
(comma "," separated)
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!


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]