1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-03-13 02:27:46 +01:00
GPXSee/src/GUI/filebrowser.h

49 lines
816 B
C
Raw Normal View History

2015-10-20 22:18:41 +02:00
#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);
2022-05-28 14:05:14 +02:00
#ifdef Q_OS_ANDROID
void setCurrentDir(const QString &path);
#else // Q_OS_ANDROID
2015-10-20 22:18:41 +02:00
void setCurrent(const QString &path);
2022-05-28 14:05:14 +02:00
#endif // Q_OS_ANDROID
void setFilter(const QStringList &filter);
2015-10-20 22:18:41 +02:00
2022-05-28 14:05:14 +02:00
QString current();
2015-10-20 22:18:41 +02:00
QString next();
QString prev();
2015-12-18 22:21:11 +01:00
QString last();
QString first();
2016-03-19 17:24:53 +01:00
bool isLast() const;
bool isFirst() const;
2015-10-20 22:18:41 +02:00
signals:
void listChanged();
2015-10-20 22:18:41 +02:00
private slots:
void reloadDirectory(const QString &path);
private:
2022-05-28 14:05:14 +02:00
#ifndef Q_OS_ANDROID
2015-10-20 22:18:41 +02:00
QFileSystemWatcher *_watcher;
2022-05-28 14:05:14 +02:00
#endif // Q_OS_ANDROID
2015-10-20 22:18:41 +02:00
QStringList _filter;
QFileInfoList _files;
int _index;
};
#endif // FILEBROWSER_H