Bug 338605

Summary: The QML code uses hardcoded icon paths
Product: [Unmaintained] telepathy Reporter: Martin Klapetek <mklapetek>
Component: call-uiAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kde, matt.scheirer
Priority: NOR    
Version: git-latest   
Target Milestone: 0.8.80   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Martin Klapetek 2014-08-27 21:32:16 UTC
An example:

    function changeHoldIcon(icon) {
        if (icon == "start") {
            hold.iconSource= "/usr/share/icons/oxygen/32x32/actions/media-playback-start.png"
        } else {
            hold.iconSource= "/usr/share/icons/oxygen/32x32/actions/media-playback-pause.png"
        }
    }
Comment 1 Matt Scheirer 2014-08-27 22:23:14 UTC
You can use iconName with a bunch of QML elements to specify icons according to the Freedesktop Naming Scheme (see here: http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html) that will inherit the users icon theme settings, and you can supply a fallback.

Here is an example from one of my other apps I just ripped out to show:

  Action {
    iconName: playing ? "media-playback-pause" : "media-playback-start"
    iconSource: playing ? "icons/kfaenza_media-pause.png" : "icons/kfaenza_media-play.png"
  }

If the iconName has a corresponding system icon, it uses that first. If it does not exist, it falls back to my specified iconSource, in which case I just bundled the kfaenza theme icons in case, but in my experience I've never found a circumstance where this fails. I don't use it anymore - this was just from some old code I had early on.

So instead of setting iconSource, set iconName.
Comment 2 David Edmundson 2014-08-27 22:25:08 UTC
Thanks, but I assume you're talking about QtQuick.Controls.

I'm afraid this is all Qt4 code, just to make our lives harder.
Comment 3 David Edmundson 2014-08-27 22:26:42 UTC
kdeclarative provided an icon:// image provider. 

Given we use use kdeclarative (hopefully?) it should mean it's added automagically.
Comment 4 Martin Klapetek 2014-08-27 22:49:34 UTC
> Given we use use kdeclarative (hopefully?)

Not as far as I see. Should be added then.
Comment 5 David Edmundson 2014-08-28 00:51:29 UTC
Git commit a82a6b998b56abc4f2a271f57b213fa25e4d0582 by David Edmundson.
Committed on 28/08/2014 at 00:52.
Pushed by davidedmundson into branch 'master'.

Set icons properly

Reviewed-by: Diane Trout

M  +1    -0    CMakeLists.txt
M  +1    -0    src/CMakeLists.txt
M  +6    -0    src/dtmf-qml.cpp
M  +8    -0    src/qml-interface.cpp
M  +1    -2    src/qml/core/ToggleButton.qml
M  +7    -7    src/qml/core/Toolbar.qml

http://commits.kde.org/telepathy-call-ui/a82a6b998b56abc4f2a271f57b213fa25e4d0582