From 5e7c875b29b2dcff44201d2b6cd6815b20fb3945 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 25 Jun 2014 23:51:29 +0200 Subject: - test-plugins accidentally distributed in the 1.2.5 release are now automatically deleted - some fixes to the tutorial (mostly wording but also some actual problems) - bugfix: could disable mods that aren't supposed to be disable-able - bugfix: mod list wasn't saved on some changes - bugfix: when trying to start directly to application, MO didn't start up correctly - bugfix: hook.dll didn't load mod bsas into its directory structure and thus didn't allow bsas to overwrite loose files - bugfix: in some constellations the tutorial files couldn't be found despite being in the right location --- src/safewritefile.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/safewritefile.cpp') diff --git a/src/safewritefile.cpp b/src/safewritefile.cpp index 626413dd..3bc1d1c4 100644 --- a/src/safewritefile.cpp +++ b/src/safewritefile.cpp @@ -20,6 +20,7 @@ along with Mod Organizer. If not, see . #include "safewritefile.h" #include +#include using namespace MOBase; @@ -47,8 +48,8 @@ void SafeWriteFile::commit() { m_TempFile.close(); } -bool SafeWriteFile::commitIfDifferent(uint &inHash) { - uint newHash = hash(); +bool SafeWriteFile::commitIfDifferent(QByteArray &inHash) { + QByteArray newHash = hash(); if (newHash != inHash) { commit(); inHash = newHash; @@ -58,11 +59,12 @@ bool SafeWriteFile::commitIfDifferent(uint &inHash) { } } -uint SafeWriteFile::hash() +QByteArray SafeWriteFile::hash() { + qint64 pos = m_TempFile.pos(); m_TempFile.seek(0); QByteArray data = m_TempFile.readAll(); m_TempFile.seek(pos); - return qHash(data); + return QCryptographicHash::hash(data, QCryptographicHash::Md5); } -- cgit v1.3.1