Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Nov 10, 2024
2 parents 9381a84 + ee67dbb commit 6ae7736
Show file tree
Hide file tree
Showing 23 changed files with 311 additions and 58 deletions.
4 changes: 4 additions & 0 deletions src/controllers/legacycontrollersettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ QWidget* LegacyControllerBooleanSetting::buildInputWidget(QWidget* pParent) {
pCheckBox->setCheckState(m_editedValue ? Qt::Checked : Qt::Unchecked);
});

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
connect(pCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) {
#else
connect(pCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
#endif
m_editedValue = state == Qt::Checked;
emit changed();
});
Expand Down
8 changes: 8 additions & 0 deletions src/dialog/dlgreplacecuecolor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,19 @@ DlgReplaceCueColor::DlgReplaceCueColor(

// Update dialog widgets when conditions checkboxes are (un)checked
connect(checkBoxCurrentColorCondition,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgReplaceCueColor::slotUpdateWidgets);
connect(checkBoxHotcueIndexCondition,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgReplaceCueColor::slotUpdateWidgets);

Expand Down
4 changes: 4 additions & 0 deletions src/library/dao/trackdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,11 @@ void setTrackSourceSynchronizedAt(const QSqlRecord& record, const int column, Tr
if (!value.isNull() && value.canConvert<quint64>()) {
DEBUG_ASSERT(value.isValid());
const quint64 msecsSinceEpoch = qvariant_cast<quint64>(value);
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
sourceSynchronizedAt.setTimeZone(QTimeZone::UTC);
#else
sourceSynchronizedAt.setTimeSpec(Qt::UTC);
#endif
sourceSynchronizedAt.setMSecsSinceEpoch(msecsSinceEpoch);
}
pTrack->setSourceSynchronizedAt(sourceSynchronizedAt);
Expand Down
8 changes: 8 additions & 0 deletions src/library/dlgtrackinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ void DlgTrackInfo::init() {
&DlgTrackInfo::slotBpmClear);

connect(bpmConst,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgTrackInfo::slotBpmConstChanged);

Expand Down Expand Up @@ -662,7 +666,11 @@ void DlgTrackInfo::slotBpmClear() {
bpmTap->setEnabled(true);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgTrackInfo::slotBpmConstChanged(Qt::CheckState state) {
#else
void DlgTrackInfo::slotBpmConstChanged(int state) {
#endif
if (state == Qt::Unchecked) {
// try to reload BeatMap from the Track
reloadTrackBeats(*m_pLoadedTrack);
Expand Down
4 changes: 4 additions & 0 deletions src/library/dlgtrackinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class DlgTrackInfo : public QDialog, public Ui::DlgTrackInfo {

void slotBpmScale(mixxx::Beats::BpmScale bpmScale);
void slotBpmClear();
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void slotBpmConstChanged(Qt::CheckState state);
#else
void slotBpmConstChanged(int state);
#endif
void slotBpmTap(double averageLength, int numSamples);
void slotSpinBpmValueChanged(double value);

Expand Down
6 changes: 3 additions & 3 deletions src/library/tabledelegates/coverartdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ void CoverArtDelegate::paintItem(
}

void CoverArtDelegate::cleanCacheMissRows() const {
auto it = m_cacheMissRows.begin();
while (it != m_cacheMissRows.end()) {
auto it = m_cacheMissRows.cbegin();
while (it != m_cacheMissRows.cend()) {
const QModelIndex index = m_pTableView->model()->index(*it, m_column);
const QRect rect = m_pTableView->visualRect(index);
if (!rect.intersects(m_pTableView->rect())) {
// Cover image row is no longer shown. We keep the set
// small which likely reuses the allocatd memory later
it = m_cacheMissRows.erase(it);
it = constErase(&m_cacheMissRows, it);
} else {
++it;
}
Expand Down
27 changes: 27 additions & 0 deletions src/preferences/dialog/dlgprefautodj.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "preferences/dialog/dlgprefautodj.h"

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
#include <QTimeZone>
#endif

#include "moc_dlgprefautodj.cpp"

DlgPrefAutoDJ::DlgPrefAutoDJ(QWidget* pParent,
Expand All @@ -10,13 +14,21 @@ DlgPrefAutoDJ::DlgPrefAutoDJ(QWidget* pParent,

// The auto-DJ replay-age for randomly-selected tracks
connect(RequeueIgnoreCheckBox,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefAutoDJ::slotToggleRequeueIgnore);

// Auto DJ random enqueue
connect(RandomQueueCheckBox,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefAutoDJ::slotToggleRandomQueue);

Expand All @@ -32,6 +44,13 @@ void DlgPrefAutoDJ::slotUpdate() {
// The auto-DJ replay-age for randomly-selected tracks
RequeueIgnoreCheckBox->setChecked(m_pConfig->getValue(
ConfigKey("[Auto DJ]", "UseIgnoreTime"), false));
/// TODO: Once we require at least Qt 6.7, remove this `setTimeZone` call
/// and uncomment the corresponding declarations in the UI file instead.
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
RequeueIgnoreTimeEdit->setTimeZone(QTimeZone::LocalTime);
#else
RequeueIgnoreTimeEdit->setTimeSpec(Qt::LocalTime);
#endif
RequeueIgnoreTimeEdit->setTime(
QTime::fromString(
m_pConfig->getValue(
Expand Down Expand Up @@ -98,14 +117,22 @@ void DlgPrefAutoDJ::slotResetToDefaults() {
CenterXfaderCheckBox->setChecked(false);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefAutoDJ::slotToggleRequeueIgnore(Qt::CheckState buttonState) {
#else
void DlgPrefAutoDJ::slotToggleRequeueIgnore(int buttonState) {
#endif
RequeueIgnoreTimeEdit->setEnabled(buttonState == Qt::Checked);
}

void DlgPrefAutoDJ::considerRepeatPlaylistState(bool enable) {
RandomQueueMinimumSpinBox->setEnabled(enable);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefAutoDJ::slotToggleRandomQueue(Qt::CheckState buttonState) {
#else
void DlgPrefAutoDJ::slotToggleRandomQueue(int buttonState) {
#endif
RandomQueueMinimumSpinBox->setEnabled(buttonState == Qt::Checked);
}
8 changes: 8 additions & 0 deletions src/preferences/dialog/dlgprefautodj.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ class DlgPrefAutoDJ : public DlgPreferencePage, public Ui::DlgPrefAutoDJDlg {
void slotResetToDefaults() override;

private slots:
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void slotToggleRequeueIgnore(Qt::CheckState state);
#else
void slotToggleRequeueIgnore(int buttonState);
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void slotToggleRandomQueue(Qt::CheckState state);
#else
void slotToggleRandomQueue(int buttonState);
#endif

private:
void considerRepeatPlaylistState(bool);
Expand Down
10 changes: 7 additions & 3 deletions src/preferences/dialog/dlgprefautodjdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@
<property name="displayFormat">
<string>hh:mm</string>
</property>
<property name="timeSpec">
<enum>Qt::LocalTime</enum>
</property>
<!--
TODO: Enable this once we require at least Qt 6.7 and remove the
corresponding code from the C++ file.
-->
<!--<property name="timeZone">
<enum>QTimeZone::LocalTime</enum>
</property>-->
<property name="minimumSize">
<size>
<width>60</width>
Expand Down
45 changes: 45 additions & 0 deletions src/preferences/dialog/dlgprefbeats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,43 @@ DlgPrefBeats::DlgPrefBeats(QWidget* parent, UserSettingsPointer pConfig)
this,
&DlgPrefBeats::pluginSelected);
connect(checkBoxAnalyzerEnabled,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBeats::analyzerEnabled);
connect(checkBoxFixedTempo,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBeats::fixedtempoEnabled);
connect(checkBoxFastAnalysis,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBeats::fastAnalysisEnabled);
connect(checkBoxReanalyze,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBeats::slotReanalyzeChanged);
connect(checkBoxReanalyzeImported,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBeats::slotReanalyzeImportedChanged);
connect(comboBoxStemStrategy,
Expand Down Expand Up @@ -100,13 +120,23 @@ void DlgPrefBeats::pluginSelected(int i) {
slotUpdate();
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBeats::analyzerEnabled(Qt::CheckState state) {
m_bAnalyzerEnabled = (state == Qt::Checked);
#else
void DlgPrefBeats::analyzerEnabled(int i) {
m_bAnalyzerEnabled = static_cast<bool>(i);
#endif
slotUpdate();
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBeats::fixedtempoEnabled(Qt::CheckState state) {
m_bFixedTempoEnabled = (state == Qt::Checked);
#else
void DlgPrefBeats::fixedtempoEnabled(int i) {
m_bFixedTempoEnabled = static_cast<bool>(i);
#endif
slotUpdate();
}

Expand Down Expand Up @@ -155,18 +185,33 @@ void DlgPrefBeats::slotUpdate() {
: 0);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBeats::slotReanalyzeChanged(Qt::CheckState state) {
m_bReanalyze = (state == Qt::Checked);
#else
void DlgPrefBeats::slotReanalyzeChanged(int value) {
m_bReanalyze = static_cast<bool>(value);
#endif
slotUpdate();
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBeats::slotReanalyzeImportedChanged(Qt::CheckState state) {
m_bReanalyzeImported = (state == Qt::Checked);
#else
void DlgPrefBeats::slotReanalyzeImportedChanged(int value) {
m_bReanalyzeImported = static_cast<bool>(value);
#endif
slotUpdate();
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBeats::fastAnalysisEnabled(Qt::CheckState state) {
m_bFastAnalysisEnabled = (state == Qt::Checked);
#else
void DlgPrefBeats::fastAnalysisEnabled(int i) {
m_bFastAnalysisEnabled = static_cast<bool>(i);
#endif
slotUpdate();
}

Expand Down
8 changes: 8 additions & 0 deletions src/preferences/dialog/dlgprefbeats.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ class DlgPrefBeats : public DlgPreferencePage, public Ui::DlgBeatsDlg {

private slots:
void pluginSelected(int i);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void analyzerEnabled(Qt::CheckState state);
void fixedtempoEnabled(Qt::CheckState state);
void fastAnalysisEnabled(Qt::CheckState state);
void slotReanalyzeChanged(Qt::CheckState state);
void slotReanalyzeImportedChanged(Qt::CheckState state);
#else
void analyzerEnabled(int i);
void fixedtempoEnabled(int i);
void fastAnalysisEnabled(int i);
void slotReanalyzeChanged(int value);
void slotReanalyzeImportedChanged(int value);
#endif
void slotStemStrategyChanged(int index);

private:
Expand Down
27 changes: 27 additions & 0 deletions src/preferences/dialog/dlgprefbroadcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,27 @@ DlgPrefBroadcast::DlgPrefBroadcast(QWidget *parent,
static_cast<int>(EncoderSettings::ChannelMode::STEREO));

connect(checkBoxEnableReconnect,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBroadcast::checkBoxEnableReconnectChanged);
connect(checkBoxLimitReconnects,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBroadcast::checkBoxLimitReconnectsChanged);
connect(enableCustomMetadata,
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
&QCheckBox::checkStateChanged,
#else
&QCheckBox::stateChanged,
#endif
this,
&DlgPrefBroadcast::enableCustomMetadataChanged);

Expand Down Expand Up @@ -280,15 +292,30 @@ void DlgPrefBroadcast::broadcastEnabledChanged(double value) {
btnDisconnectAll->setEnabled(enabled);
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBroadcast::checkBoxEnableReconnectChanged(Qt::CheckState state) {
widgetReconnectControls->setEnabled(state == Qt::Checked);
#else
void DlgPrefBroadcast::checkBoxEnableReconnectChanged(int value) {
widgetReconnectControls->setEnabled(value);
#endif
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBroadcast::checkBoxLimitReconnectsChanged(Qt::CheckState state) {
spinBoxMaximumRetries->setEnabled(state == Qt::Checked);
#else
void DlgPrefBroadcast::checkBoxLimitReconnectsChanged(int value) {
spinBoxMaximumRetries->setEnabled(value);
#endif
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void DlgPrefBroadcast::enableCustomMetadataChanged(Qt::CheckState state) {
const bool value = (state == Qt::Checked);
#else
void DlgPrefBroadcast::enableCustomMetadataChanged(int value) {
#endif
custom_artist->setEnabled(value);
custom_title->setEnabled(value);
}
Expand Down
6 changes: 6 additions & 0 deletions src/preferences/dialog/dlgprefbroadcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ class DlgPrefBroadcast : public DlgPreferencePage, public Ui::DlgPrefBroadcastDl
void slotUpdate() override;
void slotResetToDefaults() override;
void broadcastEnabledChanged(double value);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
void checkBoxEnableReconnectChanged(Qt::CheckState state);
void checkBoxLimitReconnectsChanged(Qt::CheckState state);
void enableCustomMetadataChanged(Qt::CheckState state);
#else
void checkBoxEnableReconnectChanged(int value);
void checkBoxLimitReconnectsChanged(int value);
void enableCustomMetadataChanged(int value);
#endif
void connectionListItemSelected(const QModelIndex& selected);

signals:
Expand Down
Loading

0 comments on commit 6ae7736

Please sign in to comment.