Clean up some typos

Cosmetic commit to clean up some of the annoying typos in qt-ui

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Henrik Brautaset Aronsen 2013-05-14 09:28:30 +02:00 committed by Dirk Hohndel
parent c07e183f1f
commit f9598f062c
5 changed files with 20 additions and 20 deletions

View file

@ -61,9 +61,9 @@ void DiveListView::selectionChanged(const QItemSelection& selected, const QItemS
Q_FOREACH(const QModelIndex& index, deselected.indexes()) { Q_FOREACH(const QModelIndex& index, deselected.indexes()) {
const QAbstractItemModel *model = index.model(); const QAbstractItemModel *model = index.model();
struct dive *dive = (struct dive*) model->data(index, TreeItemDT::DIVE_ROLE).value<void*>(); struct dive *dive = (struct dive*) model->data(index, TreeItemDT::DIVE_ROLE).value<void*>();
if (!dive) { // is's a trip! if (!dive) { // it's a trip!
if (model->rowCount(index)) { if (model->rowCount(index)) {
expand(index); // leave this - even if it looks like it shouldn't be here. looks like I'v found a Qt bug. expand(index); // leave this - even if it looks like it shouldn't be here. looks like I've found a Qt bug.
// the subselection is removed, but the painting is not. this cleans the area. // the subselection is removed, but the painting is not. this cleans the area.
} }
} else if (!parents.contains(index.parent())) { } else if (!parents.contains(index.parent())) {
@ -74,7 +74,7 @@ void DiveListView::selectionChanged(const QItemSelection& selected, const QItemS
Q_FOREACH(const QModelIndex& index, selected.indexes()) { Q_FOREACH(const QModelIndex& index, selected.indexes()) {
const QAbstractItemModel *model = index.model(); const QAbstractItemModel *model = index.model();
struct dive *dive = (struct dive*) model->data(index, TreeItemDT::DIVE_ROLE).value<void*>(); struct dive *dive = (struct dive*) model->data(index, TreeItemDT::DIVE_ROLE).value<void*>();
if (!dive) { // is's a trip! if (!dive) { // it's a trip!
if (model->rowCount(index)) { if (model->rowCount(index)) {
QItemSelection selection; QItemSelection selection;
selection.select(index.child(0,0), index.child(model->rowCount(index) -1 , 0)); selection.select(index.child(0,0), index.child(model->rowCount(index) -1 , 0));

View file

@ -90,7 +90,7 @@ void MainTab::updateDiveInfo(int dive)
// it will be called whenever a new dive is selected // it will be called whenever a new dive is selected
// I'm already populating the 'notes' box // I'm already populating the 'notes' box
// to show how it can be done. // to show how it can be done.
// If you are unsure what's the name of anything, // If you are unsure about the name of something,
// open the file maintab.ui on the designer // open the file maintab.ui on the designer
// click on the item and check its objectName, // click on the item and check its objectName,
// the access is ui->objectName from here on. // the access is ui->objectName from here on.
@ -136,7 +136,7 @@ void MainTab::updateDiveInfo(int dive)
ui->airPressureText->clear(); ui->airPressureText->clear();
} }
/* statisticsTab*/ /* statisticsTab*/
/* we can access the stats_selection struct but how to we ensure the relevant dives are selected /* we can access the stats_selection struct, but how do we ensure the relevant dives are selected
* if we don't use the gtk widget to drive this? * if we don't use the gtk widget to drive this?
* Maybe call process_selected_dives? Or re-write to query our Qt list view. * Maybe call process_selected_dives? Or re-write to query our Qt list view.
*/ */

View file

@ -336,13 +336,13 @@ void TankInfoModel::update()
TreeItemDT::~TreeItemDT() TreeItemDT::~TreeItemDT()
{ {
qDeleteAll(childs); qDeleteAll(children);
} }
int TreeItemDT::row() const int TreeItemDT::row() const
{ {
if (parent) if (parent)
return parent->childs.indexOf(const_cast<TreeItemDT*>(this)); return parent->children.indexOf(const_cast<TreeItemDT*>(this));
return 0; return 0;
} }
@ -637,7 +637,7 @@ const
TreeItemDT* parentItem = (!parent.isValid()) ? rootItem : static_cast<TreeItemDT*>(parent.internalPointer()); TreeItemDT* parentItem = (!parent.isValid()) ? rootItem : static_cast<TreeItemDT*>(parent.internalPointer());
TreeItemDT* childItem = parentItem->childs[row]; TreeItemDT* childItem = parentItem->children[row];
return (childItem) ? createIndex(row, column, childItem) : QModelIndex(); return (childItem) ? createIndex(row, column, childItem) : QModelIndex();
} }
@ -665,7 +665,7 @@ int DiveTripModel::rowCount(const QModelIndex& parent) const
else else
parentItem = static_cast<TreeItemDT*>(parent.internalPointer()); parentItem = static_cast<TreeItemDT*>(parent.internalPointer());
int amount = parentItem->childs.count(); int amount = parentItem->children.count();
return amount; return amount;
} }
@ -684,19 +684,19 @@ void DiveTripModel::setupModelData()
if (!trip) { if (!trip) {
diveItem->parent = rootItem; diveItem->parent = rootItem;
rootItem->childs.push_back(diveItem); rootItem->children.push_back(diveItem);
continue; continue;
} }
if (!trips.keys().contains(trip)) { if (!trips.keys().contains(trip)) {
TripItem* tripItem = new TripItem(); TripItem* tripItem = new TripItem();
tripItem->trip = trip; tripItem->trip = trip;
tripItem->parent = rootItem; tripItem->parent = rootItem;
tripItem->childs.push_back(diveItem); tripItem->children.push_back(diveItem);
trips[trip] = tripItem; trips[trip] = tripItem;
rootItem->childs.push_back(tripItem); rootItem->children.push_back(tripItem);
continue; continue;
} }
TripItem* tripItem = trips[trip]; TripItem* tripItem = trips[trip];
tripItem->childs.push_back(diveItem); tripItem->children.push_back(diveItem);
} }
} }

