mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
40 lines
631 B
C++
40 lines
631 B
C++
#ifndef FILEBROWSER_H
|
|
#define FILEBROWSER_H
|
|
|
|
#include <QObject>
|
|
#include <QFileInfo>
|
|
#include <QStringList>
|
|
|
|
class QFileSystemWatcher;
|
|
|
|
class FileBrowser : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
FileBrowser(QObject *parent = 0);
|
|
~FileBrowser();
|
|
|
|
void setFilter(const QStringList &filter);
|
|
void setCurrent(const QString &path);
|
|
|
|
QString next();
|
|
QString prev();
|
|
QString last();
|
|
QString first();
|
|
|
|
bool isLast() const;
|
|
bool isFirst() const;
|
|
|
|
private slots:
|
|
void reloadDirectory(const QString &path);
|
|
|
|
private:
|
|
QFileSystemWatcher *_watcher;
|
|
QStringList _filter;
|
|
QFileInfoList _files;
|
|
int _index;
|
|
};
|
|
|
|
#endif // FILEBROWSER_H
|