1 Star 0 Fork 0

KylinOS.Dev/Kylin Desktop Integrity Checker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sourcesdata.cpp 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
王泓 提交于 2023-11-06 17:28 . add base logic
#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;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/kylinos-dev/kylin-desktop-integrity-checker.git
git@gitee.com:kylinos-dev/kylin-desktop-integrity-checker.git
kylinos-dev
kylin-desktop-integrity-checker
Kylin Desktop Integrity Checker
master

搜索帮助