Skip to content

Commit

Permalink
missed a file in 052dab8
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 4, 2013
1 parent 052dab8 commit 9f42294
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -187,7 +187,18 @@ void QgsOgrFeatureIterator::getFeatureAttribute( OGRFeatureH ogrFet, QgsFeature
case QVariant::String: value = QVariant( P->mEncoding->toUnicode( OGR_F_GetFieldAsString( ogrFet, attindex ) ) ); break;
case QVariant::Int: value = QVariant( OGR_F_GetFieldAsInteger( ogrFet, attindex ) ); break;
case QVariant::Double: value = QVariant( OGR_F_GetFieldAsDouble( ogrFet, attindex ) ); break;
//case QVariant::DateTime: value = QVariant(QDateTime::fromString(str)); break;
case QVariant::Date:
case QVariant::DateTime:
{
int year, month, day, hour, minute, second, tzf;

OGR_F_GetFieldAsDateTime( ogrFet, attindex, &year, &month, &day, &hour, &minute, &second, &tzf );
if ( P->mAttributeFields[attindex].type() == QVariant::Date )
value = QDate( year, month, day );
else
value = QDateTime( QDate( year, month, day ), QTime( hour, minute, second ) );
}
break;
default: assert( NULL && "unsupported field type" );
}
}
Expand Down

0 comments on commit 9f42294

Please sign in to comment.