Fixed progress bar display.

An Issue with upstream fixes - FedoraQt/MediaWriter Issues #640.
This commit is contained in:
Maria Alexeeva 2024-08-09 15:08:17 +04:00
parent d5e97cfaac
commit a1699b6748
3 changed files with 10 additions and 4 deletions

View File

@ -259,6 +259,12 @@ Progress *Drive::progress() const {
return m_progress;
}
void Drive::updateDrive(const QString &name, uint64_t size, bool containsLive) {
m_name = name;
m_size = size;
setRestoreStatus(containsLive ? CONTAINS_LIVE : CLEAN);
}
QString Drive::name() const {
return QString("%1 (%2)").arg(m_name).arg(readableSize());
}

View File

@ -164,6 +164,8 @@ public:
Progress *progress() const;
virtual void updateDrive(const QString &name, uint64_t size, bool containsLive = false);
virtual QString name() const;
virtual QString readableSize() const;
virtual qreal size() const;

View File

@ -97,11 +97,9 @@ QDBusObjectPath LinuxDriveProvider::handleObject(const QDBusObjectPath &object_p
qDebug() << this->metaObject()->className() << "New drive" << driveId.path() << "-" << name << "(" << size << "bytes;" << (isValid ? "removable;" : "nonremovable;") << connectionBus << ")";
if (isValid) {
// TODO find out why do I do this
if (m_drives.contains(object_path)) {
LinuxDrive *tmp = m_drives[object_path];
emit DriveProvider::driveRemoved(tmp);
m_drives[object_path]->updateDrive(name, size, isoLayout);
return object_path;
}
LinuxDrive *d = new LinuxDrive(this, object_path.path(), name, size, isoLayout);
m_drives[object_path] = d;