fix some error
This commit is contained in:
@@ -15,12 +15,12 @@ QString Utils::declensionLabel(int count)
|
||||
return QString::number(count) + " " + suffix;
|
||||
}
|
||||
|
||||
QString Utils::statusConsole(int status, bool updating, bool installing, bool removing)
|
||||
QString Utils::statusConsole(int index, ProcessManager::Status status)
|
||||
{
|
||||
QString res;
|
||||
if (status == 0 && updating) res = "обновление...";
|
||||
if (status == 1 && installing) res = "установка...";
|
||||
if (status == 2 && removing) res = "удаление...";
|
||||
if (index == 0 && status == ProcessManager::Status::Checking) res = "обновление...";
|
||||
if (index == 1 && status == ProcessManager::Status::Installing) res = "установка...";
|
||||
if (index == 2 && status == ProcessManager::Status::Removing) res = "удаление...";
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QQmlEngine>
|
||||
#include "processmanager.hpp"
|
||||
|
||||
class Utils : public QObject
|
||||
{
|
||||
@@ -14,6 +15,6 @@ class Utils : public QObject
|
||||
explicit Utils(QObject *parent = nullptr);
|
||||
|
||||
Q_INVOKABLE static QString declensionLabel(int count);
|
||||
Q_INVOKABLE static QString statusConsole(int status, bool updating, bool installing, bool removing);
|
||||
Q_INVOKABLE static QString statusConsole(int index, ProcessManager::Status status);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user