Return the QFileInfo::baseName/QDir::dirName() from fileEngine impl
Get those values from the file engine instead, this is relevant especially on Android for content uris. Pick-to: 6.5 6.4 6.2 Task-number: QTBUG-98974 Change-Id: I65fe4c59e5f1feed0dcf14cc8988b4a40d9d979e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
d77b5fbcf1
commit
f77668ffec
@ -661,7 +661,9 @@ QString QDir::canonicalPath() const
|
||||
QString QDir::dirName() const
|
||||
{
|
||||
Q_D(const QDir);
|
||||
return d->dirEntry.fileName();
|
||||
if (!d_ptr->fileEngine)
|
||||
return d->dirEntry.fileName();
|
||||
return d->fileEngine->fileName(QAbstractFileEngine::BaseName);
|
||||
}
|
||||
|
||||
|
||||
|
@ -783,7 +783,9 @@ QString QFileInfo::baseName() const
|
||||
Q_D(const QFileInfo);
|
||||
if (d->isDefaultConstructed)
|
||||
return ""_L1;
|
||||
return d->fileEntry.baseName();
|
||||
if (!d_ptr->fileEngine)
|
||||
return d->fileEntry.baseName();
|
||||
return QFileSystemEntry(d->fileEngine->fileName(QAbstractFileEngine::BaseName)).baseName();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user