Skip to content

Commit

Permalink
Missed committing files
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrook committed Apr 16, 2013
1 parent 1e8304b commit d6a53e5
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 88 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ struct CORE_EXPORT QgsVectorJoinInfo
*
* - decimalPoint=c
*
* Defines a character that is used as a decimal point in the X and Y columns.
* Defines a character that is used as a decimal point in the numeric columns
* The default is '.'.
*
* - xyDms=(yes|no)
Expand Down
18 changes: 13 additions & 5 deletions src/providers/delimitedtext/qgsdelimitedtextfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,24 @@ void QgsDelimitedTextFeatureIterator::fetchAttribute( QgsFeature& feature, int f
switch ( P->attributeFields[fieldIdx].type() )
{
case QVariant::Int:
if ( !value.isEmpty() )
val = QVariant( value );
else
if ( value.isEmpty() )
val = QVariant( P->attributeFields[fieldIdx].type() );
else
val = QVariant( value );
break;
case QVariant::Double:
if ( !value.isEmpty() )
if ( value.isEmpty() )
{
val = QVariant( P->attributeFields[fieldIdx].type() );
}
else if ( P->mDecimalPoint.isEmpty() )
{
val = QVariant( value.toDouble() );
}
else
val = QVariant( P->attributeFields[fieldIdx].type() );
{
val = QVariant( QString( value ).replace( P->mDecimalPoint, "." ).toDouble() );
}
break;
default:
val = QVariant( value );
Expand Down
4 changes: 4 additions & 0 deletions src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
}
if ( couldBeDouble[fieldPos] )
{
if ( ! mDecimalPoint.isEmpty() )
{
value.replace( mDecimalPoint, "." );
}
value.toDouble( &couldBeDouble[fieldPos] );
}
fieldPos++;
Expand Down
4 changes: 2 additions & 2 deletions src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ void QgsDelimitedTextSourceSelect::loadSettings( QString subkey, bool loadGeomSe
cbxUseHeader->setChecked( settings.value( key + "/useHeader", "true" ) != "false" );
cbxTrimFields->setChecked( settings.value( key + "/trimFields", "false" ) == "true" );
cbxSkipEmptyFields->setChecked( settings.value( key + "/skipEmptyFields", "false" ) == "true" );
cbxPointIsComma->setChecked( settings.value( key + "/decimalPoint", "." ).toString().contains( "," ) );

if ( loadGeomSettings )
{
QString geomColumnType = settings.value( key + "/geomColumnType", "xy" ).toString();
if ( geomColumnType == "xy" ) geomTypeXY->setChecked( true );
else if ( geomColumnType == "wkt" ) geomTypeWKT->setChecked( true );
else geomTypeNone->setChecked( true );
cbxPointIsComma->setChecked( settings.value( key + "/decimalPoint", "." ).toString().contains( "," ) );
cbxXyDms->setChecked( settings.value( key + "/xyDms", "false" ) == "true" );
}

Expand Down Expand Up @@ -297,13 +297,13 @@ void QgsDelimitedTextSourceSelect::saveSettings( QString subkey, bool saveGeomSe
settings.setValue( key + "/useHeader", cbxUseHeader->isChecked() ? "true" : "false" );
settings.setValue( key + "/trimFields", cbxTrimFields->isChecked() ? "true" : "false" );
settings.setValue( key + "/skipEmptyFields", cbxSkipEmptyFields->isChecked() ? "true" : "false" );
settings.setValue( key + "/decimalPoint", cbxPointIsComma->isChecked() ? "," : "." );
if ( saveGeomSettings )
{
QString geomColumnType = "none";
if ( geomTypeXY->isChecked() ) geomColumnType = "xy";
if ( geomTypeWKT->isChecked() ) geomColumnType = "wkt";
settings.setValue( key + "/geomColumnType", geomColumnType );
settings.setValue( key + "/decimalPoint", cbxPointIsComma->isChecked() ? "," : "." );
settings.setValue( key + "/xyDms", cbxXyDms->isChecked() ? "true" : "false" );
}

Expand Down
167 changes: 87 additions & 80 deletions src/ui/qgsdelimitedtextsourceselectbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>658</width>
<height>600</height>
<width>625</width>
<height>524</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -128,38 +128,6 @@
</property>
</widget>
</item>
<item>
<spacer name="hspacer4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cbxPointIsComma">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>X and Y coordinates have comma for decimal point</string>
</property>
<property name="statusTip">
<string>X and Y coordinates have comma for decimal point</string>
</property>
<property name="whatsThis">
<string>X and Y coordinates have comma for decimal point</string>
</property>
<property name="text">
<string>Point is comma</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxXyDms">
<property name="toolTip">
Expand All @@ -172,10 +140,23 @@
<string>X and Y coordinates are expressed in degrees/minutes/seconds</string>
</property>
<property name="text">
<string>DMS coords</string>
<string>DMS coordinates</string>
</property>
</widget>
</item>
<item>
<spacer name="hspacer4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -820,6 +801,25 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxPointIsComma">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>X and Y coordinates have comma for decimal point</string>
</property>
<property name="statusTip">
<string>X and Y coordinates have comma for decimal point</string>
</property>
<property name="whatsThis">
<string>X and Y coordinates have comma for decimal point</string>
</property>
<property name="text">
<string>Point is comma</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
Expand Down Expand Up @@ -872,13 +872,20 @@
<tabstop>txtEscapeChars</tabstop>
<tabstop>delimiterRegexp</tabstop>
<tabstop>txtDelimiterRegexp</tabstop>
<tabstop>cbxTrimFields</tabstop>
<tabstop>cbxSkipEmptyFields</tabstop>
<tabstop>cbxPointIsComma</tabstop>
<tabstop>rowCounter</tabstop>
<tabstop>cbxUseHeader</tabstop>
<tabstop>geomTypeXY</tabstop>
<tabstop>cmbXField</tabstop>
<tabstop>cmbYField</tabstop>
<tabstop>cbxPointIsComma</tabstop>
<tabstop>cbxXyDms</tabstop>
<tabstop>geomTypeWKT</tabstop>
<tabstop>cmbWktField</tabstop>
<tabstop>cmbGeometryType</tabstop>
<tabstop>geomTypeNone</tabstop>
<tabstop>tblSample</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
Expand All @@ -890,12 +897,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>119</x>
<y>246</y>
<x>128</x>
<y>219</y>
</hint>
<hint type="destinationlabel">
<x>388</x>
<y>245</y>
<x>380</x>
<y>218</y>
</hint>
</hints>
</connection>
Expand All @@ -906,12 +913,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>101</x>
<y>327</y>
<x>93</x>
<y>313</y>
</hint>
<hint type="destinationlabel">
<x>270</x>
<y>329</y>
<x>262</x>
<y>315</y>
</hint>
</hints>
</connection>
Expand All @@ -922,12 +929,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>89</x>
<y>327</y>
<x>93</x>
<y>313</y>
</hint>
<hint type="destinationlabel">
<x>438</x>
<y>329</y>
<x>430</x>
<y>315</y>
</hint>
</hints>
</connection>
Expand All @@ -938,12 +945,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>101</x>
<y>360</y>
<x>95</x>
<y>344</y>
</hint>
<hint type="destinationlabel">
<x>250</x>
<y>362</y>
<x>261</x>
<y>346</y>
</hint>
</hints>
</connection>
Expand All @@ -954,8 +961,8 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>80</x>
<y>182</y>
<x>89</x>
<y>155</y>
</hint>
<hint type="destinationlabel">
<x>181</x>
Expand All @@ -970,76 +977,76 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>47</x>
<y>359</y>
<x>59</x>
<y>344</y>
</hint>
<hint type="destinationlabel">
<x>349</x>
<y>358</y>
<x>429</x>
<y>346</y>
</hint>
</hints>
</connection>
<connection>
<sender>geomTypeXY</sender>
<signal>toggled(bool)</signal>
<receiver>cbxPointIsComma</receiver>
<receiver>textLabelx</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>49</x>
<y>321</y>
<x>52</x>
<y>313</y>
</hint>
<hint type="destinationlabel">
<x>512</x>
<y>327</y>
<x>136</x>
<y>315</y>
</hint>
</hints>
</connection>
<connection>
<sender>geomTypeXY</sender>
<signal>toggled(bool)</signal>
<receiver>textLabelx</receiver>
<receiver>textLabely</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>40</x>
<y>320</y>
<x>69</x>
<y>313</y>
</hint>
<hint type="destinationlabel">
<x>116</x>
<y>326</y>
<x>304</x>
<y>315</y>
</hint>
</hints>
</connection>
<connection>
<sender>geomTypeXY</sender>
<sender>geomTypeWKT</sender>
<signal>toggled(bool)</signal>
<receiver>textLabely</receiver>
<receiver>label</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>57</x>
<y>327</y>
<x>58</x>
<y>344</y>
</hint>
<hint type="destinationlabel">
<x>282</x>
<y>326</y>
<x>350</x>
<y>346</y>
</hint>
</hints>
</connection>
<connection>
<sender>geomTypeWKT</sender>
<sender>geomTypeXY</sender>
<signal>toggled(bool)</signal>
<receiver>label</receiver>
<receiver>cbxXyDms</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>46</x>
<y>356</y>
<x>40</x>
<y>300</y>
</hint>
<hint type="destinationlabel">
<x>290</x>
<y>357</y>
<x>488</x>
<y>305</y>
</hint>
</hints>
</connection>
Expand Down
Loading

0 comments on commit d6a53e5

Please sign in to comment.