summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 0564add12..43f08e106 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -332,6 +332,23 @@ void CylindersModel::setDive(dive *d)
}
}
+void CylindersModel::copyFromDive(dive *d)
+{
+ if (!d)
+ return;
+ rows = 0;
+ for (int i = 0; i < MAX_CYLINDERS; i++) {
+ if (!cylinder_none(&d->cylinder[i]) &&
+ (prefs.display_unused_tanks || d->cylinder[i].used)) {
+ rows = i + 1;
+ }
+ }
+ if (rows > 0) {
+ beginInsertRows(QModelIndex(), 0, rows - 1);
+ endInsertRows();
+ }
+}
+
Qt::ItemFlags CylindersModel::flags(const QModelIndex &index) const
{
if (index.column() == REMOVE)