mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-27 22:40:34 -06:00
This adds a column for the file size to the list of commits. It also adds a couple of tooltips to the Remote and Commit tree views to show additional information. Especially for remote databases this adds a lot of valuable information.
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
#ifndef REMOTECOMMITSMODEL_H
|
|
#define REMOTECOMMITSMODEL_H
|
|
|
|
#include <QAbstractItemModel>
|
|
|
|
#include <json.hpp>
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
class RemoteCommitsModel : public QAbstractItemModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit RemoteCommitsModel(QObject* parent);
|
|
~RemoteCommitsModel() override;
|
|
|
|
void clear();
|
|
void refresh(const std::string& json_data, const std::string& last_commit_id, const std::string& current_commit_id);
|
|
|
|
QModelIndex index(int row, int column,const QModelIndex& parent = QModelIndex()) const override;
|
|
QModelIndex parent(const QModelIndex& index) const override;
|
|
|
|
QVariant data(const QModelIndex& index, int role) const override;
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
|
|
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
|
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
|
|
|
enum Columns
|
|
{
|
|
ColumnCommitId,
|
|
ColumnMessage,
|
|
ColumnDate,
|
|
ColumnAuthor,
|
|
ColumnSize,
|
|
};
|
|
|
|
private:
|
|
// Pointer to the root item. This contains all the actual item data.
|
|
QTreeWidgetItem* rootItem;
|
|
};
|
|
|
|
#endif
|