Commit Graph

20 Commits

Author SHA1 Message Date
Santiago Gil 30e3fdb9cc Fix overflow in MoodbarProxyStyle (fixes #5638) (#5643) 2017-03-02 13:10:21 +00:00
Simon Marchi 725e1d8f0d moodbar: check QSlider max/min before using them in division
When switching playback from an item for which the moodbar is not
displayed (e.g. an internet stream), to an item for which it is
displayed (e.g. a local mp3 file), Clementine sometimes crashes.

This happens because the slider_opt->maximum and slider_opt->minimum
have the value 0 (their default value), and the difference is used as a
divisor.  This gives a division by 0, and a SIGFPE.

This problem has been fixed in commit af42cce.  However, when a9f9b0e
reverted 3f79fa5, a little to much was reverted and we lost what af42cce
did.  This patch re-introduces the fix.

Fixes #5261

moodbar: Add comment
2016-02-18 09:15:44 -05:00
v-fox a9f9b0ef72 Avoiding usage of pixelMetric because it breaks on non-Oxygen styling
Partial revertion for commit "3f79fa5c651f23e48faf1af6ca56dbff9e5660ab" because of
https://github.com/clementine-player/Clementine/issues/4770
2015-12-14 07:16:30 +05:00
Arnaud Bienner 47108a9a68 Add a message in CMake to notify that ccache has been found and will be used (+ some minor, unrelated things). 2014-08-06 20:05:41 +02:00
Mark Furneaux af42ccea38 Fix dbz possibility in moodbar
Took me forever to find this. Randomly happens when changing tracks.
2014-05-25 00:16:12 -04:00
John Maguire 24a4cff807 Merge pull request #4288 from sundrythoughts/rating-optimization
Increase performance of mass rating changes.
2014-05-20 12:42:39 +01:00
Joseph Freeman fe4a80b2d5 Removed commented-out code and ran make format. 2014-04-25 19:41:04 -04:00
Arnaud Bienner d49d818b37 Very minor style change 2014-04-23 00:40:06 +02:00
Arnaud Bienner 3f79fa5c65 Try to make the slider more accurate when moodbar is activated.
Previously, the slide wasn't displayed at the exact position where the user clicked, and the moodbar's width was equal to the slider's width, while it should have been as long as long the groove.
2014-04-23 00:03:30 +02:00
Sebastian J. Mielke e73450cf43 Moodbar-Trackslider uses the full available height
When determining the next state (for rendering the change), the slider widgets vertical SizePolicy is changed from Fixed to MinimumExpanding (same thing works the other way around).
2014-03-11 16:08:24 +01:00
John Maguire 3323c2d094 Convert all instances of foreach() to a C++11 for
find ext src -name '*.cpp' -exec \
    sed -i -e 's/foreach(\([^,]\+\),/for (\1 :/' {} \;
2014-02-10 14:43:32 +01:00
John Maguire bebd781fdf Reformat all non-3rd-party C/C++/Objective-C++.
Command line:
find src ext -regex '.*\.\(h\|cpp\|mm\)' -exec clang-format -i
 -style='{BasedOnStyle: Google, DerivePointerBinding: false}' {} \;
2014-02-07 16:34:20 +01:00
John Maguire 71893e4847 Use nullptr instead of NULL everywhere. 2014-02-06 17:29:59 +01:00
David Sansome 24ea8d3e05 Add moodbar settings to the track slider's context menu 2012-05-28 12:50:34 +01:00
David Sansome abdc6d8844 Add moodbar settings to the settings dialog 2012-05-27 23:56:40 +01:00
David Sansome 74a83a2f7c Draw the arrow on the moodbar before fading out 2012-05-27 21:51:26 +01:00
David Sansome 19c3e1d5ec Add a Mood column to the playlist 2012-05-27 16:46:16 +01:00
David Sansome f1dee1171b Move the moodbar rendering bits into another class 2012-05-25 23:56:55 +01:00
David Sansome bdfe6b909f Draw a slider arrow on the moodbar. 2012-05-25 23:34:56 +01:00
David Sansome e3cfd64764 Render the moodbar data in the slider widget, and write .mood files alongside music files. 2012-05-25 22:02:10 +01:00