代码拉取完成,页面将自动刷新
同步操作将从 GXDE OS/gxde-deb-installer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: sbw <sbw@sbw.so>
*
* Maintainer: sbw <sbw@sbw.so>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PACKAGESMANAGER_H
#define PACKAGESMANAGER_H
#include "result.h"
#include <memory>
#include <QObject>
#include <QFuture>
#include <QSharedPointer>
#include <QApt/Backend>
#include <QApt/DebFile>
typedef Result<QString> ConflictResult;
class PackageDependsStatus
{
public:
static PackageDependsStatus ok();
static PackageDependsStatus available();
static PackageDependsStatus _break(const QString &package);
PackageDependsStatus();
PackageDependsStatus(const int status, const QString &package);
PackageDependsStatus operator =(const PackageDependsStatus &other);
PackageDependsStatus max(const PackageDependsStatus &other);
PackageDependsStatus maxEq(const PackageDependsStatus &other);
PackageDependsStatus min(const PackageDependsStatus &other);
PackageDependsStatus minEq(const PackageDependsStatus &other);
bool isBreak() const;
bool isAvailable() const;
public:
int status;
QString package;
};
class DebListModel;
class PackagesManager : public QObject
{
Q_OBJECT
friend class DebListModel;
public:
explicit PackagesManager(QObject *parent = 0);
bool isBackendReady();
bool isArchError(const int idx);
const ConflictResult packageConflictStat(const int index);
const ConflictResult isConflictSatisfy(const QString &arch, QApt::Package *package);
const ConflictResult isInstalledConflict(const QString &packageName, const QString &packageVersion, const QString &packageArch);
const ConflictResult isConflictSatisfy(const QString &arch, const QList<QApt::DependencyItem> &conflicts);
int packageInstallStatus(const int index);
PackageDependsStatus packageDependsStatus(const int index);
const QString packageInstalledVersion(const int index);
const QStringList packageAvailableDepends(const int index);
void packageCandidateChoose(QSet<QString> &choosed_set, const QString &debArch, const QList<QApt::DependencyItem> &dependsList);
void packageCandidateChoose(QSet<QString> &choosed_set, const QString &debArch, const QApt::DependencyItem &candidateItem);
const QStringList packageReverseDependsList(const QString &packageName, const QString &sysArch);
void reset();
void resetPackageDependsStatus(const int index);
void removePackage(const int index);
void appendPackage(std::shared_ptr<QApt::DebFile> debPackage);
std::shared_ptr<QApt::DebFile> const package(const int index) const { return m_preparedPackages[index]; }
QSharedPointer<QApt::Backend> const backend() const { return m_backendFuture.result(); }
private:
const PackageDependsStatus checkDependsPackageStatus(QSet<QString> &choosed_set,const QString &architecture, const QList<QApt::DependencyItem> &depends);
const PackageDependsStatus checkDependsPackageStatus(QSet<QString> &choosed_set,const QString &architecture, const QApt::DependencyItem &candicate);
const PackageDependsStatus checkDependsPackageStatus(QSet<QString> &choosed_set,const QString &architecture, const QApt::DependencyInfo &dependencyInfo);
std::pair<QApt::Package *, bool> packageWithArch(const QString &packageName, const QString &sysArch, const QString &annotation = QString());
private:
QFuture<QSharedPointer<QApt::Backend>> m_backendFuture;
QList<std::shared_ptr<QApt::DebFile>> m_preparedPackages;
QHash<int, int> m_packageInstallStatus;
QHash<int, PackageDependsStatus> m_packageDependsStatus;
QSet<QByteArray> m_appendedPackagesMd5;
};
#endif // PACKAGESMANAGER_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。