diff options
author | hjk <hjk@qt.io> | 2023-09-01 11:23:56 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-09-01 10:24:31 +0000 |
commit | 9679412a2309dff3848f107737b0b445d0cee620 (patch) | |
tree | fbcbeb40b1a7f742c733d14f3ffb7475b30c7644 /src/plugins/resourceeditor/qrceditor/resourcefile.cpp | |
parent | 3d028125df796ccb4b172933f6e9f930990a2659 (diff) |
Replace QFile::exists by QFileInfo::exists
QFile::exists only calls QFileInfo::exists, so this saves one
function call per invocation.
Change-Id: I41cb407345654eeead14455a4955b8b9b015aedc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/resourceeditor/qrceditor/resourcefile.cpp')
-rw-r--r-- | src/plugins/resourceeditor/qrceditor/resourcefile.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 8d8d6dc9f2..ef1c077ca9 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -50,7 +50,7 @@ void File::checkExistence() bool File::exists() { if (!m_checked) { - m_exists = QFile::exists(name); + m_exists = QFileInfo::exists(name); m_checked = true; } @@ -363,7 +363,7 @@ bool ResourceFile::renameFile(const QString &fileName, const QString &newFileNam } if (success) { - const bool exists = QFile::exists(newFileName); + const bool exists = QFileInfo::exists(newFileName); for (File *file : std::as_const(entries)) { file->name = newFileName; file->setExists(exists); @@ -1230,7 +1230,7 @@ EntryBackup * RelativeResourceModel::removeEntry(const QModelIndex &index) } else { const QString fileNameBackup = file(index); const QString aliasBackup = alias(index); - if (!QFile::exists(fileNameBackup)) { + if (!QFileInfo::exists(fileNameBackup)) { deleteItem(index); return new FileEntryBackup(*this, prefixIndex.row(), index.row(), fileNameBackup, aliasBackup); } |