Code style refactoring done
This commit is contained in:
parent
02766bd5d2
commit
c5f1572efa
36 changed files with 202 additions and 130 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "cargoviewmodel.h"
|
||||
|
||||
|
||||
CargoViewModel::CargoViewModel(QObject *parent) : QAbstractTableModel(parent) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
#include "entities/cargo_entity.h"
|
||||
|
||||
|
||||
class CargoViewModel : public QAbstractTableModel {
|
||||
private:
|
||||
Q_OBJECT
|
||||
|
||||
QVector<cargo_entity> _data;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "deliverypointsviewmodel.h"
|
||||
|
||||
|
||||
DeliveryPointsViewModel::DeliveryPointsViewModel(QObject *parent) : QAbstractTableModel(parent) {
|
||||
|
||||
}
|
||||
|
|
@ -12,7 +13,8 @@ int DeliveryPointsViewModel::columnCount(const QModelIndex &/*parent*/) const {
|
|||
return 4;
|
||||
}
|
||||
|
||||
QVariant DeliveryPointsViewModel::headerData(int section, Qt::Orientation orientation, int role) const {
|
||||
QVariant DeliveryPointsViewModel::headerData(int section, Qt::Orientation orientation,
|
||||
int role) const {
|
||||
if (role == Qt::DisplayRole && orientation == Qt::Horizontal) {
|
||||
switch (section) {
|
||||
case 0:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
|
||||
class DeliveryPointsViewModel : public QAbstractTableModel {
|
||||
private:
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "usersviewmodel.h"
|
||||
|
||||
|
||||
UsersViewModel::UsersViewModel(QObject *parent) : QAbstractTableModel(parent) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
|
||||
class UsersViewModel : public QAbstractTableModel {
|
||||
private:
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "vesselsviewmodel.h"
|
||||
|
||||
|
||||
VesselsViewModel::VesselsViewModel(QObject *parent) : QAbstractTableModel(parent) {
|
||||
|
||||
}
|
||||
|
|
@ -35,8 +36,8 @@ QVariant VesselsViewModel::headerData(int section, Qt::Orientation orientation,
|
|||
QVariant VesselsViewModel::data(const QModelIndex &index, int role) const {
|
||||
if (role == Qt::DisplayRole) {
|
||||
auto item = apparatus::instance()->get_object_subsystem()->vessels()[index.row()];
|
||||
bool hs = false;
|
||||
auto harbor = apparatus::instance()->get_object_subsystem()->get_dpoint(item.harbor(), hs);
|
||||
bool s = false;
|
||||
auto harbor = apparatus::instance()->get_object_subsystem()->get_dpoint(item.harbor(), s);
|
||||
|
||||
int col = index.column();
|
||||
switch (col) {
|
||||
|
|
@ -45,7 +46,7 @@ QVariant VesselsViewModel::data(const QModelIndex &index, int role) const {
|
|||
case 1:
|
||||
return item.skipper();
|
||||
case 2:
|
||||
return (hs? harbor->title() : tr("##ERROR[%1]##").arg(item.harbor()));
|
||||
return (s? harbor->title() : tr("##ERROR[%1]##").arg(item.harbor()));
|
||||
case 3:
|
||||
return item.capacity();
|
||||
case 4:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
|
||||
class VesselsViewModel : public QAbstractTableModel {
|
||||
private:
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue