diff --git a/media-sound/mixxx/Manifest b/media-sound/mixxx/Manifest index f8f4296..af67617 100644 --- a/media-sound/mixxx/Manifest +++ b/media-sound/mixxx/Manifest @@ -1,5 +1,5 @@ AUX mixxx-2.0.0-docs.patch 435 BLAKE2B c2e9b09abb293e59b2af49527eccf07c9488ae5e30e29e6c4d6330cc298a568ee7dd7014af6b9c1f1c4d98b8c11c96da7f74660eb4b3b522f449e7a6a431addc SHA512 01ab76466f782f538c894e460f7694553ae12804651f68aabb6aaa0dbdc89e2ff7e2b51529b0f112cee42c8053b75fc64241a9c8898def8cf1c76231b1ec5d59 -AUX mixxx-2.1.0-beatsync-fix.patch 3892 BLAKE2B 427ebd19f459174cafd0fb89c3baea59d03029baae6a70b9dc7f0d78c319c3fe6f62b257df35b5f31bab86adbf2720ae2a6d2ffbf3f52cb8a648a138b04a992b SHA512 7ef778ac2b4abe7b896f6f44154ae819f6753c17a4760d06cabdc4a3fae6d25473b087036adc9e1b728f05f03ac9982a0df05c25e690240a1484ce892e068651 +AUX mixxx-2.1.0-beatsync-fix.patch 23078 BLAKE2B c2156099cc1ed69d52c852d5a2b0f4f8cb9f06472b47a153c9f753b44d1ed84c354e16bddced6c6e618b6f65a2c11125052ee71d5d0018f8c3998477023a1a0c SHA512 c02606d5ffaa7f9a726600820afff35e92b8477e96b7a06991eae21a9368a5ed36c1720d4189fc3a1b448dc32434953a5cb02bca08692d43cb9d5e73f4d63a30 AUX mixxx-2.1.0-components-js-fixes.patch 3370 BLAKE2B ff9295a8c938e9c3a526e206792cd27cd4025ea07ede79da844cbd80565f10020b8856bdfbb2cf7557dba0bc8b3d775eb10c45f689d975aad13c35a22705a4a0 SHA512 ff27ad09b119bbf51e678a84c5eb60f9c6822a55160ea9d175f043caa33005d311d10366c91a1b7f402e6d7039cabac675aa35f893f02efe0015e831f2751bc8 AUX mixxx-2.1.0-debug-assert-and-fix-false-poisitiv-restart-request.patch 5694 BLAKE2B 7732252cf6438df9d52e6de8ceaaf6b2e1c30e35d8154eb7af5d94641346117d4ab0b5501686909d35c81a5fd5aa9442831f11b66faaec782c11a55e14a11363 SHA512 ee35ea84db8bf91cd2f14dd779faa91857df7bcc376525d533e65c778e241a5e66c829ab208e2da5d4afb3a48571042c13e5092c4974a07a9ea11146df68d326 AUX mixxx-2.1.0-deere-add-gain-knob-to-expanded-sampler-view.patch 1116 BLAKE2B a32d877d6877a2dfc3b12b1dc6e6b40342120a735aa35814d203a7c9e5581f40ec9950c5732f6698e4facbe0e3b98d278e1c2ca39c880e141d863e3042407863 SHA512 8b7093ded2c79ab7f7adc7b578f3b349a364fe5c3d01a4617184a64f30799f336d5911221f79478bf8e61159b99144584efef1add0df835fa84d309ba68ea0cb @@ -26,6 +26,7 @@ AUX mixxx-2.1.0-fix-spinback-inertia-effect-partial-revert-of-2b612c2.patch 1151 AUX mixxx-2.1.0-fix-unresponsive-scrolling-through-crates-and-playlists-using-encoder.patch 10554 BLAKE2B fedfdb247f55ac438635a527e30b132386e95f40143c26b581f6929a45126b7d97a4ea98d84582a6dded002afa623a7fac3a0f1e2e03499e592967df0fbe7646 SHA512 18b3d51f5c341e412f9fae2bb596ef569906e628ea5102d35864f299be2c2f21853833964b0566f4c3c6a964ee52627eb6ec0982ebc3d4151b3e6210765504e1 AUX mixxx-2.1.0-library-improvements-for-all-skins-fix-lp1772202-in-tango.patch 252028 BLAKE2B b74c8052548f7c65bf15300fefa998d619ab82ec073d162e7d6f856a3ea1626f6882c57f2e12cf9981e031390ee7aa476f349c1f33a8cad5c1ca68a2609e2dd3 SHA512 95442eb5cd8699d3e00d22baa76d4d41209f632a9fce04612dcf9fba598f00567546162f6375cdbd8922e8a61fc91c137847b166f1a8ced8fdb47eb4f8a92e17 AUX mixxx-2.1.0-optimize-flac-decoding.patch 9430 BLAKE2B f3d0b707f69332f94db54416fc9a9a6374302853daa8fb3046048e66f25259081f9bbe46c1dc8620076904a7f1a57abf051be0db3af02378ac9df06dc353f765 SHA512 5d244f8fe606eab6c6bea64439a520ada568dd2681d05fcdbdd1abebabf5bc74eecf3aa67765f4d2d78295a9a87c9ca7746cfc59cfd5db1a4b8a085f36b95cd6 +AUX mixxx-2.1.0-os-theme-shining-though-fix.patch 40146 BLAKE2B 1b0b86d5bc8234b602aa1c531590a2ef5672228973d6c4f95d37c90d530a4648bfd61eb4e4b2acc8d34e6257d34ef4346771fe56e14fd66285a22affb6b33dee SHA512 ef218d086ee03355f3bc777788621d4e6a2b2515907dd86662cce3c87122ae6c12aa837a08404f96c4fd41dfdeffc8ad6f25bd455f760614b7a34fc4bbde096b AUX mixxx-2.1.0-pioneer-ddj-sx-mapping-bugfixes.patch 11255 BLAKE2B 9e15935f3fcfe9e26c04960496998450ee15cf8eb7b98e0439064caf9653617b94e0bf4c93f13ee49d169accabe662f9f8ca2abea05559b91d7f5362225de1c9 SHA512 f4774fe4884d339f2929468551b2f248200f3dc1c31c436070c8a439d18cf524aab0dd7ca990595e0c88ddd70e1e71dee025a641df6d240724fec94f2087ebd0 AUX mixxx-2.1.0-qt5-2.1.patch 20604 BLAKE2B 97b0145e68de1622020b52f08b9160fd23a7d9e42469201e40d93779eba903c496728a517ba274468de572a7714cfb0353859e76a380002219c39deb3fd23943 SHA512 8856aaa2d3c870a684d3e78deea2e162b00c96e3d64405615066430984525abcb71cc07c9f1dc0cdd18161ebb1aff8c1ebe223d21c3f3c4d3e92f3c38da3ffab AUX mixxx-2.1.0-reduce-log-spam-from-soundsourceproxy.patch 1791 BLAKE2B 84f51305c1054bc1ac50e59abf1fbad01f07dd316592fb6fdcbe268d19d19400c9a99e54ec74674c73632b8e443f25168f262eaa02e221204d0c3eb9320f3609 SHA512 d58f42be3b711df919e50ed2e665f95f63b265c6571e5b8109f2c7977f823d0360c8bd5e0618912d4c0d15a92a8ee673320fbd23c9fc2d75bd3a78aea0f9558b @@ -35,4 +36,4 @@ AUX mixxx-2.1.0-update-american-audio-vms4-preset-for-mixxx-v2.1.x.patch 26106 B AUX mixxx-2.1.0-use-an-in-memory-database-to-speed-up-library-tests.patch 3086 BLAKE2B d2cb0b7992cdb07b1ba2accde1d272cd3f75adf8bd3bb2450ad9203db5d7978c9b29dbf6e278a2a1f1fb8fb84f28b23f276f0f999b3e5d77c272b91716dcc9f1 SHA512 a6fefbc80f8facc8cd0bf501858b4dadb6ebe4bf476dc97273ad7e97ae2c0840ca9bd6b0b3aaa34caa837b967ee7fa12635c7c2957241ca6aff5a26531b6e25f AUX mixxx-2.1.0-use-new-link-to-updated-2-1-feedback-form.patch 1091 BLAKE2B 49cd235c8bde044e9394f8b2b651714c793edcefd8a381954e3fa6e788e8277eab2370afe7d5523f8d6b0eb47277173fd757182f9b21a20e408bdb8931fd2f00 SHA512 c344991a8dbcf473ef368d5d6296fb598450d36cc22051669e496b35fdd7feb90c15dcf2c2ca53cf341e3b07b946f2f926b23fef10cba448d5eb5dadc29f8448 DIST mixxx-2.1.0-src.tar.gz 34835250 BLAKE2B 7a90c3794a146001fd0df6bb7c9c6231c0d26814eafc5c83da666d511d7af0e193b75da9b8728ad399dbef208cf2437881df2c87818e503945b02591bc300567 SHA512 d9f4fab92c2896ec455e2041aa6033f9a9091d2915a185a99427b9c35afe7c99565350ce477bf0487c6276c9585875f0be61f310779ae90195917d2e995bbf90 -EBUILD mixxx-2.1.0.ebuild 5463 BLAKE2B 099ec82f92155580e8d2e4232a0a0cfb3f88f521c820087983a02b59910763ed402945ef5943dce93b48ea849d1dc5c277870d7ac49367535594aa559e44dec1 SHA512 466ee536bf0f5b57fbf602615524ff266c77fec67c649389f747139058e903bb51626f873f452b71728792a8af925e59edb3fa16ac3749b0ca0bb8b5b33f4e5f +EBUILD mixxx-2.1.0.ebuild 5517 BLAKE2B 207fca5f0783d47a5a60e2ae8df69fb144de97b0b06056c7f0d47a9ef22823bde009d2ef0778f3d6a666a4fde2715968d8ff2d2de97e52d84166ae8a75077ea5 SHA512 69b98c641a0e5cc4bd6ad9ddd9a64cc3481bc6273fa0416000e04e20f4e42d6b26b8a1ec1b8f97b506b0c4f1a6ba0074c220c48becdbc88788fe75b6e332f4ec diff --git a/media-sound/mixxx/files/mixxx-2.1.0-beatsync-fix.patch b/media-sound/mixxx/files/mixxx-2.1.0-beatsync-fix.patch index e3b6548..875bc5d 100644 --- a/media-sound/mixxx/files/mixxx-2.1.0-beatsync-fix.patch +++ b/media-sound/mixxx/files/mixxx-2.1.0-beatsync-fix.patch @@ -1,7 +1,7 @@ -From 5b656450844d09f41afbb2cccbec74ef3b72eb99 Mon Sep 17 00:00:00 2001 +From 0783a13514f35e679059076c9cabed708baa844a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 22 May 2018 02:29:42 +0200 -Subject: [PATCH 1/2] fix beatsync control syncing phase, an old regression +Subject: [PATCH 1/8] fix beatsync control syncing phase, an old regression since 2.0 --- @@ -40,10 +40,10 @@ index 1218f017b6..42087bc248 100644 } if (position != m_filepos_play) { -From f762d52d65c63bcfac7604011b231019d605dd97 Mon Sep 17 00:00:00 2001 +From c65d450f9962ea834a55d6aec6749b2f7524cb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 22 May 2018 02:37:31 +0200 -Subject: [PATCH 2/2] Added beatsync to right click on sync in Shade and Deere, +Subject: [PATCH 2/8] Added beatsync to right click on sync in Shade and Deere, fixes bug #1772526 --- @@ -85,3 +85,453 @@ index ad3cabd6d2..494901128a 100644 RightButton + +From ef28e682392d61ccf44189dba8807e7b0926eff4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Wed, 30 May 2018 20:39:59 +0200 +Subject: [PATCH 3/8] Restore quantize dependency of sync_enable lost in a + previous commit + +--- + src/engine/sync/enginesync.cpp | 5 ++--- + src/engine/sync/internalclock.cpp | 2 +- + src/engine/sync/internalclock.h | 2 +- + src/engine/sync/syncable.h | 2 +- + src/engine/sync/synccontrol.cpp | 14 +++++++++++--- + src/engine/sync/synccontrol.h | 3 ++- + 6 files changed, 18 insertions(+), 10 deletions(-) + +diff --git a/src/engine/sync/enginesync.cpp b/src/engine/sync/enginesync.cpp +index 955ef7c52a..9b0436e95e 100644 +--- a/src/engine/sync/enginesync.cpp ++++ b/src/engine/sync/enginesync.cpp +@@ -165,9 +165,8 @@ void EngineSync::requestEnableSync(Syncable* pSyncable, bool bEnabled) { + foundPlayingDeck = true; + } + activateFollower(pSyncable); +- if (foundPlayingDeck && pSyncable->isPlaying()) { +- // Users also expect phase to be aligned when they press the sync button. +- pSyncable->requestSyncPhase(); ++ if (foundPlayingDeck) { ++ pSyncable->requestSync(); + } + } else { + // Already disabled? Do nothing. +diff --git a/src/engine/sync/internalclock.cpp b/src/engine/sync/internalclock.cpp +index 0b013d7bc3..2629ed79fe 100644 +--- a/src/engine/sync/internalclock.cpp ++++ b/src/engine/sync/internalclock.cpp +@@ -54,7 +54,7 @@ void InternalClock::notifyOnlyPlayingSyncable() { + // No action necessary. + } + +-void InternalClock::requestSyncPhase() { ++void InternalClock::requestSync() { + // TODO(owilliams): This should probably be how we reset the internal beat distance. + } + +diff --git a/src/engine/sync/internalclock.h b/src/engine/sync/internalclock.h +index b3d7f3fa7a..407497f5b1 100644 +--- a/src/engine/sync/internalclock.h ++++ b/src/engine/sync/internalclock.h +@@ -29,7 +29,7 @@ class InternalClock : public QObject, public Clock, public Syncable { + + void notifySyncModeChanged(SyncMode mode); + void notifyOnlyPlayingSyncable(); +- void requestSyncPhase(); ++ void requestSync(); + SyncMode getSyncMode() const { + return m_mode; + } +diff --git a/src/engine/sync/syncable.h b/src/engine/sync/syncable.h +index 033f8b268c..7139082841 100644 +--- a/src/engine/sync/syncable.h ++++ b/src/engine/sync/syncable.h +@@ -37,7 +37,7 @@ class Syncable { + virtual void notifyOnlyPlayingSyncable() = 0; + + // Notify a Syncable that they should sync phase. +- virtual void requestSyncPhase() = 0; ++ virtual void requestSync() = 0; + + // Must NEVER return a mode that was not set directly via + // notifySyncModeChanged. +diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp +index a516e6e5cc..89fded5706 100644 +--- a/src/engine/sync/synccontrol.cpp ++++ b/src/engine/sync/synccontrol.cpp +@@ -72,6 +72,8 @@ SyncControl::SyncControl(const QString& group, UserSettingsPointer pConfig, + m_pEjectButton->connectValueChanged( + SLOT(slotEjectPushed(double)), Qt::DirectConnection); + ++ m_pQuantize = new ControlProxy(group, "quantize", this); ++ + // BPMControl and RateControl will be initialized later. + } + +@@ -161,12 +163,18 @@ void SyncControl::notifyOnlyPlayingSyncable() { + m_pBpmControl->resetSyncAdjustment(); + } + +-void SyncControl::requestSyncPhase() { +- m_pChannel->getEngineBuffer()->requestSyncPhase(); ++void SyncControl::requestSync() { ++ if (isPlaying() && m_pQuantize->toBool()) { ++ // only sync phase if the deck is playing and if quantize is enabled. ++ // this way the it is up to the user to decide if a seek is desired or not. ++ // This is helpfull if the beatgrid of the track doe not fit at the current ++ // payposition ++ m_pChannel->getEngineBuffer()->requestSyncPhase(); ++ } + } + + bool SyncControl::isPlaying() const { +- return m_pPlayButton->get() > 0.0; ++ return m_pPlayButton->toBool(); + } + + double SyncControl::getBeatDistance() const { +diff --git a/src/engine/sync/synccontrol.h b/src/engine/sync/synccontrol.h +index 7af10a3048..d5020cde64 100644 +--- a/src/engine/sync/synccontrol.h ++++ b/src/engine/sync/synccontrol.h +@@ -31,7 +31,7 @@ class SyncControl : public EngineControl, public Syncable { + SyncMode getSyncMode() const; + void notifySyncModeChanged(SyncMode mode); + void notifyOnlyPlayingSyncable(); +- void requestSyncPhase(); ++ void requestSync(); + bool isPlaying() const; + + double getBeatDistance() const; +@@ -136,6 +136,7 @@ class SyncControl : public EngineControl, public Syncable { + ControlProxy* m_pPassthroughEnabled; + ControlProxy* m_pEjectButton; + ControlProxy* m_pSyncPhaseButton; ++ ControlProxy* m_pQuantize; + }; + + + +From 6ab15f8f999df41ea98f2247bef7e9296df796d6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Wed, 30 May 2018 23:11:28 +0200 +Subject: [PATCH 4/8] Added the test SyncPhaseToIfQuantize + +--- + src/test/enginesynctest.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 49 insertions(+) + +diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp +index 1f6c1ad504..e8b08e59b9 100644 +--- a/src/test/enginesynctest.cpp ++++ b/src/test/enginesynctest.cpp +@@ -1429,3 +1429,52 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) { + EXPECT_EQ(0.0, + ControlObject::getControl(ConfigKey(m_sGroup1, "local_bpm"))->get()); + } ++ ++TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) { ++ auto pButtonSyncEnabled1 = std::make_unique(m_sGroup1, "sync_enabled"); ++ auto pFileBpm1 = std::make_unique(m_sGroup1, "file_bpm"); ++ ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->set(0.2); ++ pFileBpm1->set(130.0); ++ BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 130, 0.0); ++ m_pTrack1->setBeats(pBeats1); ++ ++ auto pButtonSyncEnabled2 = std::make_unique(m_sGroup2, "sync_enabled"); ++ auto pFileBpm2 = std::make_unique(m_sGroup2, "file_bpm"); ++ ControlObject::getControl(ConfigKey(m_sGroup2, "beat_distance"))->set(0.8); ++ ControlObject::getControl(ConfigKey(m_sGroup2, "rate"))->set(getRateSliderValue(1.0)); ++ BeatsPointer pBeats2 = BeatFactory::makeBeatGrid(*m_pTrack2, 100, 0.0); ++ m_pTrack2->setBeats(pBeats2); ++ pFileBpm2->set(100.0); ++ ++ ControlObject::getControl(ConfigKey(m_sGroup1, "play"))->set(1.0); ++ ControlObject::getControl(ConfigKey(m_sGroup2, "play"))->set(1.0); ++ ProcessBuffer(); ++ ++ // first test without quantisation ++ pButtonSyncEnabled1->set(1.0); ++ ProcessBuffer(); ++ // 0.02 where set after testing both cases. ++ EXPECT_LT(0.02, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get()); ++ pButtonSyncEnabled1->set(0.0); ++ ++ ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(1.0); ++ ProcessBuffer(); ++ ++ pButtonSyncEnabled1->set(1.0); ++ ProcessBuffer(); ++ ++ // 0.07 where set by after testing both cases. ++ EXPECT_LT(0.07, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get()); ++ pButtonSyncEnabled1->set(0.0); ++ ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(0.0); ++ ProcessBuffer(); ++ ++ ControlObject::getControl(ConfigKey(m_sGroup1, "beatsync_phase"))->set(1.0); ++ ProcessBuffer(); ++ ++ // 0.1162 where set by after testing both cases. ++ EXPECT_LT(0.1162, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get()); ++} ++ ++ ++ + +From 4853ddc7db9b26cb04ecafbaeac7adf37aadf190 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Thu, 31 May 2018 21:48:29 +0200 +Subject: [PATCH 5/8] Restore quantize dependency of beatsync lost in a + previous commit + +--- + src/controllers/controlpickermenu.cpp | 1 + + src/engine/bpmcontrol.cpp | 11 ++++++++--- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp +index 674a3e0639..fbab5f67ab 100644 +--- a/src/controllers/controlpickermenu.cpp ++++ b/src/controllers/controlpickermenu.cpp +@@ -115,6 +115,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent) + tr("Sync mode 3-state toggle (OFF, FOLLOWER, MASTER)"), syncMenu); + addDeckAndSamplerControl("beatsync", tr("Beat Sync One-Shot"), + tr("One-time beat sync (tempo and phase)"), syncMenu); ++ // TODO: phase depends on quantize + addDeckAndSamplerControl("beatsync_tempo", tr("Sync Tempo One-Shot"), + tr("One-time beat sync (tempo only)"), syncMenu); + addDeckAndSamplerControl("beatsync_phase", tr("Sync Phase One-Shot"), +diff --git a/src/engine/bpmcontrol.cpp b/src/engine/bpmcontrol.cpp +index 06dbaf9af5..eec368e449 100644 +--- a/src/engine/bpmcontrol.cpp ++++ b/src/engine/bpmcontrol.cpp +@@ -234,10 +234,15 @@ void BpmControl::slotControlBeatSyncTempo(double v) { + + void BpmControl::slotControlBeatSync(double v) { + if (!v) return; ++ if (!syncTempo()) { ++ // syncTempo failed, nothing else to do ++ return; ++ } + +- // If the player is playing, and adjusting its tempo succeeded, adjust its +- // phase so that it plays in sync. +- if (syncTempo() && m_pPlayButton->get() > 0) { ++ // Also sync phase if quantize is enabled. ++ // this is used from controller scripts, where the latching behaviour of ++ // the sync_enable CO cannot be used ++ if (m_pPlayButton->toBool() && m_pQuantize->toBool()) { + getEngineBuffer()->requestSyncPhase(); + } + } + +From 8d82ec8a01893f693deef7c71fffcb8004a68340 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Fri, 1 Jun 2018 10:19:58 +0200 +Subject: [PATCH 6/8] extend test for beatsync + +--- + src/test/enginesynctest.cpp | 49 ++++++++++++++++++++++++++++++++------------- + 1 file changed, 35 insertions(+), 14 deletions(-) + +diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp +index e8b08e59b9..dac5d6e5bc 100644 +--- a/src/test/enginesynctest.cpp ++++ b/src/test/enginesynctest.cpp +@@ -1432,48 +1432,69 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) { + + TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) { + auto pButtonSyncEnabled1 = std::make_unique(m_sGroup1, "sync_enabled"); ++ auto pButtonBeatsync1 = std::make_unique(m_sGroup1, "beatsync"); ++ auto pButtonBeatsyncPhase1 = std::make_unique(m_sGroup1, "beatsync_phase"); ++ + auto pFileBpm1 = std::make_unique(m_sGroup1, "file_bpm"); +- ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->set(0.2); ++ ControlObject::set(ConfigKey(m_sGroup1, "beat_distance"), 0.2); + pFileBpm1->set(130.0); + BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(*m_pTrack1, 130, 0.0); + m_pTrack1->setBeats(pBeats1); + + auto pButtonSyncEnabled2 = std::make_unique(m_sGroup2, "sync_enabled"); + auto pFileBpm2 = std::make_unique(m_sGroup2, "file_bpm"); +- ControlObject::getControl(ConfigKey(m_sGroup2, "beat_distance"))->set(0.8); +- ControlObject::getControl(ConfigKey(m_sGroup2, "rate"))->set(getRateSliderValue(1.0)); ++ ControlObject::set(ConfigKey(m_sGroup2, "beat_distance"), 0.8); ++ ControlObject::set(ConfigKey(m_sGroup2, "rate"), getRateSliderValue(1.0)); + BeatsPointer pBeats2 = BeatFactory::makeBeatGrid(*m_pTrack2, 100, 0.0); + m_pTrack2->setBeats(pBeats2); + pFileBpm2->set(100.0); + +- ControlObject::getControl(ConfigKey(m_sGroup1, "play"))->set(1.0); +- ControlObject::getControl(ConfigKey(m_sGroup2, "play"))->set(1.0); ++ ControlObject::set(ConfigKey(m_sGroup1, "play"), 1.0); ++ ControlObject::set(ConfigKey(m_sGroup2, "play"), 1.0); + ProcessBuffer(); + + // first test without quantisation + pButtonSyncEnabled1->set(1.0); + ProcessBuffer(); +- // 0.02 where set after testing both cases. +- EXPECT_LT(0.02, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get()); ++ ASSERT_DOUBLE_EQ(0.025155996658969195, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance"))); + pButtonSyncEnabled1->set(0.0); + +- ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(1.0); ++ ControlObject::set(ConfigKey(m_sGroup1, "quantize"), 1.0); + ProcessBuffer(); + + pButtonSyncEnabled1->set(1.0); + ProcessBuffer(); + +- // 0.07 where set by after testing both cases. +- EXPECT_LT(0.07, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get()); ++ ASSERT_DOUBLE_EQ(0.077604743399185772, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance"))); + pButtonSyncEnabled1->set(0.0); +- ControlObject::getControl(ConfigKey(m_sGroup1, "quantize"))->set(0.0); ++ ControlObject::set(ConfigKey(m_sGroup1, "quantize"), 0.0); ++ ProcessBuffer(); ++ ++ pButtonBeatsyncPhase1->set(1.0); + ProcessBuffer(); + +- ControlObject::getControl(ConfigKey(m_sGroup1, "beatsync_phase"))->set(1.0); ++ // 0.11632139450713055 in case "beatsync_phase" fails ++ ASSERT_DOUBLE_EQ(0.11610813658949772, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance"))); ++ ++ ++ ControlObject::set(ConfigKey(m_sGroup1, "beat_distance"), 0.2); ++ ControlObject::set(ConfigKey(m_sGroup1, "rate"), 1.0); ++ ProcessBuffer(); ++ pButtonBeatsync1->set(1.0); + ProcessBuffer(); + +- // 0.1162 where set by after testing both cases. +- EXPECT_LT(0.1162, ControlObject::getControl(ConfigKey(m_sGroup1, "beat_distance"))->get()); ++ // 0.15480806100370784 in case quantize is enabled ++ ASSERT_DOUBLE_EQ(0.16263690384739582, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance"))); ++ ++ ProcessBuffer(); ++ ++ ControlObject::set(ConfigKey(m_sGroup1, "quantize"), 1.0); ++ pButtonBeatsync1->set(1.0); ++ ProcessBuffer(); ++ ++ // 0.19933910991038406 in case quantize is disabled ++ ASSERT_DOUBLE_EQ(0.19350798541791794, ControlObject::get(ConfigKey(m_sGroup1, "beat_distance"))); ++ + } + + + +From f2437fcd27671d3c87bc0eedac7e90aca476a368 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Fri, 1 Jun 2018 10:39:43 +0200 +Subject: [PATCH 7/8] Change right click sync to beatsync_phase, for the case + permanent adjustment via quantize is not deired. + +--- + res/skins/Deere/deck_tempo_column.xml | 2 +- + res/skins/LateNight/deck.xml | 2 +- + res/skins/Shade/deck.xml | 2 +- + res/skins/Tango/rate_pitch_key.xml | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/res/skins/Deere/deck_tempo_column.xml b/res/skins/Deere/deck_tempo_column.xml +index d7de70df24..0ecda823ea 100644 +--- a/res/skins/Deere/deck_tempo_column.xml ++++ b/res/skins/Deere/deck_tempo_column.xml +@@ -28,7 +28,7 @@ + + + ,sync_enabled +- ,beatsync ++ ,beatsync_phase + + + +diff --git a/res/skins/LateNight/deck.xml b/res/skins/LateNight/deck.xml +index 245b7d6509..7791f9cabd 100644 +--- a/res/skins/LateNight/deck.xml ++++ b/res/skins/LateNight/deck.xml +@@ -281,7 +281,7 @@ + LeftButton + + +- ,beatsync ++ ,beatsync_phase + RightButton + + +diff --git a/res/skins/Shade/deck.xml b/res/skins/Shade/deck.xml +index 494901128a..368ab2c7c6 100644 +--- a/res/skins/Shade/deck.xml ++++ b/res/skins/Shade/deck.xml +@@ -450,7 +450,7 @@ + LeftButton + + +- [Channel],beatsync ++ [Channel],beatsync_phase + RightButton + + +diff --git a/res/skins/Tango/rate_pitch_key.xml b/res/skins/Tango/rate_pitch_key.xml +index 7af6103531..9da83e13fa 100644 +--- a/res/skins/Tango/rate_pitch_key.xml ++++ b/res/skins/Tango/rate_pitch_key.xml +@@ -113,7 +113,7 @@ Variables: + SyncButtonOverlay + 50f,18min + ,sync_enabled +- ,rate_set_default ++ ,beatsync_phase + + + BpmLabel + +From 55715f11b36b5616c114b1ff9a9174b34af36d4c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Fri, 8 Jun 2018 18:04:40 +0200 +Subject: [PATCH 8/8] fix typos + +--- + src/engine/sync/synccontrol.cpp | 4 ++-- + src/test/enginesynctest.cpp | 4 +--- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp +index 89fded5706..dc98717b14 100644 +--- a/src/engine/sync/synccontrol.cpp ++++ b/src/engine/sync/synccontrol.cpp +@@ -167,8 +167,8 @@ void SyncControl::requestSync() { + if (isPlaying() && m_pQuantize->toBool()) { + // only sync phase if the deck is playing and if quantize is enabled. + // this way the it is up to the user to decide if a seek is desired or not. +- // This is helpfull if the beatgrid of the track doe not fit at the current +- // payposition ++ // This is helpful if the beatgrid of the track doe not fit at the current ++ // playposition + m_pChannel->getEngineBuffer()->requestSyncPhase(); + } + } +diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp +index dac5d6e5bc..ca5b6db8a5 100644 +--- a/src/test/enginesynctest.cpp ++++ b/src/test/enginesynctest.cpp +@@ -1430,7 +1430,7 @@ TEST_F(EngineSyncTest, ZeroBpmNaturalRate) { + ControlObject::getControl(ConfigKey(m_sGroup1, "local_bpm"))->get()); + } + +-TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) { ++TEST_F(EngineSyncTest, QuantizeImpliesSyncPhase) { + auto pButtonSyncEnabled1 = std::make_unique(m_sGroup1, "sync_enabled"); + auto pButtonBeatsync1 = std::make_unique(m_sGroup1, "beatsync"); + auto pButtonBeatsyncPhase1 = std::make_unique(m_sGroup1, "beatsync_phase"); +@@ -1497,5 +1497,3 @@ TEST_F(EngineSyncTest, SyncPhaseToIfQuantize) { + + } + +- +- diff --git a/media-sound/mixxx/files/mixxx-2.1.0-os-theme-shining-though-fix.patch b/media-sound/mixxx/files/mixxx-2.1.0-os-theme-shining-though-fix.patch new file mode 100644 index 0000000..13fe9aa --- /dev/null +++ b/media-sound/mixxx/files/mixxx-2.1.0-os-theme-shining-though-fix.patch @@ -0,0 +1,1059 @@ +From 1a3ea722783f0cf55bbf090a831993ff0d8950b6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Mon, 28 May 2018 00:17:16 +0200 +Subject: [PATCH 1/4] Draw background for library cover art and peview coloumn, + fixing LP1773709 + +--- + src/library/coverartdelegate.cpp | 28 +++++++++++++++++++++++++++- + src/library/coverartdelegate.h | 2 ++ + src/library/previewbuttondelegate.cpp | 27 ++++++++++++++++++++++++--- + 3 files changed, 53 insertions(+), 4 deletions(-) + +diff --git a/src/library/coverartdelegate.cpp b/src/library/coverartdelegate.cpp +index 548e9d5a8f..c500217421 100644 +--- a/src/library/coverartdelegate.cpp ++++ b/src/library/coverartdelegate.cpp +@@ -7,6 +7,7 @@ + + CoverArtDelegate::CoverArtDelegate(QObject *parent) + : QStyledItemDelegate(parent), ++ m_pTableView(qobject_cast(parent)), + m_bOnlyCachedCover(false), + m_iCoverColumn(-1), + m_iCoverSourceColumn(-1), +@@ -84,14 +85,37 @@ void CoverArtDelegate::slotCoverFound(const QObject* pRequestor, + void CoverArtDelegate::paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const { ++ ++ painter->save(); ++ painter->setClipRect(option.rect); ++ ++ if (m_pTableView != NULL) { ++ QStyle* style = m_pTableView->style(); ++ if (style != NULL) { ++ style->drawControl(QStyle::CE_ItemViewItem, &option, painter, ++ m_pTableView); ++ } ++ } ++ ++ // Set the palette appropriately based on whether the row is selected or ++ // not. We also have to check if it is inactive or not and use the ++ // appropriate ColorGroup. ++ QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ++ ? QPalette::Normal : QPalette::Disabled; ++ if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) ++ cg = QPalette::Inactive; ++ + if (option.state & QStyle::State_Selected) { +- painter->fillRect(option.rect, option.palette.highlight()); ++ painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); ++ } else { ++ painter->setBrush(option.palette.color(cg, QPalette::Text)); + } + + CoverArtCache* pCache = CoverArtCache::instance(); + if (pCache == NULL || m_iIdColumn == -1 || m_iCoverSourceColumn == -1 || + m_iCoverTypeColumn == -1 || m_iCoverLocationColumn == -1 || + m_iCoverHashColumn == -1) { ++ painter->restore(); + return; + } + +@@ -101,6 +125,7 @@ void CoverArtDelegate::paint(QPainter *painter, + + // We don't support types other than METADATA or FILE currently. + if (info.type != CoverInfo::METADATA && info.type != CoverInfo::FILE) { ++ painter->restore(); + return; + } + +@@ -131,4 +156,5 @@ void CoverArtDelegate::paint(QPainter *painter, + // we can request an update. + m_cacheMissRows.append(index.row()); + } ++ painter->restore(); + } +diff --git a/src/library/coverartdelegate.h b/src/library/coverartdelegate.h +index d510c1d006..7908121b84 100644 +--- a/src/library/coverartdelegate.h ++++ b/src/library/coverartdelegate.h +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include "library/trackmodel.h" + +@@ -40,6 +41,7 @@ class CoverArtDelegate : public QStyledItemDelegate { + QPixmap pixmap, bool fromCache); + + private: ++ QTableView* m_pTableView; + bool m_bOnlyCachedCover; + int m_iCoverColumn; + int m_iCoverSourceColumn; +diff --git a/src/library/previewbuttondelegate.cpp b/src/library/previewbuttondelegate.cpp +index 6c09f59429..77d9068872 100644 +--- a/src/library/previewbuttondelegate.cpp ++++ b/src/library/previewbuttondelegate.cpp +@@ -90,11 +90,32 @@ void PreviewButtonDelegate::paint(QPainter *painter, + // it's playing. + m_pButton->setChecked(index.data().toBool() && playing); + +- if (option.state == QStyle::State_Selected) { +- painter->fillRect(option.rect, option.palette.base()); ++ painter->save(); ++ ++ painter->setClipRect(option.rect); ++ ++ if (m_pTableView != NULL) { ++ QStyle* style = m_pTableView->style(); ++ if (style != NULL) { ++ style->drawControl(QStyle::CE_ItemViewItem, &option, painter, ++ m_pTableView); ++ } ++ } ++ ++ // Set the palette appropriately based on whether the row is selected or ++ // not. We also have to check if it is inactive or not and use the ++ // appropriate ColorGroup. ++ QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ++ ? QPalette::Normal : QPalette::Disabled; ++ if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) ++ cg = QPalette::Inactive; ++ ++ if (option.state & QStyle::State_Selected) { ++ painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); ++ } else { ++ painter->setBrush(option.palette.color(cg, QPalette::Text)); + } + +- painter->save(); + // Render button at the desired position + painter->translate(option.rect.topLeft()); + m_pButton->render(painter); + +From 67353bf2b195b38cb8ca083f08970003e5b6dfac Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Tue, 29 May 2018 22:34:41 +0200 +Subject: [PATCH 2/4] Added a TableItemDelegate base class to hold the + background painting + +--- + build/depends.py | 1 + + src/library/basesqltablemodel.cpp | 12 ++++--- + src/library/bpmdelegate.cpp | 57 +++++++++++++++++++++++++++++--- + src/library/bpmdelegate.h | 15 ++++----- + src/library/browse/browsetablemodel.cpp | 5 ++- + src/library/coverartdelegate.cpp | 9 ++--- + src/library/coverartdelegate.h | 15 ++++----- + src/library/previewbuttondelegate.cpp | 58 ++++++++++++++++----------------- + src/library/previewbuttondelegate.h | 29 ++++++++--------- + src/library/stardelegate.cpp | 11 ++++--- + src/library/stardelegate.h | 9 +++-- + src/library/starrating.cpp | 2 ++ + src/library/starrating.h | 6 ++-- + src/library/tableitemdelegate.cpp | 18 ++++++++++ + src/library/tableitemdelegate.h | 25 ++++++++++++++ + 15 files changed, 184 insertions(+), 88 deletions(-) + create mode 100644 src/library/tableitemdelegate.cpp + create mode 100644 src/library/tableitemdelegate.h + +diff --git a/build/depends.py b/build/depends.py +index fc4196099f..f548b89062 100644 +--- a/build/depends.py ++++ b/build/depends.py +@@ -1059,6 +1059,7 @@ def sources(self, build): + "library/bpmdelegate.cpp", + "library/previewbuttondelegate.cpp", + "library/coverartdelegate.cpp", ++ "library/tableitemdelegate.cpp", + + "library/treeitemmodel.cpp", + "library/treeitem.cpp", +diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp +index 3b79392348..6502d82180 100644 +--- a/src/library/basesqltablemodel.cpp ++++ b/src/library/basesqltablemodel.cpp +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + #include "library/basesqltablemodel.h" + +@@ -1049,14 +1050,17 @@ QMimeData* BaseSqlTableModel::mimeData(const QModelIndexList &indexes) const { + } + + QAbstractItemDelegate* BaseSqlTableModel::delegateForColumn(const int i, QObject* pParent) { ++ QTableView* pTableView = qobject_cast(pParent); ++ DEBUG_ASSERT(pTableView); ++ + if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_RATING)) { +- return new StarDelegate(pParent); ++ return new StarDelegate(pTableView); + } else if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM)) { +- return new BPMDelegate(pParent); ++ return new BPMDelegate(pTableView); + } else if (PlayerManager::numPreviewDecks() > 0 && i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW)) { +- return new PreviewButtonDelegate(pParent, i); ++ return new PreviewButtonDelegate(pTableView, i); + } else if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART)) { +- CoverArtDelegate* pCoverDelegate = new CoverArtDelegate(pParent); ++ CoverArtDelegate* pCoverDelegate = new CoverArtDelegate(pTableView); + connect(pCoverDelegate, SIGNAL(coverReadyForCell(int, int)), + this, SLOT(refreshCell(int, int))); + return pCoverDelegate; +diff --git a/src/library/bpmdelegate.cpp b/src/library/bpmdelegate.cpp +index 53dd545da8..793c0f9c2f 100644 +--- a/src/library/bpmdelegate.cpp ++++ b/src/library/bpmdelegate.cpp +@@ -3,6 +3,8 @@ + #include + #include + #include ++#include ++#include + + #include "library/bpmdelegate.h" + #include "library/trackmodel.h" +@@ -30,9 +32,9 @@ class BpmEditorCreator : public QItemEditorCreatorBase { + } + }; + +-BPMDelegate::BPMDelegate(QObject* parent) +- : QStyledItemDelegate(parent), +- m_pTableView(qobject_cast(parent)), ++BPMDelegate::BPMDelegate(QTableView* pTableView) ++ : TableItemDelegate(pTableView), ++ m_pTableView(pTableView), + m_pCheckBox(new QCheckBox(m_pTableView)) { + m_pCheckBox->setObjectName("LibraryBPMButton"); + // NOTE(rryan): Without ensurePolished the first render of the QTableView +@@ -51,8 +53,8 @@ BPMDelegate::~BPMDelegate() { + delete m_pFactory; + } + +-void BPMDelegate::paint(QPainter* painter,const QStyleOptionViewItem &option, +- const QModelIndex &index) const { ++void BPMDelegate::paintItem(QPainter* painter,const QStyleOptionViewItem &option, ++ const QModelIndex& index) const { + // NOTE(rryan): Qt has a built-in limitation that we cannot style multiple + // CheckState indicators in the same QAbstractItemView. The CSS rule + // QTableView::indicator:checked applies to all columns with a +@@ -75,6 +77,21 @@ void BPMDelegate::paint(QPainter* painter,const QStyleOptionViewItem &option, + QStyleOptionViewItemV4 opt = option; + initStyleOption(&opt, index); + ++ // Set the palette appropriately based on whether the row is selected or ++ // not. We also have to check if it is inactive or not and use the ++ // appropriate ColorGroup. ++ QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ++ ? QPalette::Normal : QPalette::Disabled; ++ if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) ++ cg = QPalette::Inactive; ++ ++ if (option.state & QStyle::State_Selected) { ++ painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); ++ } else { ++ painter->setBrush(option.palette.color(cg, QPalette::Text)); ++ } ++ ++ + if (m_pTableView != NULL) { + QStyle* style = m_pTableView->style(); + if (style != NULL) { +@@ -82,4 +99,34 @@ void BPMDelegate::paint(QPainter* painter,const QStyleOptionViewItem &option, + m_pCheckBox); + } + } ++ ++ ++ /* ++ ++ painter->save(); ++ painter->setClipRect(option.rect); ++ ++ if (m_pTableView != NULL) { ++ QStyle* style = m_pTableView->style(); ++ if (style != NULL) { ++ style->drawControl(QStyle::CE_ItemViewItem, &option, painter, ++ m_pTableView); ++ } ++ } ++ ++ // Set the palette appropriately based on whether the row is selected or ++ // not. We also have to check if it is inactive or not and use the ++ // appropriate ColorGroup. ++ QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ++ ? QPalette::Normal : QPalette::Disabled; ++ if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) ++ cg = QPalette::Inactive; ++ ++ if (option.state & QStyle::State_Selected) { ++ painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); ++ } else { ++ painter->setBrush(option.palette.color(cg, QPalette::Text)); ++ } ++ */ ++ + } +diff --git a/src/library/bpmdelegate.h b/src/library/bpmdelegate.h +index a2fc678bd6..58f8adef27 100644 +--- a/src/library/bpmdelegate.h ++++ b/src/library/bpmdelegate.h +@@ -3,20 +3,19 @@ + + #include + #include +-#include +-#include + #include +-#include +-#include + +-class BPMDelegate : public QStyledItemDelegate { ++#include "library/tableitemdelegate.h" ++ ++ ++class BPMDelegate : public TableItemDelegate { + Q_OBJECT + public: +- explicit BPMDelegate(QObject* parent); ++ explicit BPMDelegate(QTableView* pTableView); + virtual ~BPMDelegate(); + +- void paint(QPainter *painter, const QStyleOptionViewItem &option, +- const QModelIndex &index) const; ++ void paintItem(QPainter* painter, const QStyleOptionViewItem& option, ++ const QModelIndex& index) const; + + private: + QTableView* m_pTableView; +diff --git a/src/library/browse/browsetablemodel.cpp b/src/library/browse/browsetablemodel.cpp +index e1a590edc5..5279a3fcb9 100644 +--- a/src/library/browse/browsetablemodel.cpp ++++ b/src/library/browse/browsetablemodel.cpp +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #include "library/browse/browsetablemodel.h" + #include "library/browse/browsethread.h" +@@ -364,8 +365,10 @@ bool BrowseTableModel::isColumnSortable(int column) { + } + + QAbstractItemDelegate* BrowseTableModel::delegateForColumn(const int i, QObject* pParent) { ++ QTableView* pTableView = qobject_cast(pParent); ++ DEBUG_ASSERT(pTableView); + if (PlayerManager::numPreviewDecks() > 0 && i == COLUMN_PREVIEW) { +- return new PreviewButtonDelegate(pParent, i); ++ return new PreviewButtonDelegate(pTableView, i); + } + return NULL; + } +diff --git a/src/library/coverartdelegate.cpp b/src/library/coverartdelegate.cpp +index c500217421..fea6276eb1 100644 +--- a/src/library/coverartdelegate.cpp ++++ b/src/library/coverartdelegate.cpp +@@ -1,13 +1,14 @@ + #include ++#include + + #include "library/coverartdelegate.h" + #include "library/coverartcache.h" + #include "library/dao/trackschema.h" + #include "util/math.h" + +-CoverArtDelegate::CoverArtDelegate(QObject *parent) +- : QStyledItemDelegate(parent), +- m_pTableView(qobject_cast(parent)), ++CoverArtDelegate::CoverArtDelegate(QTableView* parent) ++ : TableItemDelegate(parent), ++ m_pTableView(parent), + m_bOnlyCachedCover(false), + m_iCoverColumn(-1), + m_iCoverSourceColumn(-1), +@@ -82,7 +83,7 @@ void CoverArtDelegate::slotCoverFound(const QObject* pRequestor, + } + } + +-void CoverArtDelegate::paint(QPainter *painter, ++void CoverArtDelegate::paintItem(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const { + +diff --git a/src/library/coverartdelegate.h b/src/library/coverartdelegate.h +index 7908121b84..ff8fef5412 100644 +--- a/src/library/coverartdelegate.h ++++ b/src/library/coverartdelegate.h +@@ -1,24 +1,21 @@ + #ifndef COVERARTDELEGATE_H + #define COVERARTDELEGATE_H + +-#include +-#include +-#include + #include + #include +-#include + ++#include "library/tableitemdelegate.h" + #include "library/trackmodel.h" + +-class CoverArtDelegate : public QStyledItemDelegate { ++class CoverArtDelegate : public TableItemDelegate { + Q_OBJECT + public: +- explicit CoverArtDelegate(QObject* parent = NULL); ++ explicit CoverArtDelegate(QTableView* pTableView); + virtual ~CoverArtDelegate(); + +- void paint(QPainter *painter, +- const QStyleOptionViewItem &option, +- const QModelIndex &index) const; ++ void paintItem(QPainter* painter, ++ const QStyleOptionViewItem& option, ++ const QModelIndex& index) const; + + signals: + void coverReadyForCell(int row, int column); +diff --git a/src/library/previewbuttondelegate.cpp b/src/library/previewbuttondelegate.cpp +index 77d9068872..be63482b71 100644 +--- a/src/library/previewbuttondelegate.cpp ++++ b/src/library/previewbuttondelegate.cpp +@@ -1,5 +1,6 @@ + #include + #include ++#include + + #include "library/previewbuttondelegate.h" + #include "library/trackmodel.h" +@@ -8,9 +9,9 @@ + #include "track/track.h" + #include "control/controlproxy.h" + +-PreviewButtonDelegate::PreviewButtonDelegate(QObject *parent, int column) +- : QStyledItemDelegate(parent), +- m_pTableView(NULL), ++PreviewButtonDelegate::PreviewButtonDelegate(QTableView* parent, int column) ++ : TableItemDelegate(parent), ++ m_pTableView(parent), + m_pButton(NULL), + m_isOneCellInEditMode(false), + m_column(column) { +@@ -25,24 +26,21 @@ PreviewButtonDelegate::PreviewButtonDelegate(QObject *parent, int column) + connect(this, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)), + parent, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool))); + +- if (QTableView *tableView = qobject_cast(parent)) { +- m_pTableView = tableView; +- m_pButton = new QPushButton("", m_pTableView); +- m_pButton->setObjectName("LibraryPreviewButton"); +- m_pButton->setCheckable(true); +- m_pButton->setChecked(false); +- m_pButton->hide(); +- connect(m_pTableView, SIGNAL(entered(QModelIndex)), +- this, SLOT(cellEntered(QModelIndex))); +- } ++ m_pButton = new QPushButton("", m_pTableView); ++ m_pButton->setObjectName("LibraryPreviewButton"); ++ m_pButton->setCheckable(true); ++ m_pButton->setChecked(false); ++ m_pButton->hide(); ++ connect(m_pTableView, SIGNAL(entered(QModelIndex)), ++ this, SLOT(cellEntered(QModelIndex))); + } + + PreviewButtonDelegate::~PreviewButtonDelegate() { + } + +-QWidget* PreviewButtonDelegate::createEditor(QWidget *parent, +- const QStyleOptionViewItem &option, +- const QModelIndex &index) const { ++QWidget* PreviewButtonDelegate::createEditor(QWidget* parent, ++ const QStyleOptionViewItem& option, ++ const QModelIndex& index) const { + Q_UNUSED(option); + QPushButton* btn = new QPushButton(parent); + btn->setObjectName("LibraryPreviewButton"); +@@ -58,23 +56,23 @@ QWidget* PreviewButtonDelegate::createEditor(QWidget *parent, + return btn; + } + +-void PreviewButtonDelegate::setEditorData(QWidget *editor, +- const QModelIndex &index) const { ++void PreviewButtonDelegate::setEditorData(QWidget* editor, ++ const QModelIndex& index) const { + Q_UNUSED(editor); + Q_UNUSED(index); + } + +-void PreviewButtonDelegate::setModelData(QWidget *editor, +- QAbstractItemModel *model, +- const QModelIndex &index) const { ++void PreviewButtonDelegate::setModelData(QWidget* editor, ++ QAbstractItemModel* model, ++ const QModelIndex& index) const { + Q_UNUSED(editor); + Q_UNUSED(model); + Q_UNUSED(index); + } + +-void PreviewButtonDelegate::paint(QPainter *painter, +- const QStyleOptionViewItem &option, +- const QModelIndex &index) const { ++void PreviewButtonDelegate::paintItem(QPainter* painter, ++ const QStyleOptionViewItem& option, ++ const QModelIndex& index) const { + // Let the editor paint in this case + if (index == m_currentEditedCellIndex) { + return; +@@ -122,15 +120,15 @@ void PreviewButtonDelegate::paint(QPainter *painter, + painter->restore(); + } + +-void PreviewButtonDelegate::updateEditorGeometry(QWidget *editor, +- const QStyleOptionViewItem &option, +- const QModelIndex &index) const { ++void PreviewButtonDelegate::updateEditorGeometry(QWidget* editor, ++ const QStyleOptionViewItem& option, ++ const QModelIndex& index) const { + Q_UNUSED(index); + editor->setGeometry(option.rect); + } + +-QSize PreviewButtonDelegate::sizeHint(const QStyleOptionViewItem &option, +- const QModelIndex &index) const { ++QSize PreviewButtonDelegate::sizeHint(const QStyleOptionViewItem& option, ++ const QModelIndex& index) const { + Q_UNUSED(option); + Q_UNUSED(index); + if (!m_pButton) { +@@ -139,7 +137,7 @@ QSize PreviewButtonDelegate::sizeHint(const QStyleOptionViewItem &option, + return m_pButton->sizeHint(); + } + +-void PreviewButtonDelegate::cellEntered(const QModelIndex &index) { ++void PreviewButtonDelegate::cellEntered(const QModelIndex& index) { + if (!m_pTableView) { + return; + } +diff --git a/src/library/previewbuttondelegate.h b/src/library/previewbuttondelegate.h +index d9d5f8bfa1..27bcaf87eb 100644 +--- a/src/library/previewbuttondelegate.h ++++ b/src/library/previewbuttondelegate.h +@@ -1,41 +1,40 @@ + #ifndef PREVIEWBUTTONDELEGATE_H + #define PREVIEWBUTTONDELEGATE_H + +-#include + #include +-#include + ++#include "library/tableitemdelegate.h" + #include "track/track.h" + + class ControlProxy; + +-class PreviewButtonDelegate : public QStyledItemDelegate { ++class PreviewButtonDelegate : public TableItemDelegate { + Q_OBJECT + + public: +- explicit PreviewButtonDelegate(QObject* parent = NULL, int column = 0); ++ explicit PreviewButtonDelegate(QTableView* parent, int column); + virtual ~PreviewButtonDelegate(); + +- QWidget* createEditor(QWidget *parent, +- const QStyleOptionViewItem &option, +- const QModelIndex &index) const; ++ QWidget* createEditor(QWidget* parent, ++ const QStyleOptionViewItem& option, ++ const QModelIndex& index) const; + +- void setEditorData(QWidget *editor, const QModelIndex &index) const; +- void setModelData(QWidget *editor, QAbstractItemModel *model, ++ void setEditorData(QWidget* editor, const QModelIndex& index) const; ++ void setModelData(QWidget* editor, QAbstractItemModel* model, + const QModelIndex &index) const; +- void paint(QPainter *painter, const QStyleOptionViewItem &option, +- const QModelIndex &index) const; ++ void paintItem(QPainter* painter, const QStyleOptionViewItem& option, ++ const QModelIndex& index) const; + QSize sizeHint(const QStyleOptionViewItem &option, +- const QModelIndex &index) const; +- void updateEditorGeometry(QWidget *editor,const QStyleOptionViewItem &option, +- const QModelIndex &index) const; ++ const QModelIndex& index) const; ++ void updateEditorGeometry(QWidget* editor,const QStyleOptionViewItem& option, ++ const QModelIndex& index) const; + + signals: + void loadTrackToPlayer(TrackPointer Track, QString group, bool play); + void buttonSetChecked(bool); + + public slots: +- void cellEntered(const QModelIndex &index); ++ void cellEntered(const QModelIndex& index); + void buttonClicked(); + void previewDeckPlayChanged(double v); + +diff --git a/src/library/stardelegate.cpp b/src/library/stardelegate.cpp +index 374ea82531..90daa60f5b 100644 +--- a/src/library/stardelegate.cpp ++++ b/src/library/stardelegate.cpp +@@ -18,19 +18,20 @@ + + #include + ++#include "library/tableitemdelegate.h" + #include "library/stardelegate.h" + #include "library/stareditor.h" + #include "library/starrating.h" + +-StarDelegate::StarDelegate(QObject* pParent) +- : QStyledItemDelegate(pParent), +- m_pTableView(qobject_cast(pParent)), ++StarDelegate::StarDelegate(QTableView* pTableView) ++ : TableItemDelegate(pTableView), ++ m_pTableView(pTableView), + m_isOneCellInEditMode(false) { +- connect(pParent, SIGNAL(entered(QModelIndex)), ++ connect(pTableView, SIGNAL(entered(QModelIndex)), + this, SLOT(cellEntered(QModelIndex))); + } + +-void StarDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, ++void StarDelegate::paintItem(QPainter* painter, const QStyleOptionViewItem& option, + const QModelIndex& index) const { + // let the editor do the painting if this cell is currently being edited + if (index == m_currentEditedCellIndex) { +diff --git a/src/library/stardelegate.h b/src/library/stardelegate.h +index a223cc4c97..999c65e2ff 100644 +--- a/src/library/stardelegate.h ++++ b/src/library/stardelegate.h +@@ -19,17 +19,16 @@ + #ifndef STARDELEGATE_H + #define STARDELEGATE_H + +-#include +-#include ++#include "library/tableitemdelegate.h" + +-class StarDelegate : public QStyledItemDelegate { ++class StarDelegate : public TableItemDelegate { + Q_OBJECT + public: +- StarDelegate(QObject* pParent = 0); ++ StarDelegate(QTableView* pTrackTable); + + // reimplemented from QItemDelegate and is called whenever the view needs to + // repaint an item +- void paint(QPainter* painter, const QStyleOptionViewItem& option, ++ void paintItem(QPainter* painter, const QStyleOptionViewItem& option, + const QModelIndex& index) const; + + // returns an item's preferred size +diff --git a/src/library/starrating.cpp b/src/library/starrating.cpp +index c514e7b3f8..04f9c9023f 100644 +--- a/src/library/starrating.cpp ++++ b/src/library/starrating.cpp +@@ -15,6 +15,8 @@ + * * + ***************************************************************************/ + ++#include ++ + #include "library/starrating.h" + #include "util/math.h" + +diff --git a/src/library/starrating.h b/src/library/starrating.h +index e8cd31aaa0..3ee79f46b1 100644 +--- a/src/library/starrating.h ++++ b/src/library/starrating.h +@@ -22,8 +22,10 @@ + #include + #include + #include +-#include +-#include ++#include ++ ++class QPainter; ++ + + /* + * The StarRating class represents a rating as a number of stars. +diff --git a/src/library/tableitemdelegate.cpp b/src/library/tableitemdelegate.cpp +new file mode 100644 +index 0000000000..c1097e6f99 +--- /dev/null ++++ b/src/library/tableitemdelegate.cpp +@@ -0,0 +1,18 @@ ++ ++#include ++ ++#include "library/tableitemdelegate.h" ++ ++ ++TableItemDelegate::TableItemDelegate(QTableView* pTableView) ++ : QStyledItemDelegate(pTableView), ++ m_pTableView(pTableView) { ++} ++ ++TableItemDelegate::~TableItemDelegate() { ++} ++ ++void TableItemDelegate::paint(QPainter* painter,const QStyleOptionViewItem& option, ++ const QModelIndex& index) const { ++ paintItem(painter, option, index); ++} +diff --git a/src/library/tableitemdelegate.h b/src/library/tableitemdelegate.h +new file mode 100644 +index 0000000000..a39071aac3 +--- /dev/null ++++ b/src/library/tableitemdelegate.h +@@ -0,0 +1,25 @@ ++#ifndef TABLEITEMDELEGATE_H ++#define TABLEITEMDELEGATE_H ++ ++#include ++ ++class QTableView; ++class QStyleOptionViewItem; ++ ++class TableItemDelegate : public QStyledItemDelegate { ++ Q_OBJECT ++ public: ++ explicit TableItemDelegate(QTableView* pTableView); ++ virtual ~TableItemDelegate(); ++ ++ void paint(QPainter *painter, const QStyleOptionViewItem &option, ++ const QModelIndex &index) const; ++ ++ virtual void paintItem(QPainter *painter, const QStyleOptionViewItem &option, ++ const QModelIndex &index) const = 0; ++ ++ private: ++ QTableView* m_pTableView; ++}; ++ ++#endif // TABLEITEMDELEGATE_H + +From f9bdf3e4897fc1670e8ac7a6309ad784d5f52f16 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Wed, 30 May 2018 23:59:35 +0200 +Subject: [PATCH 3/4] de-duplicated Code + +--- + src/library/bpmdelegate.cpp | 30 ------------------------------ + src/library/coverartdelegate.cpp | 29 ----------------------------- + src/library/previewbuttondelegate.cpp | 27 --------------------------- + src/library/stardelegate.cpp | 11 ++++++++++- + src/library/stardelegate.h | 3 +++ + src/library/starrating.cpp | 2 -- + src/library/tableitemdelegate.cpp | 30 ++++++++++++++++++++++++++++++ + 7 files changed, 43 insertions(+), 89 deletions(-) + +diff --git a/src/library/bpmdelegate.cpp b/src/library/bpmdelegate.cpp +index 793c0f9c2f..a8295b358d 100644 +--- a/src/library/bpmdelegate.cpp ++++ b/src/library/bpmdelegate.cpp +@@ -99,34 +99,4 @@ void BPMDelegate::paintItem(QPainter* painter,const QStyleOptionViewItem &option + m_pCheckBox); + } + } +- +- +- /* +- +- painter->save(); +- painter->setClipRect(option.rect); +- +- if (m_pTableView != NULL) { +- QStyle* style = m_pTableView->style(); +- if (style != NULL) { +- style->drawControl(QStyle::CE_ItemViewItem, &option, painter, +- m_pTableView); +- } +- } +- +- // Set the palette appropriately based on whether the row is selected or +- // not. We also have to check if it is inactive or not and use the +- // appropriate ColorGroup. +- QPalette::ColorGroup cg = option.state & QStyle::State_Enabled +- ? QPalette::Normal : QPalette::Disabled; +- if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) +- cg = QPalette::Inactive; +- +- if (option.state & QStyle::State_Selected) { +- painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); +- } else { +- painter->setBrush(option.palette.color(cg, QPalette::Text)); +- } +- */ +- + } +diff --git a/src/library/coverartdelegate.cpp b/src/library/coverartdelegate.cpp +index fea6276eb1..871807d2e8 100644 +--- a/src/library/coverartdelegate.cpp ++++ b/src/library/coverartdelegate.cpp +@@ -86,37 +86,10 @@ void CoverArtDelegate::slotCoverFound(const QObject* pRequestor, + void CoverArtDelegate::paintItem(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const { +- +- painter->save(); +- painter->setClipRect(option.rect); +- +- if (m_pTableView != NULL) { +- QStyle* style = m_pTableView->style(); +- if (style != NULL) { +- style->drawControl(QStyle::CE_ItemViewItem, &option, painter, +- m_pTableView); +- } +- } +- +- // Set the palette appropriately based on whether the row is selected or +- // not. We also have to check if it is inactive or not and use the +- // appropriate ColorGroup. +- QPalette::ColorGroup cg = option.state & QStyle::State_Enabled +- ? QPalette::Normal : QPalette::Disabled; +- if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) +- cg = QPalette::Inactive; +- +- if (option.state & QStyle::State_Selected) { +- painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); +- } else { +- painter->setBrush(option.palette.color(cg, QPalette::Text)); +- } +- + CoverArtCache* pCache = CoverArtCache::instance(); + if (pCache == NULL || m_iIdColumn == -1 || m_iCoverSourceColumn == -1 || + m_iCoverTypeColumn == -1 || m_iCoverLocationColumn == -1 || + m_iCoverHashColumn == -1) { +- painter->restore(); + return; + } + +@@ -126,7 +99,6 @@ void CoverArtDelegate::paintItem(QPainter *painter, + + // We don't support types other than METADATA or FILE currently. + if (info.type != CoverInfo::METADATA && info.type != CoverInfo::FILE) { +- painter->restore(); + return; + } + +@@ -157,5 +129,4 @@ void CoverArtDelegate::paintItem(QPainter *painter, + // we can request an update. + m_cacheMissRows.append(index.row()); + } +- painter->restore(); + } +diff --git a/src/library/previewbuttondelegate.cpp b/src/library/previewbuttondelegate.cpp +index be63482b71..5c916bd841 100644 +--- a/src/library/previewbuttondelegate.cpp ++++ b/src/library/previewbuttondelegate.cpp +@@ -88,36 +88,9 @@ void PreviewButtonDelegate::paintItem(QPainter* painter, + // it's playing. + m_pButton->setChecked(index.data().toBool() && playing); + +- painter->save(); +- +- painter->setClipRect(option.rect); +- +- if (m_pTableView != NULL) { +- QStyle* style = m_pTableView->style(); +- if (style != NULL) { +- style->drawControl(QStyle::CE_ItemViewItem, &option, painter, +- m_pTableView); +- } +- } +- +- // Set the palette appropriately based on whether the row is selected or +- // not. We also have to check if it is inactive or not and use the +- // appropriate ColorGroup. +- QPalette::ColorGroup cg = option.state & QStyle::State_Enabled +- ? QPalette::Normal : QPalette::Disabled; +- if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) +- cg = QPalette::Inactive; +- +- if (option.state & QStyle::State_Selected) { +- painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); +- } else { +- painter->setBrush(option.palette.color(cg, QPalette::Text)); +- } +- + // Render button at the desired position + painter->translate(option.rect.topLeft()); + m_pButton->render(painter); +- painter->restore(); + } + + void PreviewButtonDelegate::updateEditorGeometry(QWidget* editor, +diff --git a/src/library/stardelegate.cpp b/src/library/stardelegate.cpp +index 90daa60f5b..c861d93d8c 100644 +--- a/src/library/stardelegate.cpp ++++ b/src/library/stardelegate.cpp +@@ -31,6 +31,15 @@ StarDelegate::StarDelegate(QTableView* pTableView) + this, SLOT(cellEntered(QModelIndex))); + } + ++void StarDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, ++ const QModelIndex& index) const { ++ // let the editor do the painting if this cell is currently being edited ++ if (index == m_currentEditedCellIndex) { ++ return; ++ } ++ TableItemDelegate::paint(painter, option, index); ++} ++ + void StarDelegate::paintItem(QPainter* painter, const QStyleOptionViewItem& option, + const QModelIndex& index) const { + // let the editor do the painting if this cell is currently being edited +@@ -43,7 +52,7 @@ void StarDelegate::paintItem(QPainter* painter, const QStyleOptionViewItem& opti + initStyleOption(&newOption, index); + + StarRating starRating = qVariantValue(index.data()); +- StarEditor::renderHelper(painter, m_pTableView, option, &starRating); ++ starRating.paint(painter, option.rect); + } + + QSize StarDelegate::sizeHint(const QStyleOptionViewItem& option, +diff --git a/src/library/stardelegate.h b/src/library/stardelegate.h +index 999c65e2ff..2b35fc61bb 100644 +--- a/src/library/stardelegate.h ++++ b/src/library/stardelegate.h +@@ -28,6 +28,9 @@ class StarDelegate : public TableItemDelegate { + + // reimplemented from QItemDelegate and is called whenever the view needs to + // repaint an item ++ void paint(QPainter* painter, const QStyleOptionViewItem& option, ++ const QModelIndex& index) const; ++ + void paintItem(QPainter* painter, const QStyleOptionViewItem& option, + const QModelIndex& index) const; + +diff --git a/src/library/starrating.cpp b/src/library/starrating.cpp +index 04f9c9023f..8e7bb37e7e 100644 +--- a/src/library/starrating.cpp ++++ b/src/library/starrating.cpp +@@ -37,7 +37,6 @@ QSize StarRating::sizeHint() const { + + void StarRating::paint(QPainter *painter, const QRect &rect) const { + // Assume the painter is configured with the right brush. +- painter->save(); + painter->setRenderHint(QPainter::Antialiasing, true); + painter->setPen(Qt::NoPen); + +@@ -56,5 +55,4 @@ void StarRating::paint(QPainter *painter, const QRect &rect) const { + } + painter->translate(1.0, 0.0); + } +- painter->restore(); + } +diff --git a/src/library/tableitemdelegate.cpp b/src/library/tableitemdelegate.cpp +index c1097e6f99..8f0575e105 100644 +--- a/src/library/tableitemdelegate.cpp ++++ b/src/library/tableitemdelegate.cpp +@@ -1,5 +1,6 @@ + + #include ++#include + + #include "library/tableitemdelegate.h" + +@@ -14,5 +15,34 @@ TableItemDelegate::~TableItemDelegate() { + + void TableItemDelegate::paint(QPainter* painter,const QStyleOptionViewItem& option, + const QModelIndex& index) const { ++ ++ painter->save(); ++ ++ painter->setClipRect(option.rect); ++ ++ // Set the palette appropriately based on whether the row is selected or ++ // not. We also have to check if it is inactive or not and use the ++ // appropriate ColorGroup. ++ QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ++ ? QPalette::Normal : QPalette::Disabled; ++ if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) ++ cg = QPalette::Inactive; ++ ++ if (option.state & QStyle::State_Selected) { ++ painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); ++ } else { ++ painter->setBrush(option.palette.color(cg, QPalette::Text)); ++ } ++ ++ if (m_pTableView) { ++ QStyle* style = m_pTableView->style(); ++ if (style) { ++ style->drawControl(QStyle::CE_ItemViewItem, &option, painter, ++ m_pTableView); ++ } ++ } ++ + paintItem(painter, option, index); ++ ++ painter->restore(); + } + +From 196994ea61ac415203b4356761eed7d023578249 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= +Date: Wed, 6 Jun 2018 00:51:59 +0200 +Subject: [PATCH 4/4] Remove redundant code + +--- + src/library/bpmdelegate.cpp | 15 --------------- + src/library/stardelegate.cpp | 4 ---- + 2 files changed, 19 deletions(-) + +diff --git a/src/library/bpmdelegate.cpp b/src/library/bpmdelegate.cpp +index a8295b358d..dae91d45dc 100644 +--- a/src/library/bpmdelegate.cpp ++++ b/src/library/bpmdelegate.cpp +@@ -77,21 +77,6 @@ void BPMDelegate::paintItem(QPainter* painter,const QStyleOptionViewItem &option + QStyleOptionViewItemV4 opt = option; + initStyleOption(&opt, index); + +- // Set the palette appropriately based on whether the row is selected or +- // not. We also have to check if it is inactive or not and use the +- // appropriate ColorGroup. +- QPalette::ColorGroup cg = option.state & QStyle::State_Enabled +- ? QPalette::Normal : QPalette::Disabled; +- if (cg == QPalette::Normal && !(option.state & QStyle::State_Active)) +- cg = QPalette::Inactive; +- +- if (option.state & QStyle::State_Selected) { +- painter->setBrush(option.palette.color(cg, QPalette::HighlightedText)); +- } else { +- painter->setBrush(option.palette.color(cg, QPalette::Text)); +- } +- +- + if (m_pTableView != NULL) { + QStyle* style = m_pTableView->style(); + if (style != NULL) { +diff --git a/src/library/stardelegate.cpp b/src/library/stardelegate.cpp +index c861d93d8c..5b82ff6236 100644 +--- a/src/library/stardelegate.cpp ++++ b/src/library/stardelegate.cpp +@@ -47,10 +47,6 @@ void StarDelegate::paintItem(QPainter* painter, const QStyleOptionViewItem& opti + return; + } + +- // Populate the correct colors based on the styling +- QStyleOptionViewItemV4 newOption = option; +- initStyleOption(&newOption, index); +- + StarRating starRating = qVariantValue(index.data()); + starRating.paint(painter, option.rect); + } diff --git a/media-sound/mixxx/mixxx-2.1.0.ebuild b/media-sound/mixxx/mixxx-2.1.0.ebuild index 5b67d54..8aff9ab 100644 --- a/media-sound/mixxx/mixxx-2.1.0.ebuild +++ b/media-sound/mixxx/mixxx-2.1.0.ebuild @@ -98,6 +98,7 @@ PATCHES=( #"${FILESDIR}"/${P}-library-improvements-for-all-skins-fix-lp1772202-in-tango.patch "${FILESDIR}"/${P}-fix-crash-when-importing-id3v2-apic-frames.patch "${FILESDIR}"/${P}-fix-some-log-levels-and-reduce-debug-log-spam.patch + "${FILESDIR}"/${P}-os-theme-shining-though-fix.patch "${FILESDIR}"/${P}-beatsync-fix.patch )