diff options
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 6a770b256..0f8ccbe61 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -1,15 +1,15 @@ #include "qmlmanager.h" #include <QUrl> +#include "../qt-models/divelistmodel.h" + QMLManager::QMLManager() { - } QMLManager::~QMLManager() { - } QString QMLManager::filename() @@ -20,12 +20,21 @@ QString QMLManager::filename() void QMLManager::setFilename(const QString &f) { m_fileName = f; - emit filenameChanged(); loadFile(); + emit filenameChanged(); } void QMLManager::loadFile() { QUrl url(m_fileName); QString strippedFileName = url.toLocalFile(); + + parse_file(strippedFileName.toUtf8().data()); + + int i; + struct dive *d; + + for_each_dive(i, d) { + DiveListModel::instance()->addDive(d); + } } |