View file

@ -14,7 +14,7 @@
#include "../divelist.h" #include "../divelist.h"
/* Encapsulates the tank_info global variable /* Encapsulates the tank_info global variable
* to show on Qt`s Model View System.*/ * to show on Qt's Model View System.*/
class TankInfoModel : public QAbstractTableModel { class TankInfoModel : public QAbstractTableModel {
Q_OBJECT Q_OBJECT
public: public:
@ -50,9 +50,9 @@ public:
void clear(); void clear();
void update(); void update();
private: private:
/* Since the dive doesn`t stores the number of cylinders that /* Since the dive doesn't stores the number of cylinders that
* it has ( max 8 ) and since I don`t want to make a * it has (max 8) and since I don't want to make a
* model-for-each-dive, let`s hack this here instead. */ * model-for-each-dive, let's hack this here instead. */
QMap<struct dive *, int> usedRows; QMap<struct dive *, int> usedRows;
}; };
@ -94,7 +94,7 @@ public:
virtual QVariant data ( int column, int role ) const; virtual QVariant data ( int column, int role ) const;
int row() const; int row() const;
QList<TreeItemDT *> childs; QList<TreeItemDT *> children;
TreeItemDT *parent; TreeItemDT *parent;
}; };

View file

@ -663,7 +663,7 @@ void ProfileGraphicsView::plot_temperature_text()
/* don't print a temperature /* don't print a temperature
* if it's been less than 5min and less than a 2K change OR * if it's been less than 5min and less than a 2K change OR
* if it's been less than 2min OR if the change from the * if it's been less than 2min OR if the change from the
* last print is less than .4K (and therefore less than 1F */ * last print is less than .4K (and therefore less than 1F) */
if (((sec < last + 300) && (abs(mkelvin - last_printed_temp) < 2000)) || if (((sec < last + 300) && (abs(mkelvin - last_printed_temp) < 2000)) ||
(sec < last + 120) || (sec < last + 120) ||
(abs(mkelvin - last_printed_temp) < 400)) (abs(mkelvin - last_printed_temp) < 400))
@ -806,7 +806,7 @@ void ProfileGraphicsView::plot_one_event(struct event *ev)
int i, depth = 0; int i, depth = 0;
struct plot_info *pi = &gc.pi; struct plot_info *pi = &gc.pi;
/* is plotting this event disabled? */ /* is plotting of this event disabled? */
if (ev->name) { if (ev->name) {
for (i = 0; i < evn_used; i++) { for (i = 0; i < evn_used; i++) {
if (! strcmp(ev->name, ev_namelist[i].ev_name)) { if (! strcmp(ev->name, ev_namelist[i].ev_name)) {