Changeset View
Changeset View
Standalone View
Standalone View
host/downloadjob.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 82 | { | |||
---|---|---|---|---|---|
93 | it = payload.constFind(QStringLiteral("finalUrl")); | 93 | it = payload.constFind(QStringLiteral("finalUrl")); | ||
94 | if (it != end) { | 94 | if (it != end) { | ||
95 | m_finalUrl = QUrl(it->toString()); | 95 | m_finalUrl = QUrl(it->toString()); | ||
96 | descriptionDirty = true; | 96 | descriptionDirty = true; | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | it = payload.constFind(QStringLiteral("filename")); | 99 | it = payload.constFind(QStringLiteral("filename")); | ||
100 | if (it != end) { | 100 | if (it != end) { | ||
101 | m_destination = QUrl::fromLocalFile(it->toString()); | 101 | const QUrl destination = QUrl::fromLocalFile(it->toString()); | ||
102 | | ||||
103 | setProperty("destUrl", destination.toString(QUrl::RemoveFilename | QUrl::StripTrailingSlash)); | ||||
104 | | ||||
105 | m_destination = destination; | ||||
102 | descriptionDirty = true; | 106 | descriptionDirty = true; | ||
103 | } | 107 | } | ||
104 | 108 | | |||
105 | it = payload.constFind(QStringLiteral("totalBytes")); | 109 | it = payload.constFind(QStringLiteral("totalBytes")); | ||
106 | if (it != end) { | 110 | if (it != end) { | ||
107 | setTotalAmount(Bytes, it->toDouble()); | 111 | setTotalAmount(Bytes, it->toDouble()); | ||
108 | } | 112 | } | ||
109 | 113 | | |||
110 | it = payload.constFind(QStringLiteral("bytesReceived")); | 114 | it = payload.constFind(QStringLiteral("bytesReceived")); | ||
111 | if (it != end) { | 115 | if (it != end) { | ||
112 | setProcessedAmount(Bytes, it->toDouble()); | 116 | setProcessedAmount(Bytes, it->toDouble()); | ||
113 | } | 117 | } | ||
114 | 118 | | |||
119 | setTotalAmount(Files, 1); | ||||
120 | | ||||
115 | it = payload.constFind(QStringLiteral("paused")); | 121 | it = payload.constFind(QStringLiteral("paused")); | ||
116 | if (it != end) { | 122 | if (it != end) { | ||
117 | const bool paused = it->toBool(); | 123 | const bool paused = it->toBool(); | ||
118 | 124 | | |||
119 | if (paused) { | 125 | if (paused) { | ||
120 | suspend(); | 126 | suspend(); | ||
121 | } else { | 127 | } else { | ||
122 | resume(); | 128 | resume(); | ||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |