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" );
197 return abilitiesList.join(
", " );
206 for (
int i = 0; i < theFields.
count(); ++i )
208 if ( QString::compare( theFields[i].
name(), fieldName, Qt::CaseInsensitive ) == 0 )
218 QMap<QString, int> resultMap;
221 for (
int i = 0; i < theFields.
count(); ++i )
223 resultMap.insert( theFields[i].
name(), i );
234 for (
int i = 0; i < count; i++ )
263 if ( index < 0 || index >=
fields().count() )
265 QgsDebugMsg(
"Warning: access requested to invalid field index: " + QString::number( index ) );
279 if ( index < 0 || index >=
fields().count() )
281 QgsDebugMsg(
"Warning: access requested to invalid field index: " + QString::number( index ) );
297 keys.append( index );
305 if ( !
set.contains( f.
attribute( index ).toString() ) )
308 set.insert( f.
attribute( index ).toString() );
311 if ( limit >= 0 && values.size() >= limit )
327 for (
int i = 0; i < flds.
count(); ++i )
329 if ( flds[i].type() == QVariant::Int )
334 else if ( flds[i].type() == QVariant::Double )
353 for ( QgsAttributeList::const_iterator it = keys.begin(); it != keys.end(); ++it )
355 const QVariant& varValue = attrs[*it];
357 if ( flds[*it].type() == QVariant::Int )
359 int value = varValue.toInt();
365 else if ( flds[*it].type() == QVariant::Double )
367 double value = varValue.toDouble();
375 QString value = varValue.toString();
395 if ( !v.convert( type ) )
396 v = QVariant( QString::null );
403 return s1.toLower() < s2.toLower();
410 foreach ( QString codec, QTextCodec::availableCodecs() )