Skip to content

Commit

Permalink
src: link: filelink: Fix isWritable check
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Feb 7, 2022
1 parent d055332 commit 23bf20c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/link/filelink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 23bf20c

Please sign in to comment.