Skip to content

Commit

Permalink
cleanup csync_file_stat_t
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Jul 12, 2022
1 parent 404e1b7 commit b70bd89
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 44 deletions.
3 changes: 1 addition & 2 deletions src/common/vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#pragma once

#include "assert.h"
#include "csync/csync.h"
#include "ocsynclib.h"
#include "pinstate.h"
#include "result.h"
Expand All @@ -27,8 +28,6 @@

#include <memory>

typedef struct csync_file_stat_s csync_file_stat_t;

namespace OCC {

class Account;
Expand Down
72 changes: 30 additions & 42 deletions src/csync/csync.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,48 +160,36 @@ Q_ENUM_NS(ItemType)

using namespace CSyncEnums;
using CSYNC_STATUS = CSyncEnums::csync_status_codes_e;
typedef struct csync_file_stat_s csync_file_stat_t;

struct OCSYNC_EXPORT csync_file_stat_s {
time_t modtime;
int64_t size;
uint64_t inode;

OCC::RemotePermissions remotePerm;
ItemType type;
bool child_modified;
bool has_ignored_files; // Specify that a directory, or child directory contains ignored files.
bool is_hidden; // Not saved in the DB, only used during discovery for local files.

QByteArray path;
QByteArray rename_path;
QByteArray etag;
QByteArray file_id;
QByteArray directDownloadUrl;
QByteArray directDownloadCookies;
QByteArray original_path; // only set if locale conversion fails

// In the local tree, this can hold a checksum and its type if it is
// computed during discovery for some reason.
// In the remote tree, this will have the server checksum, if available.
// In both cases, the format is "SHA1:baff".
QByteArray checksumHeader;

CSYNC_STATUS error_status;

SyncInstructions instruction; /* u32 */

csync_file_stat_s()
: modtime(0)
, size(0)
, inode(0)
, type(ItemTypeSkip)
, child_modified(false)
, has_ignored_files(false)
, is_hidden(false)
, error_status(CSYNC_STATUS_OK)
, instruction(CSYNC_INSTRUCTION_NONE)
{ }

struct OCSYNC_EXPORT csync_file_stat_t
{
time_t modtime = 0;
int64_t size = 0;
uint64_t inode = 0;

OCC::RemotePermissions remotePerm;
ItemType type = ItemTypeSkip;
bool child_modified = false;
bool has_ignored_files = false; // Specify that a directory, or child directory contains ignored files.
bool is_hidden = false; // Not saved in the DB, only used during discovery for local files.

QByteArray path;
QByteArray rename_path;
QByteArray etag;
QByteArray file_id;
QByteArray directDownloadUrl;
QByteArray directDownloadCookies;
QByteArray original_path; // only set if locale conversion fails

// In the local tree, this can hold a checksum and its type if it is
// computed during discovery for some reason.
// In the remote tree, this will have the server checksum, if available.
// In both cases, the format is "SHA1:baff".
QByteArray checksumHeader;

CSYNC_STATUS error_status = CSYNC_STATUS_OK;

SyncInstructions instruction = CSYNC_INSTRUCTION_NONE;
};

OCSYNC_EXPORT QDebug operator<<(QDebug debug, const SyncInstructions &job);
Expand Down

0 comments on commit b70bd89

Please sign in to comment.