From a8a41f50d52eb7b670d6db0cc2bafaf59baf00b2 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Thu, 27 Jun 2019 17:32:39 +0200 Subject: simplify reading &/ setting the default of bool cloneOnDoubleTap --- src/mixer/playermanager.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/mixer/playermanager.cpp') diff --git a/src/mixer/playermanager.cpp b/src/mixer/playermanager.cpp index 43b6ea774c..1d0e7cdf08 100644 --- a/src/mixer/playermanager.cpp +++ b/src/mixer/playermanager.cpp @@ -580,15 +580,9 @@ void PlayerManager::slotLoadTrackToPlayer(TrackPointer pTrack, QString group, bo } mixxx::Duration elapsed = m_cloneTimer.restart(); - bool cloneOnDoubleTap; // If not present in the config, use & set the default value - if (!m_pConfig->exists(ConfigKey("[Controls]","CloneDeckOnLoadDoubleTap"))) { - cloneOnDoubleTap = true; - m_pConfig->setValue(ConfigKey("[Controls]", "CloneDeckOnLoadDoubleTap"), true); - } else { - cloneOnDoubleTap = m_pConfig->getValue( - ConfigKey("[Controls]", "CloneDeckOnLoadDoubleTap")); - }; + bool cloneOnDoubleTap = m_pConfig->getValue( + ConfigKey("[Controls]", "CloneDeckOnLoadDoubleTap"), true); if (cloneOnDoubleTap && m_lastLoadedPlayer == group && elapsed < mixxx::Duration::fromSeconds(0.5)) { // load was pressed twice quickly while [Controls],CloneDeckOnLoadDoubleTap is TRUE, // so clone another playing deck instead of loading the selected track -- cgit v1.2.3