Changeset View
Changeset View
Standalone View
Standalone View
src/core/global.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 84 | { | |||
---|---|---|---|---|---|
91 | const QString timeStr(time.toString(QStringLiteral("hh:mm:ss"))); | 91 | const QString timeStr(time.toString(QStringLiteral("hh:mm:ss"))); | ||
92 | if (days > 0) { | 92 | if (days > 0) { | ||
93 | return i18np("1 day %2", "%1 days %2", days, timeStr); | 93 | return i18np("1 day %2", "%1 days %2", days, timeStr); | ||
94 | } else { | 94 | } else { | ||
95 | return timeStr; | 95 | return timeStr; | ||
96 | } | 96 | } | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | #if KIOCORE_BUILD_DEPRECATED_SINCE(3, 4) | ||||
meven: Pretty old deprecation ^^ | |||||
99 | KIOCORE_EXPORT QTime KIO::calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed) | 100 | KIOCORE_EXPORT QTime KIO::calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed) | ||
100 | { | 101 | { | ||
101 | QTime remainingTime; | 102 | QTime remainingTime; | ||
102 | 103 | | |||
103 | if (speed != 0) { | 104 | if (speed != 0) { | ||
104 | KIO::filesize_t secs; | 105 | KIO::filesize_t secs; | ||
105 | if (totalSize == 0) { | 106 | if (totalSize == 0) { | ||
106 | secs = 0; | 107 | secs = 0; | ||
107 | } else { | 108 | } else { | ||
108 | secs = (totalSize - processedSize) / speed; | 109 | secs = (totalSize - processedSize) / speed; | ||
109 | } | 110 | } | ||
110 | if (secs >= (24 * 60 * 60)) { // Limit to 23:59:59 | 111 | if (secs >= (24 * 60 * 60)) { // Limit to 23:59:59 | ||
111 | secs = (24 * 60 * 60) - 1; | 112 | secs = (24 * 60 * 60) - 1; | ||
112 | } | 113 | } | ||
113 | int hr = secs / (60 * 60); | 114 | int hr = secs / (60 * 60); | ||
114 | int mn = (secs - hr * 60 * 60) / 60; | 115 | int mn = (secs - hr * 60 * 60) / 60; | ||
115 | int sc = (secs - hr * 60 * 60 - mn * 60); | 116 | int sc = (secs - hr * 60 * 60 - mn * 60); | ||
116 | 117 | | |||
117 | remainingTime.setHMS(hr, mn, sc); | 118 | remainingTime.setHMS(hr, mn, sc); | ||
118 | } | 119 | } | ||
119 | 120 | | |||
120 | return remainingTime; | 121 | return remainingTime; | ||
121 | } | 122 | } | ||
123 | #endif | ||||
122 | 124 | | |||
123 | KIOCORE_EXPORT QString KIO::itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize) | 125 | KIOCORE_EXPORT QString KIO::itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize) | ||
124 | { | 126 | { | ||
125 | if (files == 0 && dirs == 0 && items == 0) { | 127 | if (files == 0 && dirs == 0 && items == 0) { | ||
126 | return i18np("%1 Item", "%1 Items", 0); | 128 | return i18np("%1 Item", "%1 Items", 0); | ||
127 | } | 129 | } | ||
128 | 130 | | |||
129 | QString summary; | 131 | QString summary; | ||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | 277 | { | |||
284 | } | 286 | } | ||
285 | if (url.hasFragment()) { | 287 | if (url.hasFragment()) { | ||
286 | u.setFragment(QString()); | 288 | u.setFragment(QString()); | ||
287 | } | 289 | } | ||
288 | u = u.adjusted(QUrl::StripTrailingSlash); /// don't combine with the line below | 290 | u = u.adjusted(QUrl::StripTrailingSlash); /// don't combine with the line below | ||
289 | return u.adjusted(QUrl::RemoveFilename); | 291 | return u.adjusted(QUrl::RemoveFilename); | ||
290 | } | 292 | } | ||
291 | 293 | | |||
294 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 61) | ||||
292 | QString KIO::suggestName(const QUrl &baseURL, const QString &oldName) | 295 | QString KIO::suggestName(const QUrl &baseURL, const QString &oldName) | ||
293 | { | 296 | { | ||
294 | return KFileUtils::suggestName(baseURL, oldName); | 297 | return KFileUtils::suggestName(baseURL, oldName); | ||
295 | } | 298 | } | ||
299 | #endif |
Pretty old deprecation ^^