From 5e4258968aaeb0f16f3c9097463bb75a32cb88b8 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Mon, 14 Jun 2021 09:34:40 +0200 Subject: [PATCH] Allow matching of empty files --- src/macro-condition-file.cpp | 2 +- src/switch-file.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/macro-condition-file.cpp b/src/macro-condition-file.cpp index 16a5af4f..c8dd5ef6 100644 --- a/src/macro-condition-file.cpp +++ b/src/macro-condition-file.cpp @@ -67,7 +67,7 @@ bool MacroConditionFile::checkLocalFileContent() { QString t = QString::fromStdString(_text); QFile file(QString::fromStdString(_file)); - if (_file.empty() || !file.open(QIODevice::ReadOnly)) { + if (!file.open(QIODevice::ReadOnly)) { return false; } diff --git a/src/switch-file.cpp b/src/switch-file.cpp index f963e79d..55f27d92 100644 --- a/src/switch-file.cpp +++ b/src/switch-file.cpp @@ -205,7 +205,7 @@ bool checkLocalFileContent(FileSwitch &s) { QString t = QString::fromStdString(s.text); QFile file(QString::fromStdString(s.file)); - if (s.file.empty() || !file.open(QIODevice::ReadOnly)) { + if (!file.open(QIODevice::ReadOnly)) { return false; }