From f570e2f2685aa43aa518c2f8578391c1847cddbe Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:04:59 +0200 Subject: 3.3 --- fileHierarchy.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'fileHierarchy.cpp') diff --git a/fileHierarchy.cpp b/fileHierarchy.cpp index e27d9421..6316edf9 100644 --- a/fileHierarchy.cpp +++ b/fileHierarchy.cpp @@ -8,9 +8,11 @@ #include "shared/fileHandling.h" #include #include "shared/serialize.h" +#include "shared/buildInfo.h" #ifdef FFS_WIN #include //includes "windows.h" +#include "shared/longPathPrefix.h" #endif using namespace FreeFileSync; @@ -110,7 +112,10 @@ SyncOperation FileSystemObject::getSyncOperation(const CompareFilesResult cmpRes const bool selectedForSynchronization, const SyncDirectionIntern syncDir) { - if (!selectedForSynchronization) return SO_DO_NOTHING; + if (!selectedForSynchronization) + return cmpResult == FILE_EQUAL ? + SO_EQUAL : + SO_DO_NOTHING; switch (cmpResult) { @@ -173,7 +178,7 @@ SyncOperation FileSystemObject::getSyncOperation(const CompareFilesResult cmpRes case FILE_EQUAL: assert(syncDir == SYNC_DIR_INT_NONE); - return SO_DO_NOTHING; + return SO_EQUAL; } return SO_DO_NOTHING; //dummy @@ -194,7 +199,7 @@ const Zstring& FreeFileSync::getSyncDBFilename() //------------------------------------------------------------------------------------------------------------------------------- const char FILE_FORMAT_DESCR[] = "FreeFileSync"; -const int FILE_FORMAT_VER = 3; +const int FILE_FORMAT_VER = Utility::is64BitBuild ? -3 : 3; //32 and 64 bit builds are binary incompatible! So give them different IDs //------------------------------------------------------------------------------------------------------------------------------- @@ -204,7 +209,7 @@ public: ReadDirInfo(wxInputStream& stream, const wxString& errorObjName, DirInformation& dirInfo) : ReadInputStream(stream, errorObjName) { //read filter settings - dirInfo.filter = FilterProcess::loadFilter(stream_); + dirInfo.filter = BaseFilter::loadFilter(stream_); check(); //start recursion @@ -234,8 +239,12 @@ private: const unsigned long sizeHigh = readNumberC(); const unsigned long sizeLow = readNumberC(); + //const Utility::FileID fileIdentifier(stream_); + //check(); + dirCont.addSubFile(shortName, - FileDescriptor(wxLongLong(modHigh, modLow), wxULongLong(sizeHigh, sizeLow))); + FileDescriptor(wxLongLong(modHigh, modLow), + wxULongLong(sizeHigh, sizeLow))); } void readSubDirectory(DirContainer& dirCont) @@ -400,6 +409,9 @@ private: writeNumberC(fileMap.getLastWriteTime().GetLo()); // writeNumberC(fileMap.getFileSize().GetHi()); //filesize writeNumberC(fileMap.getFileSize().GetLo()); // + + //fileMap.getFileID().toStream(stream_); //unique file identifier + //check(); } } @@ -464,7 +476,7 @@ void saveFile(const DbStreamData& dbStream, const Zstring& filename) //throw (Fi //(try to) hide database file #ifdef FFS_WIN output.Close(); - ::SetFileAttributes(filename.c_str(), FILE_ATTRIBUTE_HIDDEN); + ::SetFileAttributes(FreeFileSync::applyLongPathPrefix(filename).c_str(), FILE_ATTRIBUTE_HIDDEN); #endif } @@ -533,7 +545,6 @@ void FreeFileSync::saveToDisk(const BaseDirMapping& baseMapping) //throw (FileEr removeFile(baseMapping.getDBFilename(), false); renameFile(fileNameLeftTmp, baseMapping.getDBFilename()); //throw (FileError); renameFile(fileNameRightTmp, baseMapping.getDBFilename()); //throw (FileError); - } catch (...) { @@ -548,3 +559,4 @@ void FreeFileSync::saveToDisk(const BaseDirMapping& baseMapping) //throw (FileEr } } + -- cgit