File indexing completed on 2024-05-05 05:40:26

0001 /***************************************************************************
0002  *  Copyright (C) 2021 by Renaud Guezennec                               *
0003  *   http://www.rolisteam.org/contact                                      *
0004  *                                                                         *
0005  *   This software is free software; you can redistribute it and/or modify *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; if not, write to the                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
0019  ***************************************************************************/
0020 #include "data/media.h"
0021 namespace campaign
0022 {
0023 Media::Media(const QString& id, const QString& name, const QString& path, Core::MediaType type, QDateTime creation,
0024              QObject* parent)
0025     : QObject(parent), m_id(id), m_type(type), m_name(name), m_path(path), m_creation(creation)
0026 {
0027 }
0028 
0029 QString Media::name() const
0030 {
0031     return m_name;
0032 }
0033 
0034 QString Media::path() const
0035 {
0036     return m_path;
0037 }
0038 
0039 Core::MediaType Media::type() const
0040 {
0041     return m_type;
0042 }
0043 
0044 QString Media::id() const
0045 {
0046     return m_id;
0047 }
0048 
0049 QDateTime Media::addedTime() const
0050 {
0051     return m_creation;
0052 }
0053 
0054 void Media::setPath(const QString& path)
0055 {
0056     if(path == m_path)
0057         return;
0058     m_path= path;
0059     emit pathChanged();
0060 }
0061 
0062 void Media::setName(const QString& name)
0063 {
0064     if(name == m_name)
0065         return;
0066     m_name= name;
0067     emit nameChanged();
0068 }
0069 } // namespace campaign