diff options
-rw-r--r-- | qt-ui/models.cpp | 31 | ||||
-rw-r--r-- | qt-ui/simplewidgets.cpp | 4 | ||||
-rw-r--r-- | qt-ui/simplewidgets.h | 3 |
3 files changed, 19 insertions, 19 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 410c258ee..da4dc4ff1 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -59,12 +59,14 @@ void CleanerTableModel::setHeaderDataStrings(const QStringList &newHeaders) static QPixmap *trashIconPixmap; // initialize the trash icon if necessary -static void initTrashIcon() { +static void initTrashIcon() +{ if (!trashIconPixmap) trashIconPixmap = new QPixmap(QIcon(":trash").pixmap(defaultIconMetrics().sz_small)); } -const QPixmap &trashIcon() { +const QPixmap &trashIcon() +{ return *trashIconPixmap; } @@ -72,8 +74,7 @@ CylindersModel::CylindersModel(QObject *parent) : rows(0) { // enum {REMOVE, TYPE, SIZE, WORKINGPRESS, START, END, O2, HE, DEPTH}; setHeaderDataStrings(QStringList() << "" << tr("Type") << tr("Size") << tr("Work press.") << tr("Start press.") << tr("End press.") << trUtf8("O" UTF8_SUBSCRIPT_2 "%") << tr("He%") - << tr("Switch at") - ); + << tr("Switch at")); initTrashIcon(); } @@ -1326,7 +1327,7 @@ QString DiveItem::displayDuration() const { int hrs, mins; struct dive *dive = get_dive_by_uniq_id(diveId); - mins = (dive->duration.seconds+59) / 60; + mins = (dive->duration.seconds + 59) / 60; hrs = mins / 60; mins -= hrs * 60; @@ -2354,7 +2355,6 @@ bool TagFilterModel::filterRow(int source_row, const QModelIndex &source_parent, BuddyFilterModel::BuddyFilterModel(QObject *parent) : QStringListModel(parent), checkState(NULL) { - } BuddyFilterModel *BuddyFilterModel::instance() @@ -2397,8 +2397,8 @@ bool BuddyFilterModel::filterRow(int source_row, const QModelIndex &source_paren QStringList buddyList = stringList(); if (!buddyList.isEmpty()) { buddyList.removeLast(); // remove the "Show Empty Tags"; - for(int i = 0; i < rowCount(); i++){ - if(checkState[i] && (diveBuddy.indexOf(stringList()[i]) != -1 || divemaster.indexOf(stringList()[i]) != -1 )){ + for (int i = 0; i < rowCount(); i++) { + if (checkState[i] && (diveBuddy.indexOf(stringList()[i]) != -1 || divemaster.indexOf(stringList()[i]) != -1)) { return true; } } @@ -2416,14 +2416,13 @@ void BuddyFilterModel::repopulate() QStringList list; struct dive *dive; int i = 0; - for_each_dive (i, dive) - { + for_each_dive (i, dive) { QString buddy(dive->buddy); QString divemaster(dive->divemaster); if (!buddy.isEmpty() && !list.contains(buddy)) { list.append(buddy); } - if(!divemaster.isEmpty() && !list.contains(divemaster)){ + if (!divemaster.isEmpty() && !list.contains(divemaster)) { list.append(divemaster); } } @@ -2465,9 +2464,8 @@ bool BuddyFilterModel::setData(const QModelIndex &index, const QVariant &value, return false; } -LocationFilterModel::LocationFilterModel(QObject *parent): QStringListModel(parent), checkState(NULL) +LocationFilterModel::LocationFilterModel(QObject *parent) : QStringListModel(parent), checkState(NULL) { - } QVariant LocationFilterModel::data(const QModelIndex &index, int role) const @@ -2514,8 +2512,8 @@ bool LocationFilterModel::filterRow(int source_row, const QModelIndex &source_pa QStringList locationList = stringList(); if (!locationList.isEmpty()) { locationList.removeLast(); // remove the "Show Empty Tags"; - for(int i = 0; i < rowCount(); i++){ - if(checkState[i] && (location.indexOf(stringList()[i]) != -1)){ + for (int i = 0; i < rowCount(); i++) { + if (checkState[i] && (location.indexOf(stringList()[i]) != -1)) { return true; } } @@ -2539,8 +2537,7 @@ void LocationFilterModel::repopulate() QStringList list; struct dive *dive; int i = 0; - for_each_dive (i, dive) - { + for_each_dive (i, dive) { QString location(dive->location); if (!location.isEmpty() && !list.contains(location)) { list.append(location); diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 8756d822f..c244425c7 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -531,7 +531,7 @@ void LocationFilter::hideEvent(QHideEvent *event) MultiFilterSortModel::instance()->removeFilterModel(LocationFilterModel::instance()); QWidget::hideEvent(event); } -MultiFilter::MultiFilter(QWidget *parent): QScrollArea(parent) +MultiFilter::MultiFilter(QWidget *parent) : QScrollArea(parent) { QWidget *w = new QWidget(); QHBoxLayout *l = new QHBoxLayout(); @@ -540,7 +540,7 @@ MultiFilter::MultiFilter(QWidget *parent): QScrollArea(parent) l->addWidget(new BuddyFilter()); l->addWidget(new LocationFilter()); - l->setContentsMargins(0,0,0,0); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing(1); w->setLayout(l); w->setMinimumSize(l->count() * 150, 200); diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index 89cf28716..5fbdad613 100644 --- a/qt-ui/simplewidgets.h +++ b/qt-ui/simplewidgets.h @@ -136,6 +136,7 @@ public: TagFilter(QWidget *parent = 0); virtual void showEvent(QShowEvent *); virtual void hideEvent(QHideEvent *); + private: Ui::FilterWidget ui; }; @@ -146,6 +147,7 @@ public: BuddyFilter(QWidget *parent = 0); virtual void showEvent(QShowEvent *); virtual void hideEvent(QHideEvent *); + private: Ui::FilterWidget ui; }; @@ -156,6 +158,7 @@ public: LocationFilter(QWidget *parent = 0); virtual void showEvent(QShowEvent *); virtual void hideEvent(QHideEvent *); + private: Ui::FilterWidget ui; }; |