Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2016-01-06 12:01:22 +0300
committerChristian Kamm <mail@ckamm.de>2016-01-08 07:38:08 +0300
commitabf5a5ad1e4eadbeb24a999aeeab39ed4357eef9 (patch)
tree37a6628179e90130949f2b2b68621f7133726bd8 /src/libsync/propagatedownload.h
parentd4b6b5cb1dfbdc15d88ace03bad5dfe1f31f9012 (diff)
Propagation: Fix dir <-> file changes propagating to server #4302
* Ensure every time a file becomes a directory or the other way around the item is flagged as INSTRUCTION_TYPE_CHANGE. * Delete the badly-typed entity if necessary in the propagation jobs.
Diffstat (limited to 'src/libsync/propagatedownload.h')
-rw-r--r--src/libsync/propagatedownload.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libsync/propagatedownload.h b/src/libsync/propagatedownload.h
index 32e05db28..8ba11f1b5 100644
--- a/src/libsync/propagatedownload.h
+++ b/src/libsync/propagatedownload.h
@@ -110,10 +110,21 @@ class PropagateDownloadFileQNAM : public PropagateItemJob {
Q_OBJECT
public:
PropagateDownloadFileQNAM(OwncloudPropagator* propagator,const SyncFileItemPtr& item)
- : PropagateItemJob(propagator, item), _resumeStart(0), _downloadProgress(0) {}
+ : PropagateItemJob(propagator, item), _resumeStart(0), _downloadProgress(0), _deleteExisting(false) {}
void start() Q_DECL_OVERRIDE;
qint64 committedDiskSpace() const Q_DECL_OVERRIDE;
+ /**
+ * Whether an existing folder with the same name may be deleted before
+ * the download.
+ *
+ * If it's a non-empty folder, it'll be renamed to a conflict-style name
+ * to preserve any non-synced content that may be inside.
+ *
+ * Default: false.
+ */
+ void setDeleteExistingFolder(bool enabled);
+
private slots:
void slotGetFinished();
void abort() Q_DECL_OVERRIDE;
@@ -122,10 +133,13 @@ private slots:
void slotChecksumFail( const QString& errMsg );
private:
+ void deleteExistingFolder();
+
quint64 _resumeStart;
qint64 _downloadProgress;
QPointer<GETFileJob> _job;
QFile _tmpFile;
+ bool _deleteExisting;
};
}