QAbstractFileEngine: port indexed to ranged loop
... fixing a int/qsizetype mismatch in the process. As a drive-by, replace SESE with an early return. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-103525 Change-Id: I961728ba818c4cb43c0e2c9056c70c8f37ad042e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This commit is contained in:
parent
634a76eb32
commit
f40679dcdd
@ -123,20 +123,17 @@ QAbstractFileEngineHandler::~QAbstractFileEngineHandler()
|
|||||||
*/
|
*/
|
||||||
QAbstractFileEngine *qt_custom_file_engine_handler_create(const QString &path)
|
QAbstractFileEngine *qt_custom_file_engine_handler_create(const QString &path)
|
||||||
{
|
{
|
||||||
QAbstractFileEngine *engine = nullptr;
|
|
||||||
|
|
||||||
if (qt_file_engine_handlers_in_use.loadRelaxed()) {
|
if (qt_file_engine_handlers_in_use.loadRelaxed()) {
|
||||||
QReadLocker locker(fileEngineHandlerMutex());
|
QReadLocker locker(fileEngineHandlerMutex());
|
||||||
|
|
||||||
// check for registered handlers that can load the file
|
// check for registered handlers that can load the file
|
||||||
QAbstractFileEngineHandlerList *handlers = fileEngineHandlers();
|
for (QAbstractFileEngineHandler *handler : std::as_const(*fileEngineHandlers())) {
|
||||||
for (int i = 0; i < handlers->size(); i++) {
|
if (QAbstractFileEngine *engine = handler->create(path))
|
||||||
if ((engine = handlers->at(i)->create(path)))
|
return engine;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return engine;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user