mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use non-throwing directory_iterator
This commit is contained in:
parent
a479fcd55c
commit
77c2e12ebc
1 changed files with 3 additions and 6 deletions
|
@ -45,12 +45,9 @@ inline QString IconName() {
|
||||||
|
|
||||||
inline bool CanReadDirectory(const QString &path) {
|
inline bool CanReadDirectory(const QString &path) {
|
||||||
#ifndef Q_OS_MAC // directory_iterator since 10.15
|
#ifndef Q_OS_MAC // directory_iterator since 10.15
|
||||||
try {
|
std::error_code error;
|
||||||
std::filesystem::directory_iterator(path.toStdString());
|
std::filesystem::directory_iterator(path.toStdString(), error);
|
||||||
return true;
|
return !error;
|
||||||
} catch (...) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
Unexpected("Not implemented.");
|
Unexpected("Not implemented.");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue