QFileSystemModel: Fix naming of Option enumeration
Fix an API review finding in 5.14, amending 6b9d319b26da2e4b6f939ee92a176f8604c1c539. Change-Id: I6c67ebde91021b87a43a86ff831b724f098019aa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
8ce653e048
commit
60bea1c85a
@ -79,7 +79,7 @@ int main(int argc, char *argv[])
|
|||||||
if (parser.isSet(dontUseCustomDirectoryIconsOption))
|
if (parser.isSet(dontUseCustomDirectoryIconsOption))
|
||||||
model.setOption(QFileSystemModel::DontUseCustomDirectoryIcons);
|
model.setOption(QFileSystemModel::DontUseCustomDirectoryIcons);
|
||||||
if (parser.isSet(dontWatchOption))
|
if (parser.isSet(dontWatchOption))
|
||||||
model.setOption(QFileSystemModel::DontWatch);
|
model.setOption(QFileSystemModel::DontWatchForChanges);
|
||||||
QTreeView tree;
|
QTreeView tree;
|
||||||
tree.setModel(&model);
|
tree.setModel(&model);
|
||||||
if (!rootPath.isEmpty()) {
|
if (!rootPath.isEmpty()) {
|
||||||
|
@ -1267,7 +1267,7 @@ Qt::DropActions QFileSystemModel::supportedDropActions() const
|
|||||||
\enum QFileSystemModel::Option
|
\enum QFileSystemModel::Option
|
||||||
\since 5.14
|
\since 5.14
|
||||||
|
|
||||||
\value DontWatch Do not add file watchers to the paths.
|
\value DontWatchForChanges Do not add file watchers to the paths.
|
||||||
This reduces overhead when using the model for simple tasks
|
This reduces overhead when using the model for simple tasks
|
||||||
like line edit completion.
|
like line edit completion.
|
||||||
|
|
||||||
@ -1331,8 +1331,8 @@ void QFileSystemModel::setOptions(Options options)
|
|||||||
|
|
||||||
#if QT_CONFIG(filesystemwatcher)
|
#if QT_CONFIG(filesystemwatcher)
|
||||||
Q_D(QFileSystemModel);
|
Q_D(QFileSystemModel);
|
||||||
if (changed.testFlag(DontWatch))
|
if (changed.testFlag(DontWatchForChanges))
|
||||||
d->fileInfoGatherer.setWatching(!options.testFlag(DontWatch));
|
d->fileInfoGatherer.setWatching(!options.testFlag(DontWatchForChanges));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (changed.testFlag(DontUseCustomDirectoryIcons)) {
|
if (changed.testFlag(DontUseCustomDirectoryIcons)) {
|
||||||
@ -1353,9 +1353,9 @@ QFileSystemModel::Options QFileSystemModel::options() const
|
|||||||
result.setFlag(DontResolveSymlinks, !resolveSymlinks());
|
result.setFlag(DontResolveSymlinks, !resolveSymlinks());
|
||||||
#if QT_CONFIG(filesystemwatcher)
|
#if QT_CONFIG(filesystemwatcher)
|
||||||
Q_D(const QFileSystemModel);
|
Q_D(const QFileSystemModel);
|
||||||
result.setFlag(DontWatch, !d->fileInfoGatherer.isWatching());
|
result.setFlag(DontWatchForChanges, !d->fileInfoGatherer.isWatching());
|
||||||
#else
|
#else
|
||||||
result.setFlag(DontWatch);
|
result.setFlag(DontWatchForChanges);
|
||||||
#endif
|
#endif
|
||||||
if (auto provider = iconProvider()) {
|
if (auto provider = iconProvider()) {
|
||||||
result.setFlag(DontUseCustomDirectoryIcons,
|
result.setFlag(DontUseCustomDirectoryIcons,
|
||||||
|
@ -78,7 +78,7 @@ public:
|
|||||||
|
|
||||||
enum Option
|
enum Option
|
||||||
{
|
{
|
||||||
DontWatch = 0x00000001,
|
DontWatchForChanges = 0x00000001,
|
||||||
DontResolveSymlinks = 0x00000002,
|
DontResolveSymlinks = 0x00000002,
|
||||||
DontUseCustomDirectoryIcons = 0x00000004
|
DontUseCustomDirectoryIcons = 0x00000004
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user