Fix macos build
This commit is contained in:
@@ -648,7 +648,7 @@ bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, int ro
|
||||
if (const SongMimeData *song_data = qobject_cast<const SongMimeData*>(data)) {
|
||||
// Dragged from a collection
|
||||
// We want to check if these songs are from the actual local file backend, if they are we treat them differently.
|
||||
if (song_data->backend && song_data->backend->songs_table() == Collection::kSongsTable)
|
||||
if (song_data->backend && song_data->backend->songs_table() == SCollection::kSongsTable)
|
||||
InsertSongItems<CollectionPlaylistItem>(song_data->songs, row, play_now, enqueue_now);
|
||||
else
|
||||
InsertSongItems<SongPlaylistItem>(song_data->songs, row, play_now, enqueue_now);
|
||||
@@ -955,7 +955,7 @@ void Playlist::InsertSongsOrCollectionItems(const SongList &songs, int pos, bool
|
||||
}
|
||||
|
||||
void Playlist::UpdateItems(const SongList &songs) {
|
||||
|
||||
|
||||
qLog(Debug) << "Updating playlist with new tracks' info";
|
||||
// We first convert our songs list into a linked list (a 'real' list), because removals are faster with QLinkedList.
|
||||
// Next, we walk through the list of playlist's items then the list of songs
|
||||
|
||||
@@ -70,9 +70,9 @@
|
||||
#include "playlist/playlist.h"
|
||||
#include "playlistdelegates.h"
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
#ifdef Q_OS_MACOS
|
||||
#include "core/mac_utilities.h"
|
||||
#endif // Q_OS_DARWIN
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
const int QueuedItemDelegate::kQueueBoxBorder = 1;
|
||||
const int QueuedItemDelegate::kQueueBoxCornerRadius = 3;
|
||||
@@ -484,7 +484,7 @@ void SongSourceDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
||||
QPixmap pixmap = LookupPixmap(url, option_copy.decorationSize);
|
||||
|
||||
float device_pixel_ratio = 1.0f;
|
||||
#ifdef Q_OS_DARWIN
|
||||
#ifdef Q_OS_MACOS
|
||||
QWidget *parent_widget = reinterpret_cast<QWidget*>(parent());
|
||||
device_pixel_ratio = mac::GetDevicePixelRatio(parent_widget);
|
||||
#endif
|
||||
|
||||
@@ -53,7 +53,7 @@ PlaylistItem* PlaylistItem::NewFromType(const QString &type) {
|
||||
|
||||
PlaylistItem* PlaylistItem::NewFromSongsTable(const QString &table, const Song &song) {
|
||||
|
||||
if (table == Collection::kSongsTable)
|
||||
if (table == SCollection::kSongsTable)
|
||||
return new CollectionPlaylistItem(song);
|
||||
|
||||
qLog(Warning) << "Invalid PlaylistItem songs table:" << table;
|
||||
|
||||
@@ -186,7 +186,7 @@ PlaylistView::PlaylistView(QWidget *parent)
|
||||
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
#ifdef Q_OS_MACOS
|
||||
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
#endif
|
||||
// For fading
|
||||
@@ -523,7 +523,7 @@ void PlaylistView::keyPressEvent(QKeyEvent *event) {
|
||||
else if (event == QKeySequence::Delete) {
|
||||
RemoveSelected(false);
|
||||
event->accept();
|
||||
#ifdef Q_OS_DARWIN
|
||||
#ifdef Q_OS_MACOS
|
||||
}
|
||||
else if (event->key() == Qt::Key_Backspace) {
|
||||
RemoveSelected(false);
|
||||
|
||||
Reference in New Issue
Block a user