Skip to content
Permalink
Browse files

missed a file in 052dab8

  • Loading branch information
jef-n committed Apr 4, 2013
1 parent 052dab8 commit 9f42294910f2798fbeeffa3113ad55a91199f2b4
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/providers/ogr/qgsogrfeatureiterator.cpp
@@ -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" );
}
}

0 comments on commit 9f42294

Please sign in to comment.
You can’t perform that action at this time.