Otherwise this results in the generic executable icon as bouncy cursor.
Details
- Reviewers
emmanuelp dfaure - Group Reviewers
Dolphin - Commits
- R318:b79ea9f5e4a8: Pass application name and icon to KRun
Is there some KRun magic to improve this, some way to get the "self" service?
- Pressed Ctrl+N, got a new Dolphin window and during loading now the Dolphin icon as bouncing cursor (is it intentional that open new windows opens on start page and not "clones" the current window?)
- Right clicked a folder, chose "open in new window", it opened fine and during it now the Dolphin icon as bouncing cursor
- Searched for a file, chose "open path in new window", it opened fine and during it now the Dolphin icon as bouncing cursor
- Chose "Open containing folder" in Krunner, invoked OpenFileManagerWindowJob which now also shows Dolphin icon during loading
I also tried using KIO::iconForUrl for the URL when opening but that usually resulted in a black and white symbolic icon which looked horrible, although it would have been cool if doing open containing folder for a downloaded file would show the folder-download icon while opening it. :)
Diff Detail
- Repository
- R318 Dolphin
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Seems like a valid fix.
BTW KAboutData::applicationData().displayName() is also qApp->applicationDisplayName(), which seems better (no need to depend on KAboutData just for that).
The other way is KService::serviceByDesktopName("org.kde.dolphin") and KRun::runService.
Technically it has the advantage of using kdeinit5 unlike the KRun::run solution (but these days this matters less I suppose).
It has the disadvantage that it breaks if someone removes org.kde.dolphin.desktop completely, but that's not really a valid use case (when you remove installed files stuff breaks, duh).
Nice!
Can you please add a new function to global.h which encapsulates all this?
Maybe "Dolphin::openNewWindow(urls, flags = None)"
- Introduce Dolphin::openNewWindow
- Use qApp applicationDisplayName() (I didn't find it because I was only looking for displayName without the prefix ;)
src/global.cpp | ||
---|---|---|
62 ↗ | (On Diff #12259) | activeWindow is a bit fragile IMHO. It could be anything, including a "new folder" dialog or an error messagebox or whatever else. That would be a weird parent for any new error messageboxes from KRun. |
src/global.cpp | ||
---|---|---|
62 ↗ | (On Diff #12259) | Ok you are right, let's keep it that way. |