Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
fileset_entry_model.h
Go to the documentation of this file.
1
10#ifndef FILESET_ENTRY_MODEL_H
11#define FILESET_ENTRY_MODEL_H
12
13#include <config.h>
14
15#include <fileset.h>
16
17#include <QAbstractItemModel>
18#include <QModelIndex>
19#include <QVector>
20
21class FilesetEntryModel : public QAbstractItemModel
22{
23 Q_OBJECT
24
25public:
26 explicit FilesetEntryModel(QObject * parent = 0);
27
28 QModelIndex index(int row, int column, const QModelIndex & = QModelIndex()) const;
29 // Everything is under the root.
30 virtual QModelIndex parent(const QModelIndex &) const { return QModelIndex(); }
31 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
32 virtual int columnCount(const QModelIndex &) const { return ColumnCount; }
33 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
34 virtual QVariant headerData(int section, Qt::Orientation, int role = Qt::DisplayRole) const;
35
36 virtual void appendEntry(const fileset_entry *entry);
37 const fileset_entry *getRowEntry(int row) const { return entries_.value(row, NULL); }
38 int entryCount() const { return static_cast<int>(entries_.count()); }
39 // Calls fileset_delete and clears our model data.
40 void clear();
41
42private:
43 QVector<const fileset_entry *> entries_;
44 enum Column { Name, Created, Modified, Size, ColumnCount };
45
46 QString nameToDate(const char *name) const ;
47 QString time_tToString(time_t clock) const;
48};
49
50#endif // FILESET_ENTRY_MODEL_H
Definition fileset_entry_model.h:22
Definition fileset.h:22