Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QFileSystemFilter Class Reference
[QtBaseModule]

The QFileSystemFilter class is used to restrict the available filesystems returned from QStorageMetaInfo. More...

    #include <QFileSystemFilter>

Public Types

Public Functions


Detailed Description

The QFileSystemFilter class is used to restrict the available filesystems returned from QStorageMetaInfo.

Extending the filter class is relatively simple.

    class WriteableFileSystemFilter : public QFileSystemFilter
    {
    public:
        WriteableFileSystemFilter()
            : writable( QFileSystemFilter::Either )
        {
        }

        bool filter( QFileSystem *fs )
        {
            if ( (writable == QFileSystemFilter::Set && !fs->isWritable()) ||
                 (writable == QFileSystemFilter::NotSet && fs->isWritable()) )
                return false;
            else
                return QFileSystemFilter::filter(fs);
        }

        QFileSystemFilter::FilterOption writable;
    };

See also QStorageMetaInfo.


Member Type Documentation

enum QFileSystemFilter::FilterOption

This enum is used to describe the filter conditions for file systems.

ConstantValueDescription
QFileSystemFilter::Set1The filter matches if the connected condition is set.
QFileSystemFilter::NotSet2The filter matches if the connected condition is not set
QFileSystemFilter::Either0The filter always matches.


Member Function Documentation

QFileSystemFilter::QFileSystemFilter ()

Constructor that initializes the filter to allow any filesystem.

QFileSystemFilter::~QFileSystemFilter ()   [virtual]

Destructor

bool QFileSystemFilter::filter ( QFileSystem * fs )   [virtual]

Returns true if the fs matches the filter; otherwise returns false.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3