@@ -2269,11 +2269,11 @@ void QgsGrassModuleInput::updateQgisLayers()
2269
2269
2270
2270
QString current = mLayerComboBox ->currentText ();
2271
2271
mLayerComboBox ->clear ();
2272
- mMaps .resize ( 0 );
2273
- mGeometryTypes .resize ( 0 );
2274
- mVectorLayerNames .resize ( 0 );
2275
- mMapLayers .resize ( 0 );
2276
- mVectorFields .resize ( 0 );
2272
+ mMaps .clear ( );
2273
+ mGeometryTypes .clear ( );
2274
+ mVectorLayerNames .clear ( );
2275
+ mMapLayers .clear ( );
2276
+ mVectorFields .clear ( );
2277
2277
2278
2278
// If not required, add an empty item to combobox and a padding item into
2279
2279
// layer containers.
@@ -2458,12 +2458,10 @@ QStringList QgsGrassModuleInput::options()
2458
2458
QStringList list;
2459
2459
QString opt;
2460
2460
2461
- int c = mLayerComboBox ->currentIndex ();
2462
- if ( c < 0 ) // not found
2461
+ int current = mLayerComboBox ->currentIndex ();
2462
+ if ( current < 0 ) // not found
2463
2463
return list;
2464
2464
2465
- unsigned current = c;
2466
-
2467
2465
// TODO: this is hack for network nodes, do it somehow better
2468
2466
if ( mMapId .isEmpty () )
2469
2467
{
@@ -2537,15 +2535,15 @@ QString QgsGrassModuleInput::currentMap()
2537
2535
{
2538
2536
QgsDebugMsg ( " called." );
2539
2537
2540
- unsigned int limit = 0 ;
2538
+ int limit = 0 ;
2541
2539
if ( !mRequired )
2542
2540
limit = 1 ;
2543
2541
2544
- unsigned int current = mLayerComboBox ->currentIndex ();
2542
+ int current = mLayerComboBox ->currentIndex ();
2545
2543
if ( current < limit )
2546
2544
return QString ();
2547
2545
2548
- if ( current >= limit && current < mMaps .size () )
2546
+ if ( current >= limit && current < mMaps .size () )
2549
2547
{
2550
2548
return mMaps [current];
2551
2549
}
@@ -2762,8 +2760,8 @@ void QgsGrassModuleGdalInput::updateQgisLayers()
2762
2760
2763
2761
QString current = mLayerComboBox ->currentText ();
2764
2762
mLayerComboBox ->clear ();
2765
- mUri .resize ( 0 );
2766
- mOgrLayers .resize ( 0 );
2763
+ mUri .clear ( );
2764
+ mOgrLayers .clear ( );
2767
2765
2768
2766
// If not required, add an empty item to combobox and a padding item into
2769
2767
// layer containers.
@@ -2857,7 +2855,6 @@ void QgsGrassModuleGdalInput::updateQgisLayers()
2857
2855
if ( layer->name () == current ) mLayerComboBox ->setItemText ( mLayerComboBox ->currentIndex (), current );
2858
2856
2859
2857
mUri .push_back ( uri );
2860
-
2861
2858
mOgrLayers .push_back ( ogrLayer );
2862
2859
mOgrWheres .push_back ( ogrWhere );
2863
2860
}
@@ -2867,6 +2864,8 @@ void QgsGrassModuleGdalInput::updateQgisLayers()
2867
2864
mLayerComboBox ->addItem ( layer->name () );
2868
2865
if ( layer->name () == current ) mLayerComboBox ->setItemText ( mLayerComboBox ->currentIndex (), current );
2869
2866
mUri .push_back ( uri );
2867
+ mOgrLayers .push_back ( " " );
2868
+ mOgrWheres .push_back ( " " );
2870
2869
}
2871
2870
}
2872
2871
}
@@ -2875,21 +2874,19 @@ QStringList QgsGrassModuleGdalInput::options()
2875
2874
{
2876
2875
QStringList list;
2877
2876
2878
- int c = mLayerComboBox ->currentIndex ();
2879
- if ( c < 0 )
2877
+ int current = mLayerComboBox ->currentIndex ();
2878
+ if ( current < 0 )
2880
2879
return list;
2881
2880
2882
- unsigned int current = c;
2883
-
2884
2881
QString opt ( mKey + " =" );
2885
2882
2886
- if ( current >= 0 && current < mUri .size () )
2883
+ if ( current >= 0 && current < mUri .size () )
2887
2884
{
2888
2885
opt.append ( mUri [current] );
2889
2886
}
2890
2887
list.push_back ( opt );
2891
2888
2892
- if ( !mOgrLayerOption .isNull () && mOgrLayers [current].length () > 0 )
2889
+ if ( !mOgrLayerOption .isEmpty () && mOgrLayers [current].size () > 0 )
2893
2890
{
2894
2891
opt = mOgrLayerOption + " =" ;
2895
2892
// GDAL 1.4.0 supports schemas (r9998)
@@ -2918,7 +2915,7 @@ QStringList QgsGrassModuleGdalInput::options()
2918
2915
list.push_back ( opt );
2919
2916
}
2920
2917
2921
- if ( !mOgrWhereOption .isNull () && mOgrWheres [current].length () > 0 )
2918
+ if ( !mOgrWhereOption .isEmpty () && mOgrWheres [current].length () > 0 )
2922
2919
{
2923
2920
list.push_back ( mOgrWhereOption + " =" + mOgrWheres [current] );
2924
2921
}
0 commit comments