diff options
Diffstat (limited to 'libs/game_bethesda/src/gamebryo')
| -rw-r--r-- | libs/game_bethesda/src/gamebryo/dummybsa.cpp | 6 | ||||
| -rw-r--r-- | libs/game_bethesda/src/gamebryo/gamebryosavegame.cpp | 3 | ||||
| -rw-r--r-- | libs/game_bethesda/src/gamebryo/gamegamebryo.cpp | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/libs/game_bethesda/src/gamebryo/dummybsa.cpp b/libs/game_bethesda/src/gamebryo/dummybsa.cpp index 7b0f877..3fbd2ef 100644 --- a/libs/game_bethesda/src/gamebryo/dummybsa.cpp +++ b/libs/game_bethesda/src/gamebryo/dummybsa.cpp @@ -19,6 +19,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "dummybsa.h" #include <QFile> +#include <stdexcept> #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include <Windows.h> @@ -184,7 +185,10 @@ void DummyBSA::writeFileRecordBlocks(QFile& file, const std::string& folderName) void DummyBSA::write(const QString& fileName) { QFile file(fileName); - file.open(QIODevice::WriteOnly); + if (!file.open(QIODevice::WriteOnly)) { + throw std::runtime_error( + QString("failed to open dummy BSA for writing: %1").arg(fileName).toStdString()); + } m_TotalFileNameLength = static_cast<unsigned long>(m_FileName.length() + 1); diff --git a/libs/game_bethesda/src/gamebryo/gamebryosavegame.cpp b/libs/game_bethesda/src/gamebryo/gamebryosavegame.cpp index 523df0d..7625af3 100644 --- a/libs/game_bethesda/src/gamebryo/gamebryosavegame.cpp +++ b/libs/game_bethesda/src/gamebryo/gamebryosavegame.cpp @@ -9,6 +9,7 @@ #include <QFileInfo> #include <QScopedArrayPointer> #include <QTime> +#include <QTimeZone> #ifdef _WIN32 #include <Windows.h> @@ -90,7 +91,7 @@ void GamebryoSaveGame::setCreationTime(_SYSTEMTIME const& ctime) QTime time; time.setHMS(ctime.wHour, ctime.wMinute, ctime.wSecond, ctime.wMilliseconds); - m_CreationTime = QDateTime(date, time, Qt::UTC); + m_CreationTime = QDateTime(date, time, QTimeZone::UTC); } GamebryoSaveGame::FileWrapper::FileWrapper(QString const& filepath, diff --git a/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp b/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp index caeeed0..1bcc2c0 100644 --- a/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp +++ b/libs/game_bethesda/src/gamebryo/gamegamebryo.cpp @@ -495,7 +495,11 @@ void GameGamebryo::copyToProfile(QString const& sourcePath, sourceFile = resolveFileCaseInsensitive(sourceFile); if (!MOBase::shellCopy(sourceFile, filePath)) { // if copy file fails, create the file empty - QFile(filePath).open(QIODevice::WriteOnly); + QFile outputFile(filePath); + if (!outputFile.open(QIODevice::WriteOnly)) { + MOBase::log::warn("Failed to create fallback file '{}': {}", filePath, + outputFile.errorString()); + } } } } |
