diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b86b887bf2..0fae18018b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1742,10 +1742,10 @@ if(KEYFINDER)
set(KeyFinder_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/lib/keyfinder-install")
set(KeyFinder_LIBRARY "lib/${CMAKE_STATIC_LIBRARY_PREFIX}keyfinder${CMAKE_STATIC_LIBRARY_SUFFIX}")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/download")
- ExternalProject_Add(libKeyFinder
- URL "https://github.com/mixxxdj/libKeyFinder/archive/v2.2.3.zip"
- URL_HASH SHA256=56887e7b51834223d4264f4ea9acf16f0b6a0c706c218478afbaf89ad1f9c6ea
- DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/download/libKeyFinder"
+ ExternalProject_Add(libkeyfinder
+ URL "https://github.com/mixxxdj/libkeyfinder/archive/v2.2.3.zip"
+ URL_HASH SHA256=ad43ca006e3bbed0810ff62e170d04522a64f8606c2166bfa5a9b9158b7ebc11
+ DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/download/libkeyfinder"
INSTALL_DIR "${KeyFinder_INSTALL_DIR}"
CMAKE_ARGS
-DBUILD_STATIC_LIBS=ON
@@ -1769,7 +1769,7 @@ if(KEYFINDER)
file(MAKE_DIRECTORY "${KeyFinder_INSTALL_DIR}/include")
add_library(mixxx-keyfinder STATIC IMPORTED)
- add_dependencies(mixxx-keyfinder libKeyFinder)
+ add_dependencies(mixxx-keyfinder libkeyfinder)
set_target_properties(mixxx-keyfinder PROPERTIES IMPORTED_LOCATION "${KeyFinder_INSTALL_DIR}/${KeyFinder_LIBRARY}")
target_link_libraries(mixxx-keyfinder INTERFACE FFTW::FFTW)
target_include_directories(mixxx-keyfinder INTERFACE "${KeyFinder_INSTALL_DIR}/include")
diff --git a/res/skins/LateNight/decks/preview_deck.xml b/res/skins/LateNight/decks/preview_deck.xml
index 719f1ab6c2b..d009b717f20 100644
--- a/res/skins/LateNight/decks/preview_deck.xml
+++ b/res/skins/LateNight/decks/preview_deck.xml
@@ -4,7 +4,7 @@
- vertical
+ horizontal
me,max
@@ -165,6 +165,12 @@
+
+ PreviewDeckRightSpacer
+ horizontal
+
+
+
[PreviewDeck],show_previewdeck
diff --git a/res/skins/LateNight/library.xml b/res/skins/LateNight/library.xml
index 7311eff7908..6cb0e50ba98 100644
--- a/res/skins/LateNight/library.xml
+++ b/res/skins/LateNight/library.xml
@@ -28,6 +28,8 @@
100,
+
+
@@ -69,7 +71,11 @@
-
+
+ SearchTreeSpacer
+ horizontal
+
+
SidebarCoverSplitter
diff --git a/res/skins/LateNight/palemoon/buttons/btn__lib_checkmark_grey.svg b/res/skins/LateNight/palemoon/buttons/btn__lib_checkmark_grey.svg
new file mode 100644
index 00000000000..8c1e80dac7c
--- /dev/null
+++ b/res/skins/LateNight/palemoon/buttons/btn__lib_checkmark_grey.svg
@@ -0,0 +1,3 @@
+
diff --git a/res/skins/LateNight/palemoon/style/lib_bg.png b/res/skins/LateNight/palemoon/style/lib_bg.png
deleted file mode 100644
index 8d66380880c..00000000000
Binary files a/res/skins/LateNight/palemoon/style/lib_bg.png and /dev/null differ
diff --git a/res/skins/LateNight/style_classic.qss b/res/skins/LateNight/style_classic.qss
index 2f3465a1be6..00b528b1f6a 100644
--- a/res/skins/LateNight/style_classic.qss
+++ b/res/skins/LateNight/style_classic.qss
@@ -65,6 +65,7 @@ WLibrary,
#SidebarBox,
#PreviewDeck,
#LibExpandBox,
+#LibrarySplitter::handle,
#SearchLineBox {
border-top: 1px solid #333;
border-left: 1px solid #333;
@@ -126,6 +127,30 @@ WSearchLineEdit,
background-color: #080808;
}
+/* Some tweaks to create a frameless library table */
+#LibrarySplitter {
+ border-width: 0px;
+ }
+ #LibrarySplitter::handle {
+ border-width: 1px 0px 0px 0px;
+ border-top-right-radius: 0px;
+ border-bottom-right-radius: 0px;
+ border-bottom-left-radius: 0px;
+ }
+ #PreviewDeckRightSpacer,
+ #SearchTreeSpacer {
+ border-right: 1px solid #333;
+ background-color: transparent;
+ }
+ #PreviewDeckRightSpacer {
+ min-width: 4px;
+ max-width: 4px;
+ }
+ #SearchTreeSpacer {
+ min-height: 3px;
+ max-height: 3px;
+ }
+
/* background of fillers */
#FxRackFillerL,
#FxRackFillerR,
@@ -225,10 +250,6 @@ WBeatSpinBox,
WLibrary {
border-top-left-radius: 0px;
-}
-WLibrary,
-#SearchLineBox {
- border-top: 0px;
}
#SearchLineBox {
padding-right: 2px;
@@ -239,9 +260,8 @@ WLibrary,
#LibExpandBox {
qproperty-layoutAlignment: 'AlignVCenter | AlignHCenter';
- border-width: 0px 0px 1px 0px;
+ border-width: 1px 0px 1px 0px;
border-radius: 0px;
- margin-bottom: 3px;
padding: 0px 0px 2px 2px;
}
@@ -312,8 +332,6 @@ WLibrary,
#FxRackFillerL,
#MicAuxRack,
#SamplerRow,
-#LibExpandBox,
-#SearchLineBox,
#PreviewDeck {
margin-bottom: 4px;
}
@@ -354,10 +372,6 @@ WLibrary,
qproperty-layoutSpacing: 3;
}
-#PreviewDeck {
- margin-right: 3px;
-}
-
#SkinSettingsContainer {
margin-left: 3px;
}
@@ -942,7 +956,7 @@ WPushButton#FxSuperLinkInvertButton {
#PreviewDeckTextBox {
}
- #PreviewLabel { /* Placeholder */
+ #PreviewLabel { /* Placeholder when no track is loaded */
padding-left: 2px;
}
#PreviewTitle {
@@ -2278,13 +2292,7 @@ WSearchLineEdit {
/* LibrarySplitter
(the splitter itself is vertical)
Used to split Library sidebar & Tracks table */
-#LibrarySplitter {
- border-top: 1px solid #333333;
-}
-#LibrarySplitter::handle { /*
- background-image: url(skin:/classic/style/library_splitter_handle_unchecked.svg);
- background-position: center top;
- background-repeat: no-repeat; */
+#LibrarySplitter::handle {
image: url(skin:/classic/style/splitter_handle_vertical.png);
background-color: #1e1e1e;
}
diff --git a/res/skins/LateNight/style_palemoon.qss b/res/skins/LateNight/style_palemoon.qss
index f6bc1e5a266..8decacb728b 100644
--- a/res/skins/LateNight/style_palemoon.qss
+++ b/res/skins/LateNight/style_palemoon.qss
@@ -75,9 +75,7 @@
#PreviewDeck,
#SidebarCoverSplitter,
#SidebarCoverSplitter:handle,
-/*#LibrarySplitter,*/
#LibrarySplitter::handle,
-/*WLibrary,*/
QAbstractScrollArea::corner {
border-top: 1px solid #212123;
border-right: 1px solid #111;
@@ -92,10 +90,8 @@ QAbstractScrollArea::corner {
}
#SidebarSearchPreviewContainer {
- background-color: #0f0f0f;
+ margin-top: 1px;
}
-
- /*WLibrary,*/
#SidebarBox {
padding: 2px 0px 0px 2px;
}
@@ -105,7 +101,6 @@ QAbstractScrollArea::corner {
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
}
- /*WLibrary,*/
#SidebarCoverSplitter,
#SidebarCoverSplitter::handle,
#LibrarySplitter,
@@ -116,6 +111,7 @@ QAbstractScrollArea::corner {
#SidebarCoverSplitter::handle {
border-width: 0px;
}
+ /* Some tweaks to create a frameless library table */
#LibrarySplitter {
border-width: 0px;
}
@@ -125,12 +121,20 @@ QAbstractScrollArea::corner {
WLibrary {
border-width: 1px 0px 0px 0px;
}
-/* Some tweaks to create a frameless library table */
+ #PreviewDeckRightSpacer,
+ #SearchTreeSpacer {
+ border-right: 1px solid #222;
+ background-color: transparent;
+ }
+ #PreviewDeckRightSpacer {
+ min-width: 3px;
+ max-width: 3px;
+ }
+ #SearchTreeSpacer {
+ min-height: 3px;
+ max-height: 3px;
+ }
#LibraryContainer {
- background-color: #151517;
- background-image: url(skin:/palemoon/style/lib_bg.png);
- background-position: top;
- background-repeat: repeat-x;
}
#LibraryContainer QScrollBar::handle:horizontal,
#LibraryContainer QScrollBar::handle:vertical,
@@ -173,6 +177,7 @@ WSearchLineEdit {
padding: 5px 0px 0px 8px;
border-top: 1px solid #212123;
}
+
#WaveformsFrame,
#OverviewBox,
#OverviewBoxMini,
@@ -242,7 +247,6 @@ WSearchLineEdit {
}
#SearchLineBox {
- margin-top: 1px;
padding-right: 2px;
border-right: 0px;
border-top-right-radius: 0px;
@@ -254,9 +258,7 @@ WSearchLineEdit {
border-right: 0px;
border-left: 0px;
border-radius: 0px;
- margin-bottom: 3px;
padding: 0px 2px 2px 2px;
- margin-top: 1px;
}
#SidebarBox {
@@ -397,8 +399,6 @@ WSearchLineEdit {
#FxRackFillerL,
#MicAuxRack,
#SamplerRow,
-#LibExpandBox,
-#SearchLineBox,
#PreviewDeck {
margin-bottom: 3px;
}
@@ -445,7 +445,8 @@ WSearchLineEdit {
}
#PreviewDeck {
- margin-right: 3px;
+ /* right margin is managed by #PreviewDeckRightSpacer which
+ also generates the left border of the splitter handle */
}
#SkinSettingsContainer {
@@ -1089,7 +1090,7 @@ WPushButton#FxSuperLinkInvertButton {
#PreviewDeckTextBox {
}
- #PreviewLabel { /* Placeholder */
+ #PreviewLabel { /* Placeholder when no track is loaded */
padding-left: 2px;
}
#PreviewTitle {
@@ -1233,10 +1234,18 @@ WEffectSelector,
font-size: 14px;
}
/* dimĀ² ivory */
- #Deck1 #PlayPositionText, #DeckCompact1 #PlayPositionTextSmall, #DeckMini1 #PlayPositionTextSmall,
- #Deck1 #KeyText, #DeckCompact1 #KeyText, #DeckMini1 #KeyTextSmall,
- #Deck2 #PlayPositionText, #DeckCompact2 #PlayPositionTextSmall, #DeckMini2 #PlayPositionTextSmall,
- #Deck2 #KeyText, #DeckCompact2 #KeyText, #DeckMini2 #KeyTextSmall,
+ #Deck1 #PlayPositionText,
+ #DeckCompact1 #PlayPositionTextSmall,
+ #DeckMini1 #PlayPositionTextSmall,
+ #Deck1 #KeyText,
+ #DeckCompact1 #KeyText,
+ #DeckMini1 #KeyTextSmall,
+ #Deck2 #PlayPositionText,
+ #DeckCompact2 #PlayPositionTextSmall,
+ #DeckMini2 #PlayPositionTextSmall,
+ #Deck2 #KeyText,
+ #DeckCompact2 #KeyText,
+ #DeckMini2 #KeyTextSmall,
#SamplerBpm, #SamplerBpmMini,
#LibraryContainer QHeaderView {
color: #766b65;
@@ -1248,16 +1257,30 @@ WEffectSelector,
}
/* pale blue */
-#Deck3 #TitleText, #Deck3 #ArtistText,
- #DeckCompact3 #TitleText, #DeckCompact3 #ArtistText,
- #DeckMini3 #TitleTextSmall, #DeckMini3 #ArtistTextSmall,
- #Deck3 #BpmText, #DeckCompact3 #BpmText, #DeckMini3 #BpmTextSmall,
- #Deck3 #KeyText, #DeckCompact3 #KeyText, #DeckMini3 #KeyTextSmall,
-#Deck4 #TitleText, #Deck4 #ArtistText,
- #DeckCompact4 #TitleText, #DeckCompact4 #ArtistText,
- #DeckMini4 #TitleTextSmall, #DeckMini4 #ArtistTextSmall,
- #Deck4 #BpmText, #DeckCompact4 #BpmText, #DeckMini4 #BpmTextSmall,
- #Deck4 #KeyText, #DeckCompact4 #KeyText, #DeckMini4 #KeyTextSmall {
+#Deck3 #TitleText,
+ #Deck3 #ArtistText,
+ #DeckCompact3 #TitleText,
+ #DeckCompact3 #ArtistText,
+ #DeckMini3 #TitleTextSmall,
+ #DeckMini3 #ArtistTextSmall,
+ #Deck3 #BpmText,
+ #DeckCompact3 #BpmText,
+ #DeckMini3 #BpmTextSmall,
+ #Deck3 #KeyText,
+ #DeckCompact3 #KeyText,
+ #DeckMini3 #KeyTextSmall,
+#Deck4 #TitleText,
+ #Deck4 #ArtistText,
+ #DeckCompact4 #TitleText,
+ #DeckCompact4 #ArtistText,
+ #DeckMini4 #TitleTextSmall,
+ #DeckMini4 #ArtistTextSmall,
+ #Deck4 #BpmText,
+ #DeckCompact4 #BpmText,
+ #DeckMini4 #BpmTextSmall,
+ #Deck4 #KeyText,
+ #DeckCompact4 #KeyText,
+ #DeckMini4 #KeyTextSmall {
color: #85bdbb;
}
#Deck3 WStarRating, #DeckCompact3 WStarRating,
@@ -1457,9 +1480,7 @@ WEffectSelector,
#LibraryContainer QHeaderView {
border-bottom-right-radius: 1px solid #000;
- outline: none; /*
- border-width: 1px 0px 1px 0px;
- border-image: url(skin:/palemoon/buttons/btn_embedded_library_header.svg) 1 1 1 1; */
+ outline: none;
}
#LibraryContainer QHeaderView::section {
outline: none;
@@ -1768,8 +1789,8 @@ WPushButton#FxSuperLinkInvertButton[displayValue="0"] {
}
/* Yellow */
-#RecFeedback[displayValue="1"], /* initialize recording */
-#BroadcastButton[displayValue="1"] /* connecting */ {
+#RecFeedback[displayValue="1"], /* initialize recording */
+#BroadcastButton[displayValue="1"] /* connecting */ {
background-color: #d09300;
}
@@ -1778,15 +1799,14 @@ WPushButton#FxSuperLinkInvertButton[displayValue="0"] {
}
/* pink */
-#BroadcastButton[displayValue="3"],
-#RecFeedback[displayValue="3"] { /* failure */
+#BroadcastButton[displayValue="3"], /* failure */
+#RecFeedback[displayValue="3"] {
background-color: #f856e7;
}
/* Grey for GUI toggles */
#GuiToggleButton[displayValue="1"],
-#SkinSettingsToggle[displayValue="1"] { /*
- background-color: #216e75; Pale blue */
+#SkinSettingsToggle[displayValue="1"] {
background-color: #555;
}
diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp
index 2737ff9dd66..b1314b323d5 100644
--- a/src/library/basesqltablemodel.cpp
+++ b/src/library/basesqltablemodel.cpp
@@ -373,7 +373,7 @@ void BaseSqlTableModel::setTable(const QString& tableName,
m_bInitialized = true;
}
-int BaseSqlTableModel::columnIndexFromSortColumnId(TrackModel::SortColumnId column) {
+int BaseSqlTableModel::columnIndexFromSortColumnId(TrackModel::SortColumnId column) const {
if (column == TrackModel::SortColumnId::Invalid) {
return -1;
}
@@ -381,7 +381,7 @@ int BaseSqlTableModel::columnIndexFromSortColumnId(TrackModel::SortColumnId colu
return m_columnIndexBySortColumnId[static_cast(column)];
}
-TrackModel::SortColumnId BaseSqlTableModel::sortColumnIdFromColumnIndex(int index) {
+TrackModel::SortColumnId BaseSqlTableModel::sortColumnIdFromColumnIndex(int index) const {
return m_sortColumnIdByColumnIndex.value(index, TrackModel::SortColumnId::Invalid);
}
diff --git a/src/library/basesqltablemodel.h b/src/library/basesqltablemodel.h
index 82081abbfa1..a7c46f60897 100644
--- a/src/library/basesqltablemodel.h
+++ b/src/library/basesqltablemodel.h
@@ -58,8 +58,8 @@ class BaseSqlTableModel : public BaseTrackTableModel {
void search(const QString& searchText, const QString& extraFilter = QString()) override;
const QString currentSearch() const override;
- TrackModel::SortColumnId sortColumnIdFromColumnIndex(int column) override;
- int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) override;
+ TrackModel::SortColumnId sortColumnIdFromColumnIndex(int column) const override;
+ int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) const override;
void hideTracks(const QModelIndexList& indices) override;
diff --git a/src/library/browse/browsetablemodel.cpp b/src/library/browse/browsetablemodel.cpp
index 32ef3cb01a9..a61914b4f49 100644
--- a/src/library/browse/browsetablemodel.cpp
+++ b/src/library/browse/browsetablemodel.cpp
@@ -164,7 +164,7 @@ BrowseTableModel::BrowseTableModel(QObject* parent,
BrowseTableModel::~BrowseTableModel() {
}
-int BrowseTableModel::columnIndexFromSortColumnId(TrackModel::SortColumnId column) {
+int BrowseTableModel::columnIndexFromSortColumnId(TrackModel::SortColumnId column) const {
if (column < TrackModel::SortColumnId::IdMin ||
column >= TrackModel::SortColumnId::IdMax) {
return -1;
@@ -173,7 +173,7 @@ int BrowseTableModel::columnIndexFromSortColumnId(TrackModel::SortColumnId colum
return m_columnIndexBySortColumnId[static_cast(column)];
}
-TrackModel::SortColumnId BrowseTableModel::sortColumnIdFromColumnIndex(int index) {
+TrackModel::SortColumnId BrowseTableModel::sortColumnIdFromColumnIndex(int index) const {
return m_sortColumnIdByColumnIndex.value(index, TrackModel::SortColumnId::Invalid);
}
@@ -460,7 +460,7 @@ void BrowseTableModel::trackLoaded(const QString& group, TrackPointer pTrack) {
}
}
-bool BrowseTableModel::isColumnSortable(int column) {
+bool BrowseTableModel::isColumnSortable(int column) const {
return COLUMN_PREVIEW != column;
}
diff --git a/src/library/browse/browsetablemodel.h b/src/library/browse/browsetablemodel.h
index eb95e63c4dd..4df99591e1d 100644
--- a/src/library/browse/browsetablemodel.h
+++ b/src/library/browse/browsetablemodel.h
@@ -69,9 +69,9 @@ class BrowseTableModel final : public QStandardItemModel, public virtual TrackMo
Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role=Qt::EditRole) override;
QAbstractItemDelegate* delegateForColumn(const int i, QObject* pParent) override;
- bool isColumnSortable(int column) override;
- TrackModel::SortColumnId sortColumnIdFromColumnIndex(int index) override;
- int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) override;
+ bool isColumnSortable(int column) const override;
+ TrackModel::SortColumnId sortColumnIdFromColumnIndex(int index) const override;
+ int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) const override;
public slots:
void slotClear(BrowseTableModel*);
diff --git a/src/library/proxytrackmodel.cpp b/src/library/proxytrackmodel.cpp
index 222b638cd73..fba8a6d6037 100644
--- a/src/library/proxytrackmodel.cpp
+++ b/src/library/proxytrackmodel.cpp
@@ -21,14 +21,14 @@ ProxyTrackModel::ProxyTrackModel(QAbstractItemModel* pTrackModel,
ProxyTrackModel::~ProxyTrackModel() {
}
-TrackModel::SortColumnId ProxyTrackModel::sortColumnIdFromColumnIndex(int index) {
- return (m_pTrackModel ? m_pTrackModel->sortColumnIdFromColumnIndex(index)
- : TrackModel::sortColumnIdFromColumnIndex(index));
+TrackModel::SortColumnId ProxyTrackModel::sortColumnIdFromColumnIndex(int index) const {
+ return m_pTrackModel ? m_pTrackModel->sortColumnIdFromColumnIndex(index)
+ : TrackModel::SortColumnId::Invalid;
}
-int ProxyTrackModel::columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) {
- return (m_pTrackModel ? m_pTrackModel->columnIndexFromSortColumnId(sortColumn)
- : TrackModel::columnIndexFromSortColumnId(sortColumn));
+int ProxyTrackModel::columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) const {
+ return m_pTrackModel ? m_pTrackModel->columnIndexFromSortColumnId(sortColumn)
+ : -1;
}
TrackId ProxyTrackModel::getTrackId(const QModelIndex& index) const {
diff --git a/src/library/proxytrackmodel.h b/src/library/proxytrackmodel.h
index d0064476d99..542bf93ec05 100644
--- a/src/library/proxytrackmodel.h
+++ b/src/library/proxytrackmodel.h
@@ -38,8 +38,8 @@ class ProxyTrackModel : public QSortFilterProxyModel, public TrackModel {
QAbstractItemDelegate* delegateForColumn(const int i, QObject* pParent) final;
QString getModelSetting(const QString& name) final;
bool setModelSetting(const QString& name, const QVariant& value) final;
- TrackModel::SortColumnId sortColumnIdFromColumnIndex(int index) override;
- int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) override;
+ TrackModel::SortColumnId sortColumnIdFromColumnIndex(int index) const override;
+ int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) const override;
// Inherited from QSortFilterProxyModel
bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const final;
diff --git a/src/library/trackmodel.h b/src/library/trackmodel.h
index ed776b1a740..9b98e51b2db 100644
--- a/src/library/trackmodel.h
+++ b/src/library/trackmodel.h
@@ -184,20 +184,14 @@ class TrackModel {
m_eDefaultSortOrder = sortOrder;
}
- virtual bool isColumnSortable(int column) {
+ virtual bool isColumnSortable(int column) const {
Q_UNUSED(column);
return true;
}
- virtual SortColumnId sortColumnIdFromColumnIndex(int index) {
- Q_UNUSED(index);
- return TrackModel::SortColumnId::Invalid;
- }
+ virtual SortColumnId sortColumnIdFromColumnIndex(int index) const = 0;
- virtual int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) {
- Q_UNUSED(sortColumn);
- return -1;
- }
+ virtual int columnIndexFromSortColumnId(TrackModel::SortColumnId sortColumn) const = 0;
virtual int fieldIndex(const QString& fieldName) const {
Q_UNUSED(fieldName);
diff --git a/src/preferences/dialog/dlgprefrecord.cpp b/src/preferences/dialog/dlgprefrecord.cpp
index 1df36538edc..533520f293c 100644
--- a/src/preferences/dialog/dlgprefrecord.cpp
+++ b/src/preferences/dialog/dlgprefrecord.cpp
@@ -24,12 +24,13 @@ DlgPrefRecord::DlgPrefRecord(QWidget* parent, UserSettingsPointer pConfig)
// Setting recordings path.
QString recordingsPath = m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY, "Directory"));
- if (recordingsPath == "") {
+ if (recordingsPath.isEmpty()) {
// Initialize recordings path in config to old default path.
// Do it here so we show current value in UI correctly.
QString musicDir = QStandardPaths::writableLocation(QStandardPaths::MusicLocation);
QDir recordDir(musicDir + "/Mixxx/Recordings");
recordingsPath = recordDir.absolutePath();
+ m_pConfig->setValue(ConfigKey(RECORDING_PREF_KEY, "Directory"), recordingsPath);
}
LineEditRecordings->setText(recordingsPath);
connect(PushButtonBrowseRecordings,
@@ -383,13 +384,32 @@ void DlgPrefRecord::loadMetaData() {
void DlgPrefRecord::saveRecordingFolder()
{
- if (LineEditRecordings->text() == "") {
- qDebug() << "Recordings path was empty in dialog";
- return;
- }
- if (LineEditRecordings->text() != m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY, "Directory"))) {
- qDebug() << "Saved recordings path" << LineEditRecordings->text();
- m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "Directory"), LineEditRecordings->text());
+ QString newPath = LineEditRecordings->text();
+ if (newPath != m_pConfig->getValueString(ConfigKey(RECORDING_PREF_KEY, "Directory"))) {
+ QFileInfo fileInfo(newPath);
+ if (!fileInfo.exists()) {
+ QMessageBox::warning(
+ this,
+ tr("Recordings directory invalid"),
+ tr("Recordings directory must be set to an existing directory."));
+ return;
+ }
+ if (!fileInfo.isDir()) {
+ QMessageBox::warning(
+ this,
+ tr("Recordings directory invalid"),
+ tr("Recordings directory must be set to a directory."));
+ return;
+ }
+ if (!fileInfo.isWritable()) {
+ QMessageBox::warning(this,
+ tr("Recordings directory not writable"),
+ tr("You do not have write access to %1. Choose a "
+ "recordings directory you have write access to.")
+ .arg(newPath));
+ return;
+ }
+ m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "Directory"), newPath);
}
}
void DlgPrefRecord::saveMetaData()
diff --git a/src/track/cue.cpp b/src/track/cue.cpp
index ecb23f3425d..d844e55606c 100644
--- a/src/track/cue.cpp
+++ b/src/track/cue.cpp
@@ -15,7 +15,7 @@ inline std::optional positionSamplesToMillis(
double positionSamples,
mixxx::audio::SampleRate sampleRate) {
VERIFY_OR_DEBUG_ASSERT(sampleRate.isValid()) {
- return Cue::kNoPosition;
+ return std::nullopt;
}
if (positionSamples == Cue::kNoPosition) {
return std::nullopt;
diff --git a/src/util/qt.h b/src/util/qt.h
index b9817e957ef..f674d6d7ddb 100644
--- a/src/util/qt.h
+++ b/src/util/qt.h
@@ -51,7 +51,7 @@ class SafeQPointer final {
: m_ptr(ptr) {
}
- void clear() const {
+ void clear() {
m_ptr.clear();
}