1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-05-18 20:02:43 +00:00
harbour-sailfin/core/src/viewmodel/userdata.cpp
Chris Josten bb1e3ea21d Repair broken userdata.
The UserData of an item was not displaying, this should re-add it.
2021-08-17 16:43:17 +02:00

47 lines
1.5 KiB
C++

/*
* Sailfin: a Jellyfin client written using Qt
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <JellyfinQt/viewmodel/userdata.h>
namespace Jellyfin {
namespace ViewModel {
UserData::UserData(QObject *parent)
: UserData(QSharedPointer<DTO::UserItemDataDto>::create(), parent) {
}
UserData::UserData(QSharedPointer<DTO::UserItemDataDto> data, QObject *parent)
: QObject(parent),
m_data(data) {
if (m_data.isNull()) {
m_data = QSharedPointer<DTO::UserItemDataDto>::create();
}
}
void UserData::setData(QSharedPointer<DTO::UserItemDataDto> data) {
if (data.isNull()) {
m_data = QSharedPointer<DTO::UserItemDataDto>::create();
} else {
m_data = data;
}
}
} // NS ViewModel
} // NS Jellyfin