File size request from HTTP header, handled the indeterminate size case

This commit is contained in:
Marco Dalla Tiezza
2024-06-13 01:54:59 +02:00
parent 52c4fbcce9
commit 1d795b688e
4 changed files with 136 additions and 88 deletions

View File

@@ -6635,7 +6635,7 @@ G@\x11\x10HG\x93Hp\xec\x0au\xe3\xcd\x1e\xf4\
>k\xd0\xd3b\x1eG\xb5_d\xde\xb6{\x8f\x95\xc5\
U\xaf\xbc\xfd\xe9\xb5\x9f\xe5\xe3}r\xba?\xbbI\x06\
\xfe\xfc\x0f\xf4\xcd*2\
\x00\x00\x06\x95\
\x00\x00\x070\
i\
mport QtQuick\x0d\x0ai\
mport QtQuick.Wi\
@@ -6674,75 +6674,84 @@ ceived\x0d\x0a \
progressBar.to =\
bytesTotal\x0d\x0a \
}\x0d\x0a\x0d\x0a functi\
on updateStatus(\
arg) {\x0d\x0a \
progressLabel.te\
xt = arg\x0d\x0a }\x0d\
\x0a\x0d\x0a Page {\x0d\x0a \
id: page\x0d\
\x0a anchors\
.fill: parent\x0d\x0a\x0d\
\x0a ColumnL\
ayout {\x0d\x0a \
id: columnL\
ayout\x0d\x0a \
anchors.fill:\
parent\x0d\x0a\x0d\x0a \
Label {\x0d\x0a\
\
text: qsTr(\x22Down\
loading in progr\
ess...\x22)\x0d\x0a \
Layout\
.alignment: Qt.A\
lignHCenter | Qt\
.AlignVCenter\x0d\x0a \
}\x0d\x0a\x0d\x0a\
Prog\
ressBar {\x0d\x0a \
id: p\
rogressBar\x0d\x0a \
Layo\
ut.rightMargin: \
20\x0d\x0a \
Layout.leftM\
argin: 20\x0d\x0a \
Layou\
t.fillWidth: tru\
e\x0d\x0a \
value: 0\x0d\x0a \
to:\
0\x0d\x0a \
}\x0d\x0a\x0d\x0a \
Label {\x0d\x0a \
id: pr\
ogressLabel\x0d\x0a \
Lay\
out.alignment: Q\
t.AlignHCenter |\
Qt.AlignVCenter\
\x0d\x0a }\x0d\
\x0a\x0d\x0a B\
utton {\x0d\x0a \
on setIndetermin\
ateBar() {\x0d\x0a \
progressBar.\
indeterminate = \
true\x0d\x0a }\x0d\x0a\x0d\x0a \
function upda\
teStatus(arg) {\x0d\
\x0a progres\
sLabel.text = ar\
g\x0d\x0a }\x0d\x0a\x0d\x0a \
Page {\x0d\x0a \
id: page\x0d\x0a \
anchors.fill: \
parent\x0d\x0a\x0d\x0a \
ColumnLayout {\
\x0d\x0a id\
: columnLayout\x0d\x0a\
anch\
ors.fill: parent\
\x0d\x0a\x0d\x0a \
Label {\x0d\x0a \
text: q\
sTr(\x22Abort\x22)\x0d\x0a \
ic\
on.source: \x22qrc:\
/images/icons/ab\
ort.svg\x22\x0d\x0a \
displa\
y: AbstractButto\
n.TextBesideIcon\
sTr(\x22Downloading\
in progress...\x22\
)\x0d\x0a \
Layout.alignm\
ent: Qt.AlignHCe\
nter | Qt.AlignV\
Center\x0d\x0a \
}\x0d\x0a\x0d\x0a \
ProgressBar\
{\x0d\x0a \
id: progress\
Bar\x0d\x0a \
Layout.righ\
tMargin: 20\x0d\x0a \
Lay\
out.leftMargin: \
20\x0d\x0a \
Layout.fillW\
idth: true\x0d\x0a \
inde\
terminate: false\
\x0d\x0a \
Layout.alignme\
nt: Qt.AlignHCen\
ter | Qt.AlignBo\
ttom\x0d\x0a \
onClicked:\
{ onAbort() }\x0d\x0a\
}\x0d\x0a \
}\x0d\x0a }\x0d\
\x0a}\x0d\x0a\
value: 0\x0d\x0a \
to: \
0\x0d\x0a }\
\x0d\x0a\x0d\x0a \
Label {\x0d\x0a \
id: pro\
gressLabel\x0d\x0a \
Layo\
ut.alignment: Qt\
.AlignHCenter | \
Qt.AlignVCenter\x0d\
\x0a }\x0d\x0a\
\x0d\x0a Bu\
tton {\x0d\x0a \
Layout.a\
lignment: Qt.Ali\
gnHCenter | Qt.A\
lignBottom\x0d\x0a \
text\
: qsTr(\x22Abort\x22)\x0d\
\x0a \
icon.source: \x22q\
rc:/images/icons\
/abort.svg\x22\x0d\x0a \
dis\
play: AbstractBu\
tton.TextBesideI\
con\x0d\x0a \
flat: true\x0d\
\x0a \
onClicked: { on\
Abort() }\x0d\x0a \
}\x0d\x0a \
}\x0d\x0a }\x0d\x0a}\x0d\x0a\
\x00\x00\x05\xac\
i\
mport QtQuick\x0d\x0ai\
@@ -7293,12 +7302,12 @@ qt_resource_struct = b"\
\x00\x00\x01\x8f\xff^8P\
\x00\x00\x03<\x00\x01\x00\x00\x00\x01\x00\x01>\xe2\
\x00\x00\x01\x8f\xff^8P\
\x00\x00\x05\xa8\x00\x00\x00\x00\x00\x01\x00\x01\x9f\xdf\
\x00\x00\x05\xa8\x00\x00\x00\x00\x00\x01\x00\x01\xa0z\
\x00\x00\x01\x8f\xff^8P\
\x00\x00\x03r\x00\x01\x00\x00\x00\x01\x00\x01I\x0c\
\x00\x00\x01\x8f\xff^8_\
\x00\x00\x05\x86\x00\x00\x00\x00\x00\x01\x00\x01\x99F\
\x00\x00\x01\x90\x03\xb0\x82B\
\x00\x00\x01\x90\x0e\xde\xeeO\
\x00\x00\x03X\x00\x02\x00\x00\x00\x04\x00\x00\x00+\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x04\xc4\x00\x01\x00\x00\x00\x01\x00\x01v\x14\
@@ -7317,13 +7326,13 @@ qt_resource_struct = b"\
\x00\x00\x01\x8f\xff^8P\
\x00\x00\x05\x06\x00\x00\x00\x00\x00\x01\x00\x01\x85\xad\
\x00\x00\x01\x8f\xff^8P\
\x00\x00\x05\xdc\x00\x01\x00\x00\x00\x01\x00\x01\xa8\x92\
\x00\x00\x05\xdc\x00\x01\x00\x00\x00\x01\x00\x01\xa9-\
\x00\x00\x01\x8f\xff^8_\
\x00\x00\x06$\x00\x01\x00\x00\x00\x01\x00\x01\xae\xd7\
\x00\x00\x06$\x00\x01\x00\x00\x00\x01\x00\x01\xafr\
\x00\x00\x01\x8f\xff^8_\
\x00\x00\x05\xc0\x00\x01\x00\x00\x00\x01\x00\x01\xa5\x8f\
\x00\x00\x05\xc0\x00\x01\x00\x00\x00\x01\x00\x01\xa6*\
\x00\x00\x01\x8f\xff^8_\
\x00\x00\x06\x00\x00\x01\x00\x00\x00\x01\x00\x01\xabU\
\x00\x00\x06\x00\x00\x01\x00\x00\x00\x01\x00\x01\xab\xf0\
\x00\x00\x01\x8f\xff^8_\
"