diff --git a/lang/qt/src/qgpgmedecryptverifyarchivejob.cpp b/lang/qt/src/qgpgmedecryptverifyarchivejob.cpp index 98ca7403..1d642b0f 100644 --- a/lang/qt/src/qgpgmedecryptverifyarchivejob.cpp +++ b/lang/qt/src/qgpgmedecryptverifyarchivejob.cpp @@ -122,7 +122,11 @@ static QGpgMEDecryptVerifyArchiveJob::result_type decrypt_verify_from_file_name( const QString &outputDirectory) { Data indata; +#ifdef Q_OS_WIN + indata.setFileName(inputFile.toUtf8().constData()); +#else indata.setFileName(QFile::encodeName(inputFile).constData()); +#endif return decrypt_verify(ctx, indata, outputDirectory); } diff --git a/lang/qt/src/qgpgmeencryptarchivejob.cpp b/lang/qt/src/qgpgmeencryptarchivejob.cpp index ceab5909..07095ea1 100644 --- a/lang/qt/src/qgpgmeencryptarchivejob.cpp +++ b/lang/qt/src/qgpgmeencryptarchivejob.cpp @@ -104,7 +104,11 @@ static QGpgMEEncryptArchiveJob::result_type encrypt(Context *ctx, flags = static_cast(flags | Context::EncryptArchive); const auto encryptionResult = ctx->encrypt(recipients, indata, outdata, flags); +#ifdef Q_OS_WIN + const auto outputFileName = QString::fromUtf8(outdata.fileName()); +#else const auto outputFileName = QFile::decodeName(outdata.fileName()); +#endif if (!outputFileName.isEmpty() && encryptionResult.error().code()) { // ensure that the output file is removed if the operation was canceled or failed if (QFile::exists(outputFileName)) { @@ -143,7 +147,11 @@ static QGpgMEEncryptArchiveJob::result_type encrypt_to_filename(Context *ctx, const QString &baseDirectory) { Data outdata; +#ifdef Q_OS_WIN + outdata.setFileName(outputFile.toUtf8().constData()); +#else outdata.setFileName(QFile::encodeName(outputFile).constData()); +#endif return encrypt(ctx, recipients, paths, outdata, flags, baseDirectory); } diff --git a/lang/qt/src/qgpgmesignarchivejob.cpp b/lang/qt/src/qgpgmesignarchivejob.cpp index fe87637c..ba82be77 100644 --- a/lang/qt/src/qgpgmesignarchivejob.cpp +++ b/lang/qt/src/qgpgmesignarchivejob.cpp @@ -111,7 +111,11 @@ static QGpgMESignArchiveJob::result_type sign(Context *ctx, const auto signingResult = ctx->sign(indata, outdata, GpgME::SignArchive); +#ifdef Q_OS_WIN + const auto outputFileName = QString::fromUtf8(outdata.fileName()); +#else const auto outputFileName = QFile::decodeName(outdata.fileName()); +#endif if (!outputFileName.isEmpty() && signingResult.error().code()) { // ensure that the output file is removed if the operation was canceled or failed if (QFile::exists(outputFileName)) { @@ -148,7 +152,11 @@ static QGpgMESignArchiveJob::result_type sign_to_filename(Context *ctx, const QString &baseDirectory) { Data outdata; +#ifdef Q_OS_WIN + outdata.setFileName(outputFile.toUtf8().constData()); +#else outdata.setFileName(QFile::encodeName(outputFile).constData()); +#endif return sign(ctx, signers, paths, outdata, baseDirectory); } diff --git a/lang/qt/src/qgpgmesignencryptarchivejob.cpp b/lang/qt/src/qgpgmesignencryptarchivejob.cpp index 6670b702..6c28b7ec 100644 --- a/lang/qt/src/qgpgmesignencryptarchivejob.cpp +++ b/lang/qt/src/qgpgmesignencryptarchivejob.cpp @@ -116,7 +116,11 @@ static QGpgMESignEncryptArchiveJob::result_type sign_encrypt(Context *ctx, const auto &signingResult = res.first; const auto &encryptionResult = res.second; +#ifdef Q_OS_WIN + const auto outputFileName = QString::fromUtf8(outdata.fileName()); +#else const auto outputFileName = QFile::decodeName(outdata.fileName()); +#endif if (!outputFileName.isEmpty() && (signingResult.error().code() || encryptionResult.error().code())) { // ensure that the output file is removed if the operation was canceled or failed if (QFile::exists(outputFileName)) { @@ -157,7 +161,11 @@ static QGpgMESignEncryptArchiveJob::result_type sign_encrypt_to_filename(Context const QString &baseDirectory) { Data outdata; +#ifdef Q_OS_WIN + outdata.setFileName(outputFile.toUtf8().constData()); +#else outdata.setFileName(QFile::encodeName(outputFile).constData()); +#endif return sign_encrypt(ctx, signers, recipients, paths, outdata, encryptionFlags, baseDirectory); }