{"action":"closed","issue":{"url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/issues/1020","repository_url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah","labels_url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/issues/1020/labels{/name}","comments_url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/issues/1020/comments","events_url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/issues/1020/events","html_url":"https://github.com/GoldenCheetah/GoldenCheetah/issues/1020","id":40502681,"number":1020,"title":"Wrong color determination from keywords settings","user":{"login":"robolaf","id":7139815,"avatar_url":"https://avatars.githubusercontent.com/u/7139815?v=3","gravatar_id":"","url":"https://api.github.com/users/robolaf","html_url":"https://github.com/robolaf","followers_url":"https://api.github.com/users/robolaf/followers","following_url":"https://api.github.com/users/robolaf/following{/other_user}","gists_url":"https://api.github.com/users/robolaf/gists{/gist_id}","starred_url":"https://api.github.com/users/robolaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robolaf/subscriptions","organizations_url":"https://api.github.com/users/robolaf/orgs","repos_url":"https://api.github.com/users/robolaf/repos","events_url":"https://api.github.com/users/robolaf/events{/privacy}","received_events_url":"https://api.github.com/users/robolaf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/labels/bug","name":"bug","color":"444444"},{"url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/labels/P1","name":"P1","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/milestones/4","html_url":"https://github.com/GoldenCheetah/GoldenCheetah/milestones/Parking%20Lot","labels_url":"https://api.github.com/repos/GoldenCheetah/GoldenCheetah/milestones/4/labels","id":341956,"number":4,"title":"Parking Lot","description":"Some Future Release -- but not the one currently being developed","creator":{"login":"liversedge","id":142876,"avatar_url":"https://avatars.githubusercontent.com/u/142876?v=3","gravatar_id":"","url":"https://api.github.com/users/liversedge","html_url":"https://github.com/liversedge","followers_url":"https://api.github.com/users/liversedge/followers","following_url":"https://api.github.com/users/liversedge/following{/other_user}","gists_url":"https://api.github.com/users/liversedge/gists{/gist_id}","starred_url":"https://api.github.com/users/liversedge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liversedge/subscriptions","organizations_url":"https://api.github.com/users/liversedge/orgs","repos_url":"https://api.github.com/users/liversedge/repos","events_url":"https://api.github.com/users/liversedge/events{/privacy}","received_events_url":"https://api.github.com/users/liversedge/received_events","type":"User","site_admin":false},"open_issues":81,"closed_issues":64,"state":"open","created_at":"2013-05-26T10:02:28Z","updated_at":"2016-08-05T19:06:06Z","due_on":"2019-01-01T00:00:00Z","closed_at":null},"comments":0,"created_at":"2014-08-18T15:52:02Z","updated_at":"2016-08-05T19:06:05Z","closed_at":"2016-08-05T19:06:05Z","body":"Here is my example (to keep it simple):\r\nI use the Keywords field in my rides to identify sport and whether it was training or competition:\r\n‘RUN COMP’ – running in competition\r\n‘RUN’ – running, training\r\n‘BIKE COMP’ – cycling in competition\r\n‘BIKE’ – cycling, training\r\n\r\nWhat I want to accomplish: RUN and BIKE shall have their own colors (lets say GREEN and BLUE), but if a ride(or run) was in a competition it shall be a separate color (RED) no matter what sport it was.\r\n\r\nTo do so, I use keywords for coloring, my list contains:\r\nCOMP – Red\r\nBIKE – BLUE\r\nRUN – GREEN\r\n(My assumption is that the highest entry has the highest priority.)\r\n\r\nCurrent result:\r\nThat actual coloring however, is that RUN and RUN COMP is drawn GREEN, BIKE in BLUE and BIKE COMP in RED.\r\n\r\nI made some analysis and found out that ‚metadata.xml‘ still contains the correct sequence of colors.\r\n\r\nHowever, a QMap is used to store the colors in class ColorEngine (Colors.cpp) and this is sorted => no matter what sequence I enter it will be sorted alphabetically:\r\nBIKE\r\nCOMP\r\nRUN\r\n\r\nNow in ColorEngine::colorFor it iterates over all entries -> the last hit of the list will determine the color\r\nImo here the first hit should be correct (this would save performance and prevent from putting the highest priority on the bottom)\r\n\r\nWould it be possible to:\r\na) instead of using QMap use something that keeps the color sequence entered by the user\r\nb) leave the foreach statement after the first hit\r\n\r\nThis would make the coloring much more predictable and useful. Many thanks for looking into it!\r\n"}}
{"actor":{"display_login":"liversedge"}}