Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 4442dd9bdde98a1d9ca2177557e87d7d > files > 390

libqxt-devel-0.6.1-3.fc15.i686.rpm

#ifndef FSIMAGEMODEL_H_INCLUDED
#define FSIMAGEMODEL_H_INCLUDED
/**

    warning: this model is a quick and dirty hack. 
    it has major flaws and should not be used for anything but testing

*/

#include <QAbstractItemModel>
#include <QDir>
#include <QFileSystemWatcher>

struct FsImageModelImage;
class FsImageModel : public QAbstractItemModel
{
Q_OBJECT
public:
    explicit FsImageModel(QString path,QObject * parent = 0);
    virtual ~FsImageModel();
    virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
    virtual QModelIndex parent(const QModelIndex &index) const;
    virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
    virtual int columnCount(const QModelIndex & parent = QModelIndex()) const;
    virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
private:
    QList<FsImageModelImage*> files;
    QDir dir;
    QFileSystemWatcher watcher;
private slots:
    void directoryChanged ( const QString & path );
    void fileChanged ( const QString & path );
};

#endif // FSIMAGEMODEL_H_INCLUDED