-
Notifications
You must be signed in to change notification settings - Fork 31
Use uint64_t for file size #680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,8 +31,7 @@ class OCC::RemoteInfoData : public QSharedData | |
| _size = 0; | ||
| } else { | ||
| if (auto it = Utility::optionalFind(map, "getcontentlength"_L1)) { | ||
| // See #4573, sometimes negative size values are returned | ||
| _size = std::max<int64_t>(0, it->value().toLongLong()); | ||
| _size = it->value().toULongLong(); | ||
|
||
| } else { | ||
| errors.append(u"size"_s); | ||
| } | ||
|
|
@@ -74,7 +73,7 @@ class OCC::RemoteInfoData : public QSharedData | |
| QByteArray _checksumHeader; | ||
| RemotePermissions _remotePerm; | ||
| time_t _modtime = 0; | ||
| int64_t _size = 0; | ||
| uint64_t _size = 0; | ||
| bool _isDirectory = false; | ||
|
|
||
| QString _error; | ||
|
|
@@ -134,7 +133,7 @@ time_t RemoteInfo::modtime() const | |
| return d->_modtime; | ||
| } | ||
|
|
||
| int64_t RemoteInfo::size() const | ||
| uint64_t RemoteInfo::size() const | ||
| { | ||
| return d->_size; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |||||
| #include "common/utility.h" | ||||||
| #include "discoveryphase.h" | ||||||
| #include "filesystem.h" | ||||||
| #include "libsync/common/filesystembase.h" | ||||||
| #include "propagatedownload.h" | ||||||
| #include "propagateremotedelete.h" | ||||||
| #include "propagateremotemkdir.h" | ||||||
|
|
@@ -42,6 +43,7 @@ | |||||
| #include <qmath.h> | ||||||
|
|
||||||
| using namespace std::chrono_literals; | ||||||
| using namespace OCC::FileSystem::SizeLiterals; | ||||||
|
|
||||||
| namespace OCC { | ||||||
|
|
||||||
|
|
@@ -355,10 +357,9 @@ PropagateItemJob *OwncloudPropagator::createJob(const SyncFileItemPtr &item) | |||||
| Q_UNREACHABLE(); | ||||||
| } | ||||||
|
|
||||||
| qint64 OwncloudPropagator::smallFileSize() | ||||||
| uint64_t OwncloudPropagator::smallFileSize() | ||||||
| { | ||||||
| const qint64 smallFileSize = 100 * 1024; //default to 1 MB. Not dynamic right now. | ||||||
| return smallFileSize; | ||||||
| return 1_MB; // default to 1 MB. Not dynamic right now. | ||||||
|
||||||
| return 1_MB; // default to 1 MB. Not dynamic right now. | |
| return 100_KiB; // default to 100 KiB. Not dynamic right now. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -387,7 +387,7 @@ void PropagateDownloadFile::startFullDownload() | |||||
| qint64 PropagateDownloadFile::committedDiskSpace() const | ||||||
|
||||||
| qint64 PropagateDownloadFile::committedDiskSpace() const | |
| uint64_t PropagateDownloadFile::committedDiskSpace() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The include
#include <QUrl>was removed, but the header still usesQUrlas a parameter type in function declarations on lines 204 and 207. While QUrlQuery includes QUrl transitively in some Qt versions, relying on transitive includes is fragile and can break with different Qt versions or build configurations. The#include <QUrl>should be kept.