代码拉取完成,页面将自动刷新
#include <QDebug>
#include "sourcesdata.h"
static bool registered = false;
SourcesData::SourcesData(QObject *parent) : QObject{parent}
{
Initialization();
}
SourcesData::SourcesData(const SourcesData &src, QObject *parent) : QObject{parent}
{
Initialization();
Copy(src);
}
SourcesData::~SourcesData()
{
}
SourcesData &SourcesData::operator=(const SourcesData &src)
{
Initialization();
return Copy(src);
}
bool SourcesData::operator==(const SourcesData &dst) const
{
if (this->type != dst.type) { return false; }
if (this->archs != dst.archs) { return false; }
if (this->sign != dst.sign) { return false; }
if (this->url != dst.url) { return false; }
if (this->codename != dst.codename) { return false; }
if (this->repos != dst.repos) { return false; }
return true;
}
QString SourcesData::toSourcesList() const
{
QStringList items;
items << type;
if (!archs.isEmpty()) {
if (sign.isEmpty()) {
items << QString("[arch=%1]").arg(archs.join(","));
} else {
items << QString("[arch=%1 signed-by=%2]").arg(archs.join(","), sign);
}
}
items << url;
items << codename;
items << repos.join(" ");
return items.join(" ");
}
void SourcesData::Initialization()
{
if (!registered) {
//RegisterMetaTypes(SourcesData);
registered = true;
}
}
SourcesData &SourcesData::Copy(const SourcesData &src)
{
this->type = src.type;
this->archs = src.archs;
this->sign = src.sign;
this->url = src.url;
this->codename = src.codename;
this->repos = src.repos;
return *this;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。