diff --git a/Telegram/SourceFiles/core/file_utilities.cpp b/Telegram/SourceFiles/core/file_utilities.cpp index 5621242a6..28dd826f8 100644 --- a/Telegram/SourceFiles/core/file_utilities.cpp +++ b/Telegram/SourceFiles/core/file_utilities.cpp @@ -94,7 +94,7 @@ QString filedialogDefaultName( const auto nameBase = (dir.endsWith('/') ? dir : (dir + '/')) + base; name = nameBase + extension; - for (int i = 0; QFileInfo(name).exists(); ++i) { + for (int i = 0; QFileInfo::exists(name); ++i) { name = nameBase + qsl(" (%1)").arg(i + 2) + extension; } } @@ -115,7 +115,7 @@ QString filedialogNextFilename( const auto dir = directory.absolutePath(); const auto nameBase = (dir.endsWith('/') ? dir : (dir + '/')) + prefix; auto result = nameBase + extension; - for (int i = 0; result.toLower() != cur.toLower() && QFileInfo(result).exists(); ++i) { + for (int i = 0; result.toLower() != cur.toLower() && QFileInfo::exists(result); ++i) { result = nameBase + qsl(" (%1)").arg(i + 2) + extension; } return result; diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index 5c1d9c049..7592eecd4 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -213,7 +213,7 @@ QString FileNameUnsafe( } QString nameBase = path + nameStart; name = nameBase + extension; - for (int i = 0; QFileInfo(name).exists(); ++i) { + for (int i = 0; QFileInfo::exists(name); ++i) { name = nameBase + QString(" (%1)").arg(i + 2) + extension; } diff --git a/Telegram/SourceFiles/lang/lang_file_parser.cpp b/Telegram/SourceFiles/lang/lang_file_parser.cpp index 6c2b79941..8aa860cf8 100644 --- a/Telegram/SourceFiles/lang/lang_file_parser.cpp +++ b/Telegram/SourceFiles/lang/lang_file_parser.cpp @@ -153,7 +153,7 @@ bool FileParser::readKeyValue(const char *&from, const char *end) { } QByteArray FileParser::ReadFile(const QString &absolutePath, const QString &relativePath) { - QFile file(QFileInfo(relativePath).exists() ? relativePath : absolutePath); + QFile file(QFileInfo::exists(relativePath) ? relativePath : absolutePath); if (!file.open(QIODevice::ReadOnly)) { Ui::Integration::Instance().writeLogEntry(u"Lang Error: Could not open file at '%1' ('%2')"_q.arg(relativePath, absolutePath)); return QByteArray(); diff --git a/Telegram/SourceFiles/storage/details/storage_file_utilities.cpp b/Telegram/SourceFiles/storage/details/storage_file_utilities.cpp index f33229273..d859d3c3d 100644 --- a/Telegram/SourceFiles/storage/details/storage_file_utilities.cpp +++ b/Telegram/SourceFiles/storage/details/storage_file_utilities.cpp @@ -38,15 +38,15 @@ QString ToFilePart(FileKey val) { bool KeyAlreadyUsed(QString &name) { name += '0'; - if (QFileInfo(name).exists()) { + if (QFileInfo::exists(name)) { return true; } name[name.size() - 1] = '1'; - if (QFileInfo(name).exists()) { + if (QFileInfo::exists(name)) { return true; } name[name.size() - 1] = 's'; - if (QFileInfo(name).exists()) { + if (QFileInfo::exists(name)) { return true; } return false; @@ -319,7 +319,7 @@ bool ReadFile( // detect order of read attempts QString toTry[2]; const auto modern = base + 's'; - if (QFileInfo(modern).exists()) { + if (QFileInfo::exists(modern)) { toTry[0] = modern; } else { // Legacy way.