Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

fileset_entry_model.h
1 /* fileset_entry_model.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10 #ifndef FILESET_ENTRY_MODEL_H
11 #define FILESET_ENTRY_MODEL_H
12
13 #include <config.h>
14
15 #include <glib.h>
16
17 #include <fileset.h>
18
19 #include <QAbstractItemModel>
20 #include <QModelIndex>
21 #include <QVector>
22
23 class FilesetEntryModel : public QAbstractItemModel
24 {
25 Q_OBJECT
26
27 public:
28 explicit FilesetEntryModel(QObject * parent = 0);
29
30 QModelIndex index(int row, int column, const QModelIndex & = QModelIndex()) const;
31 // Everything is under the root.
32 virtual QModelIndex parent(const QModelIndex &) const { return QModelIndex(); }
33 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
34 virtual int columnCount(const QModelIndex &) const { return ColumnCount; }
35 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
36 virtual QVariant headerData(int section, Qt::Orientation, int role = Qt::DisplayRole) const;
37
38 virtual void appendEntry(const fileset_entry *entry);
39 const fileset_entry *getRowEntry(int row) const { return entries_.value(row, NULL); }
40 int entryCount() const { return entries_.count(); }
41 // Calls fileset_delete and clears our model data.
42 void clear();
43
44 private:
45 QVector<const fileset_entry *> entries_;
46 enum Column { Name, Created, Modified, Size, ColumnCount };
47
48 QString nameToDate(const char *name) const ;
49 QString time_tToString(time_t clock) const;
50 };
51
52 #endif // FILESET_ENTRY_MODEL_H
53
54 /*
55 * Editor modelines
56 *
57 * Local Variables:
58 * c-basic-offset: 4
59 * tab-width: 8
60 * indent-tabs-mode: nil
61 * End:
62 *
63 * ex: set shiftwidth=4 tabstop=8 expandtab:
64 * :indentSize=4:tabSize=8:noTabs=true:
65 */
_fileset_entry
Definition: fileset.h:18
FilesetEntryModel
Definition: fileset_entry_model.h:23