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 | #ifndef KIOCORE_NO_DEPRECATED | | |||
dfaure: Isn't some ifdef still needed for this deprecated method? | |||||
I forgot to explicitly mention this in the commit message: no support for EXCLUDE_DEPRECATED_BEFORE_AND_AT for KIO here yet, as version-level-based disabling of API needs some work first, as some undeprecated API is implemented in terms of deprecated still, as I found when testing that support. Gzess that should get an explicit TODO comment, e.g. near the ecm_generate_export_header marcos? kossebau: I forgot to explicitly mention this in the commit message: no support for… | |||||
100 | KIOCORE_EXPORT QTime KIO::calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed) | 99 | KIOCORE_EXPORT QTime KIO::calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed) | ||
101 | { | 100 | { | ||
102 | QTime remainingTime; | 101 | QTime remainingTime; | ||
103 | 102 | | |||
104 | if (speed != 0) { | 103 | if (speed != 0) { | ||
105 | KIO::filesize_t secs; | 104 | KIO::filesize_t secs; | ||
106 | if (totalSize == 0) { | 105 | if (totalSize == 0) { | ||
107 | secs = 0; | 106 | secs = 0; | ||
108 | } else { | 107 | } else { | ||
109 | secs = (totalSize - processedSize) / speed; | 108 | secs = (totalSize - processedSize) / speed; | ||
110 | } | 109 | } | ||
111 | if (secs >= (24 * 60 * 60)) { // Limit to 23:59:59 | 110 | if (secs >= (24 * 60 * 60)) { // Limit to 23:59:59 | ||
112 | secs = (24 * 60 * 60) - 1; | 111 | secs = (24 * 60 * 60) - 1; | ||
113 | } | 112 | } | ||
114 | int hr = secs / (60 * 60); | 113 | int hr = secs / (60 * 60); | ||
115 | int mn = (secs - hr * 60 * 60) / 60; | 114 | int mn = (secs - hr * 60 * 60) / 60; | ||
116 | int sc = (secs - hr * 60 * 60 - mn * 60); | 115 | int sc = (secs - hr * 60 * 60 - mn * 60); | ||
117 | 116 | | |||
118 | remainingTime.setHMS(hr, mn, sc); | 117 | remainingTime.setHMS(hr, mn, sc); | ||
119 | } | 118 | } | ||
120 | 119 | | |||
121 | return remainingTime; | 120 | return remainingTime; | ||
122 | } | 121 | } | ||
123 | #endif | | |||
124 | 122 | | |||
125 | KIOCORE_EXPORT QString KIO::itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize) | 123 | KIOCORE_EXPORT QString KIO::itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize) | ||
126 | { | 124 | { | ||
127 | if (files == 0 && dirs == 0 && items == 0) { | 125 | if (files == 0 && dirs == 0 && items == 0) { | ||
128 | return i18np("%1 Item", "%1 Items", 0); | 126 | return i18np("%1 Item", "%1 Items", 0); | ||
129 | } | 127 | } | ||
130 | 128 | | |||
131 | QString summary; | 129 | QString summary; | ||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Line(s) | 278 | { | |||
289 | } | 287 | } | ||
290 | if (url.hasFragment()) { | 288 | if (url.hasFragment()) { | ||
291 | u.setFragment(QString()); | 289 | u.setFragment(QString()); | ||
292 | } | 290 | } | ||
293 | u = u.adjusted(QUrl::StripTrailingSlash); /// don't combine with the line below | 291 | u = u.adjusted(QUrl::StripTrailingSlash); /// don't combine with the line below | ||
294 | return u.adjusted(QUrl::RemoveFilename); | 292 | return u.adjusted(QUrl::RemoveFilename); | ||
295 | } | 293 | } | ||
296 | 294 | | |||
297 | #ifndef KIOCORE_NO_DEPRECATED | | |||
298 | QString KIO::suggestName(const QUrl &baseURL, const QString &oldName) | 295 | QString KIO::suggestName(const QUrl &baseURL, const QString &oldName) | ||
299 | { | 296 | { | ||
300 | return KFileUtils::suggestName(baseURL, oldName); | 297 | return KFileUtils::suggestName(baseURL, oldName); | ||
301 | } | 298 | } | ||
302 | #endif | |
Isn't some ifdef still needed for this deprecated method?