nymea/libnymea/platform/repository.cpp

77 lines
2.3 KiB
C++

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright (C) 2019 Michael Zanetti <michael.zanetti@nymea.io> *
* *
* This file is part of nymea. *
* *
* 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, see *
* <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "repository.h"
Repository::Repository(const QString &id, const QString &displayName, bool enabled):
m_id(id),
m_displayName(displayName),
m_enabled(enabled)
{
}
Repository::Repository()
{
}
QString Repository::id() const
{
return m_id;
}
QString Repository::displayName() const
{
return m_displayName;
}
bool Repository::enabled() const
{
return m_enabled;
}
void Repository::setEnabled(bool enabled)
{
m_enabled = enabled;
}
Repositories::Repositories()
{
}
Repositories::Repositories(const QList<Repository> &other): QList<Repository>(other)
{
}
QVariant Repositories::get(int index) const
{
return QVariant::fromValue(at(index));
}
void Repositories::put(const QVariant &variant)
{
append(variant.value<Repository>());
}