imagewriter: Windows: Remove taskbar progress indicator

This is no longer supported in Qt6, with no replacement available.
This commit is contained in:
Tom Dewey 2024-07-31 13:56:29 +01:00 committed by Tom Dewey
parent bb30d38b77
commit 103924eff0
2 changed files with 0 additions and 45 deletions

View file

@ -46,8 +46,6 @@
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <windows.h>
#include <QWinTaskbarButton>
#include <QWinTaskbarProgress>
#include <QProcessEnvironment> #include <QProcessEnvironment>
#endif #endif
@ -108,10 +106,6 @@ ImageWriter::ImageWriter(QObject *parent)
} }
#endif #endif
#ifdef Q_OS_WIN
_taskbarButton = nullptr;
#endif
if (!_settings.isWritable() && !_settings.fileName().isEmpty()) if (!_settings.isWritable() && !_settings.fileName().isEmpty())
{ {
/* Settings file is not writable, probably run by root previously */ /* Settings file is not writable, probably run by root previously */
@ -667,19 +661,6 @@ DriveListModel *ImageWriter::getDriveList()
void ImageWriter::startProgressPolling() void ImageWriter::startProgressPolling()
{ {
_powersave.applyBlock(tr("Downloading and writing image")); _powersave.applyBlock(tr("Downloading and writing image"));
#ifdef Q_OS_WIN
if (!_taskbarButton && _engine)
{
QWindow* window = qobject_cast<QWindow*>( _engine->rootObjects().at(0) );
if (window)
{
_taskbarButton = new QWinTaskbarButton(this);
_taskbarButton->setWindow(window);
_taskbarButton->progress()->setMaximum(0);
_taskbarButton->progress()->setVisible(true);
}
}
#endif
_dlnow = 0; _verifynow = 0; _dlnow = 0; _verifynow = 0;
_polltimer.start(PROGRESS_UPDATE_INTERVAL); _polltimer.start(PROGRESS_UPDATE_INTERVAL);
} }
@ -688,14 +669,6 @@ void ImageWriter::stopProgressPolling()
{ {
_polltimer.stop(); _polltimer.stop();
pollProgress(); pollProgress();
#ifdef Q_OS_WIN
if (_taskbarButton)
{
_taskbarButton->progress()->setVisible(false);
_taskbarButton->deleteLater();
_taskbarButton = nullptr;
}
#endif
_powersave.removeBlock(); _powersave.removeBlock();
} }
@ -719,13 +692,6 @@ void ImageWriter::pollProgress()
if (newDlNow != _dlnow) if (newDlNow != _dlnow)
{ {
_dlnow = newDlNow; _dlnow = newDlNow;
#ifdef Q_OS_WIN
if (_taskbarButton)
{
_taskbarButton->progress()->setMaximum(dlTotal/1048576);
_taskbarButton->progress()->setValue(newDlNow/1048576);
}
#endif
emit downloadProgress(newDlNow, dlTotal); emit downloadProgress(newDlNow, dlTotal);
} }
@ -735,13 +701,6 @@ void ImageWriter::pollProgress()
{ {
_verifynow = newVerifyNow; _verifynow = newVerifyNow;
quint64 verifyTotal = _thread->verifyTotal(); quint64 verifyTotal = _thread->verifyTotal();
#ifdef Q_OS_WIN
if (_taskbarButton)
{
_taskbarButton->progress()->setMaximum(verifyTotal/1048576);
_taskbarButton->progress()->setValue(newVerifyNow/1048576);
}
#endif
emit verifyProgress(newVerifyNow, verifyTotal); emit verifyProgress(newVerifyNow, verifyTotal);
} }
} }

View file

@ -23,7 +23,6 @@
class QQmlApplicationEngine; class QQmlApplicationEngine;
class DownloadThread; class DownloadThread;
class QNetworkReply; class QNetworkReply;
class QWinTaskbarButton;
class QTranslator; class QTranslator;
class ImageWriter : public QObject class ImageWriter : public QObject
@ -203,9 +202,6 @@ protected:
QMap<QString,QString> _translations; QMap<QString,QString> _translations;
bool _customCacheFile; bool _customCacheFile;
QTranslator *_trans; QTranslator *_trans;
#ifdef Q_OS_WIN
QWinTaskbarButton *_taskbarButton;
#endif
void _parseCompressedFile(); void _parseCompressedFile();
void _parseXZFile(); void _parseXZFile();