e891f57bb3
Unused: [55/83] Building CXX object ui/qt/CMakeFiles/qtui.dir/models/credentials_model.cpp.o /Users/stig/Development/wireshark/ui/qt/models/credentials_model.cpp:18:66: warning: unused parameter 'cf' [-Wunused-parameter] CredentialsModel::CredentialsModel(QObject *parent, CaptureFile& cf) ^ 1 warning generated. Change-Id: I8f89a8121c55bae3fdc5d317beb5a87e0135f02a Reviewed-on: https://code.wireshark.org/review/33841 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
/*
|
|
* credentials_model.h
|
|
*
|
|
* Copyright 2019 - Dario Lombardo <lomato@gmail.com>
|
|
*
|
|
* Wireshark - Network traffic analyzer
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
* Copyright 1998 Gerald Combs
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QList>
|
|
|
|
#include <epan/tap.h>
|
|
#include <capture_file.h>
|
|
#include <ui/tap-credentials.h>
|
|
|
|
class CredentialsModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
CredentialsModel(QObject *parent);
|
|
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;
|
|
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
|
|
|
void addRecord(tap_credential_t* rec);
|
|
void clear();
|
|
|
|
enum {
|
|
COL_NUM,
|
|
COL_PROTO,
|
|
COL_USERNAME,
|
|
COL_INFO
|
|
};
|
|
|
|
enum {
|
|
ColumnHFID = Qt::UserRole + 1
|
|
};
|
|
|
|
private:
|
|
QList<tap_credential_t*> credentials_;
|
|
|
|
};
|
|
|
|
/*
|
|
* Editor modelines
|
|
*
|
|
* Local Variables:
|
|
* c-basic-offset: 4
|
|
* tab-width: 8
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
*/
|