Add cpp files for classes with only header files
This commit is contained in:
37
src/playlist/playlistitemmimedata.cpp
Normal file
37
src/playlist/playlistitemmimedata.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Strawberry Music Player
|
||||
* This file was part of Clementine.
|
||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Strawberry is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "playlistitemmimedata.h"
|
||||
#include "playlistitem.h"
|
||||
|
||||
PlaylistItemMimeData::PlaylistItemMimeData(const PlaylistItemPtr &item, QObject *parent)
|
||||
: items_(PlaylistItemPtrList() << item) {
|
||||
|
||||
Q_UNUSED(parent);
|
||||
|
||||
}
|
||||
|
||||
PlaylistItemMimeData::PlaylistItemMimeData(const PlaylistItemPtrList &items, QObject *parent)
|
||||
: items_(items) {
|
||||
|
||||
Q_UNUSED(parent);
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
* Strawberry Music Player
|
||||
* This file was part of Clementine.
|
||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,8 +33,8 @@ class PlaylistItemMimeData : public MimeData {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PlaylistItemMimeData(const PlaylistItemPtr &item, QObject* = nullptr) : MimeData(), items_(PlaylistItemPtrList() << item) {}
|
||||
explicit PlaylistItemMimeData(const PlaylistItemPtrList &items, QObject* = nullptr) : MimeData(), items_(items) {}
|
||||
explicit PlaylistItemMimeData(const PlaylistItemPtr &item, QObject *parent = nullptr);
|
||||
explicit PlaylistItemMimeData(const PlaylistItemPtrList &items, QObject *parent = nullptr);
|
||||
|
||||
PlaylistItemPtrList items_;
|
||||
};
|
||||
|
||||
36
src/playlist/playlistlistsortfiltermodel.cpp
Normal file
36
src/playlist/playlistlistsortfiltermodel.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Strawberry Music Player
|
||||
* This file was part of Clementine.
|
||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Strawberry is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "playlistlistsortfiltermodel.h"
|
||||
|
||||
PlaylistListSortFilterModel::PlaylistListSortFilterModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent) {}
|
||||
|
||||
bool PlaylistListSortFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const {
|
||||
|
||||
// Compare the display text first.
|
||||
const int ret = left.data().toString().localeAwareCompare(right.data().toString());
|
||||
if (ret < 0) return true;
|
||||
if (ret > 0) return false;
|
||||
|
||||
// Now use the source model row order to ensure we always get a deterministic sorting even when two items are named the same.
|
||||
return left.row() < right.row();
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* Strawberry Music Player
|
||||
* This file was part of Clementine.
|
||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
|
||||
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,18 +28,9 @@ class PlaylistListSortFilterModel : public QSortFilterProxyModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PlaylistListSortFilterModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent) {}
|
||||
explicit PlaylistListSortFilterModel(QObject *parent);
|
||||
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override {
|
||||
// Compare the display text first.
|
||||
const int ret = left.data().toString().localeAwareCompare(right.data().toString());
|
||||
if (ret < 0) return true;
|
||||
if (ret > 0) return false;
|
||||
|
||||
// Now use the source model row order to ensure we always get a deterministic sorting even when two items are named the same.
|
||||
return left.row() < right.row();
|
||||
}
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
|
||||
};
|
||||
|
||||
#endif // PLAYLISTLISTSORTFILTERMODEL_H
|
||||
|
||||
26
src/playlist/songmimedata.cpp
Normal file
26
src/playlist/songmimedata.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Strawberry Music Player
|
||||
* This file was part of Clementine.
|
||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Strawberry is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "songmimedata.h"
|
||||
|
||||
SongMimeData::SongMimeData(QObject *parent) : backend(nullptr) {
|
||||
Q_UNUSED(parent);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
* Strawberry Music Player
|
||||
* This file was part of Clementine.
|
||||
* Copyright 2010, David Sansome <me@davidsansome.com>
|
||||
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
|
||||
*
|
||||
* Strawberry is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -23,9 +24,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QMimeData>
|
||||
|
||||
#include "core/shared_ptr.h"
|
||||
#include "core/mimedata.h"
|
||||
#include "core/song.h"
|
||||
@@ -36,7 +34,7 @@ class SongMimeData : public MimeData {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SongMimeData(QObject* = nullptr) : MimeData(), backend(nullptr) {}
|
||||
explicit SongMimeData(QObject *parent = nullptr);
|
||||
|
||||
SharedPtr<CollectionBackendInterface> backend;
|
||||
SongList songs;
|
||||
|
||||
Reference in New Issue
Block a user