From 23bf20c498897a633d317afe2d52f6849de62f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 7 Feb 2022 15:26:42 -0300 Subject: [PATCH] src: link: filelink: Fix isWritable check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/link/filelink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/link/filelink.cpp b/src/link/filelink.cpp index 15548401c..55a2a4723 100644 --- a/src/link/filelink.cpp +++ b/src/link/filelink.cpp @@ -192,7 +192,8 @@ bool FileLink::isWritable() // This also avoids the creation of empty files const auto absoluteBasePath = QFileInfo(_file).absolutePath(); const bool isWritable = QFileInfo(absoluteBasePath).isWritable(); - return isWritable; + return isWritable + && _openModeFlag == QIODevice::WriteOnly || _openModeFlag == QIODevice::ReadWrite; } bool FileLink::finishConnection()