32 , mCacheMinMaxDirty( true )
36 setEncoding( settings.value(
"/UI/encoding",
"System" ).toString() );
46 return "Generic vector file";
68 Q_UNUSED( attributes );
74 Q_UNUSED( attributes );
92 Q_UNUSED( geometry_map );
115 QTextCodec* ncodec = QTextCodec::codecForName( e.toLocal8Bit().constData() );
123 mEncoding = QTextCodec::codecForName(
"System" );
126 mEncoding = QTextCodec::codecForLocale();
144 QStringList abilitiesList;
150 abilitiesList +=
tr(
"Add Features" );
156 abilitiesList +=
tr(
"Delete Features" );
162 abilitiesList +=
tr(
"Change Attribute Values" );
163 QgsDebugMsg(
"Capability: Change Attribute Values" );
168 abilitiesList +=
tr(
"Add Attributes" );
174 abilitiesList +=
tr(
"Delete Attributes" );
181 abilitiesList +=
tr(
"Create Spatial Index" );
187 abilitiesList +=
tr(
"Fast Access to Features at ID" );
193 abilitiesList +=
tr(
"Change Geometries" );
199 abilitiesList +=
tr(
"Simplify Geometries" );
200 QgsDebugMsg(
"Capability: Simplify Geometries before fetch the feature" );
205 abilitiesList +=
tr(
"Simplify Geometries with topological validation" );
206 QgsDebugMsg(
"Capability: Simplify Geometries before fetch the feature ensuring that the result is a valid geometry" );
209 return abilitiesList.join(
", " );
218 for (
int i = 0; i < theFields.
count(); ++i )
220 if ( QString::compare( theFields[i].
name(), fieldName, Qt::CaseInsensitive ) == 0 )
230 QMap<QString, int> resultMap;
233 for (
int i = 0; i < theFields.
count(); ++i )
235 resultMap.insert( theFields[i].
name(), i );
246 for (
int i = 0; i < count; i++ )
260 QgsDebugMsgLevel( QString(
"field name = %1 type = %2 length = %3 precision = %4" )
262 .arg( QVariant::typeToName( field.
type() ) )
267 QgsDebugMsgLevel( QString(
"native field type = %1 min length = %2 max length = %3 min precision = %4 max precision = %5" )
288 if ( index < 0 || index >=
fields().count() )
290 QgsDebugMsg(
"Warning: access requested to invalid field index: " + QString::number( index ) );
304 if ( index < 0 || index >=
fields().count() )
306 QgsDebugMsg(
"Warning: access requested to invalid field index: " + QString::number( index ) );
322 keys.append( index );
330 if ( !
set.contains( f.
attribute( index ).toString() ) )
333 set.insert( f.
attribute( index ).toString() );
336 if ( limit >= 0 && values.size() >= limit )
352 for (
int i = 0; i < flds.
count(); ++i )
354 if ( flds[i].type() == QVariant::Int )
359 else if ( flds[i].type() == QVariant::Double )
378 for ( QgsAttributeList::const_iterator it = keys.begin(); it != keys.end(); ++it )
380 const QVariant& varValue = attrs[*it];
382 if ( flds[*it].type() == QVariant::Int )
384 int value = varValue.toInt();
390 else if ( flds[*it].type() == QVariant::Double )
392 double value = varValue.toDouble();
400 QString value = varValue.toString();
420 if ( !v.convert( type ) || value.isNull() )
421 v = QVariant( type );
428 return s1.toLower() < s2.toLower();
435 foreach ( QString codec, QTextCodec::availableCodecs() )