SitesDataMapper.cpp   SitesDataMapper.cpp 
skipping to change at line 35 skipping to change at line 35
#include <QModelIndex> #include <QModelIndex>
#include <QSqlError> #include <QSqlError>
#include <QSqlField> #include <QSqlField>
#include <QSqlRecord> #include <QSqlRecord>
#include <QSqlTableModel> #include <QSqlTableModel>
#include <QSqlRelationalTableModel> #include <QSqlRelationalTableModel>
#include <QVariant> #include <QVariant>
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelNavigator.hpp"
SitesDataMapper::SitesDataMapper(Ui_SitesWidget *aWidget, QMap<QString, QSq lTableModel *> tableModels, QObject *parent) : QObject(parent) SitesDataMapper::SitesDataMapper(Ui_SitesWidget *aWidget, QMap<QString, QSq lTableModel *> tableModels, QObject *parent) : QObject(parent)
{ {
widget = aWidget; widget = aWidget;
QRegExp nonEmptyStringRegEx("\\S+.*"); QRegExp nonEmptyStringRegEx("\\S+.*");
QRegExpValidator *nonEmptyStringValidator = new QRegExpValidator(non EmptyStringRegEx, this); QRegExpValidator *nonEmptyStringValidator = new QRegExpValidator(non EmptyStringRegEx, this);
LimitingDoubleValidator *latitudeValidator = new LimitingDoubleValid ator(-90.0, 90.0, 6, this); LimitingDoubleValidator *latitudeValidator = new LimitingDoubleValid ator(-90.0, 90.0, 6, this);
LimitingDoubleValidator *longitudeValidator = new LimitingDoubleVali dator(-180.0, 180.0, 6, this); LimitingDoubleValidator *longitudeValidator = new LimitingDoubleVali dator(-180.0, 180.0, 6, this);
widget->nameLineEdit->setValidator(nonEmptyStringValidator); widget->nameLineEdit->setValidator(nonEmptyStringValidator);
skipping to change at line 67 skipping to change at line 66
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark protected slots #pragma mark protected slots
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void SitesDataMapper::addSiteForCurrentLocation() void SitesDataMapper::addSiteForCurrentLocation()
{ {
const StelNavigator* nav = StelApp::getInstance().getCore()->getNavi gator(); const StelCore* core = StelApp::getInstance().getCore();
QSqlField field1("name", QVariant::String); QSqlField field1("name", QVariant::String);
QSqlField field2("longitude", QVariant::Double); QSqlField field2("longitude", QVariant::Double);
QSqlField field3("latitude", QVariant::Double); QSqlField field3("latitude", QVariant::Double);
QSqlField field4("elevation", QVariant::Int); QSqlField field4("elevation", QVariant::Int);
QSqlField field5("timezone_offset", QVariant::Double); QSqlField field5("timezone_offset", QVariant::Double);
field1.setValue(QVariant(nav->getCurrentLocation().name)); field1.setValue(QVariant(core->getCurrentLocation().name));
field2.setValue(QVariant(nav->getCurrentLocation().longitude)); field2.setValue(QVariant(core->getCurrentLocation().longitude));
field3.setValue(QVariant(nav->getCurrentLocation().latitude)); field3.setValue(QVariant(core->getCurrentLocation().latitude));
field4.setValue(QVariant(nav->getCurrentLocation().altitude)); field4.setValue(QVariant(core->getCurrentLocation().altitude));
field5.setValue(QVariant(0)); field5.setValue(QVariant(0));
QSqlRecord newRecord = QSqlRecord(); QSqlRecord newRecord = QSqlRecord();
newRecord.append(field1); newRecord.append(field1);
newRecord.append(field2); newRecord.append(field2);
newRecord.append(field3); newRecord.append(field3);
newRecord.append(field4); newRecord.append(field4);
newRecord.append(field5); newRecord.append(field5);
if (tableModel->insertRecord(-1, newRecord)) { if (tableModel->insertRecord(-1, newRecord)) {
widget->sitesListView->setCurrentIndex(tableModel->index(tab leModel->rowCount() - 1, 1)); widget->sitesListView->setCurrentIndex(tableModel->index(tab leModel->rowCount() - 1, 1));
 End of changes. 3 change blocks. 
6 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/