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))
|
||||
model.setOption(QFileSystemModel::DontUseCustomDirectoryIcons);
|
||||
if (parser.isSet(dontWatchOption))
|
||||
model.setOption(QFileSystemModel::DontWatch);
|
||||
model.setOption(QFileSystemModel::DontWatchForChanges);
|
||||
QTreeView tree;
|
||||
tree.setModel(&model);
|
||||
if (!rootPath.isEmpty()) {
|
||||
|
@ -1267,7 +1267,7 @@ Qt::DropActions QFileSystemModel::supportedDropActions() const
|
||||
\enum QFileSystemModel::Option
|
||||
\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
|
||||
like line edit completion.
|
||||
|
||||
@ -1331,8 +1331,8 @@ void QFileSystemModel::setOptions(Options options)
|
||||
|
||||
#if QT_CONFIG(filesystemwatcher)
|
||||
Q_D(QFileSystemModel);
|
||||
if (changed.testFlag(DontWatch))
|
||||
d->fileInfoGatherer.setWatching(!options.testFlag(DontWatch));
|
||||
if (changed.testFlag(DontWatchForChanges))
|
||||
d->fileInfoGatherer.setWatching(!options.testFlag(DontWatchForChanges));
|
||||
#endif
|
||||
|
||||
if (changed.testFlag(DontUseCustomDirectoryIcons)) {
|
||||
@ -1353,9 +1353,9 @@ QFileSystemModel::Options QFileSystemModel::options() const
|
||||
result.setFlag(DontResolveSymlinks, !resolveSymlinks());
|
||||
#if QT_CONFIG(filesystemwatcher)
|
||||
Q_D(const QFileSystemModel);
|
||||
result.setFlag(DontWatch, !d->fileInfoGatherer.isWatching());
|
||||
result.setFlag(DontWatchForChanges, !d->fileInfoGatherer.isWatching());
|
||||
#else
|
||||
result.setFlag(DontWatch);
|
||||
result.setFlag(DontWatchForChanges);
|
||||
#endif
|
||||
if (auto provider = iconProvider()) {
|
||||
result.setFlag(DontUseCustomDirectoryIcons,
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
|
||||
enum Option
|
||||
{
|
||||
DontWatch = 0x00000001,
|
||||
DontWatchForChanges = 0x00000001,
|
||||
DontResolveSymlinks = 0x00000002,
|
||||
DontUseCustomDirectoryIcons = 0x00000004
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user