Skip to content
Permalink
Browse files
Branch for 0.9.0 release
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_9_0@7220 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Sep 24, 2007
2 parents 251bf75 + 5060577 commit b41ce991b0aec25910cdb14934e56657baebb7f4
Showing with 1,816 additions and 7,150 deletions.
  1. +5 −5 debian/control
  2. +0 −1 debian/libqgis1.substvars
  3. +0 −1 debian/qgis-plugin-grass.substvars
  4. +0 −1 debian/qgis.substvars
  5. +4 −1 debian/rules
  6. +2 −1 src/app/composer/qgscomposer.cpp
  7. +4 −1 src/app/composer/qgscomposermap.cpp
  8. +6 −2 src/app/composer/qgscomposervectorlegend.cpp
  9. +16 −0 src/app/legend/qgslegend.cpp
  10. +3 −0 src/app/legend/qgslegend.h
  11. +12 −26 src/app/qgisapp.cpp
  12. +34 −44 src/app/qgsattributetable.cpp
  13. +2 −6 src/app/qgsattributetable.h
  14. +18 −11 src/app/qgscustomprojectiondialog.cpp
  15. +17 −11 src/app/qgscustomprojectiondialog.h
  16. +0 −1 src/app/qgslinestylewidget.cpp
  17. +0 −1 src/app/qgspointstylewidget.cpp
  18. +17 −1 src/core/qgis.cpp
  19. +1 −1 src/core/qgsexception.h
  20. +5 −5 src/core/qgsfield.cpp
  21. +36 −2 src/core/qgsspatialrefsys.cpp
  22. +17 −0 src/core/qgsspatialrefsys.h
  23. +3 −1 src/core/raster/qgsrasterlayer.cpp
  24. +17 −0 src/core/raster/qgsrasterpyramid.h
  25. +17 −1 src/core/renderer/qgsrenderer.cpp
  26. +14 −1 src/gui/qgisgui.cpp
  27. +16 −0 src/gui/qgscursors.cpp
  28. +16 −0 src/gui/qgscursors.h
  29. +1 −0 src/gui/qgsprojectionselector.cpp
  30. +1 −0 src/gui/qgsprojectionselector.h
  31. +17 −0 src/helpviewer/main.cpp
  32. +14 −1 src/plugins/georeferencer/mapcoordsdialog.cpp
  33. +14 −1 src/plugins/georeferencer/qgsgeorefdatapoint.cpp
  34. +14 −1 src/plugins/georeferencer/qgsgeorefdatapoint.h
  35. +14 −1 src/plugins/georeferencer/qgsgeorefwarpoptionsdialog.cpp
  36. +14 −0 src/plugins/georeferencer/qgsimagewarper.cpp
  37. +14 −0 src/plugins/georeferencer/qgsimagewarper.h
  38. +14 −0 src/plugins/georeferencer/qgsleastsquares.cpp
  39. +14 −0 src/plugins/georeferencer/qgsleastsquares.h
  40. +14 −0 src/plugins/georeferencer/qgspointdialog.cpp
  41. +14 −0 src/plugins/gps_importer/qgsgpsdevice.cpp
  42. +14 −0 src/plugins/grass/qgsgrassshell.cpp
  43. +14 −0 src/plugins/grass/qgsgrassshell.h
  44. +14 −0 src/plugins/grid_maker/graticulecreator.cpp
  45. +14 −0 src/plugins/grid_maker/graticulecreator.h
  46. +14 −0 src/plugins/grid_maker/main.cpp
  47. +3 −0 src/plugins/grid_maker/utils.c
  48. +3 −0 src/plugins/grid_maker/utils.h
  49. +14 −0 src/plugins/maplayer/maplayertest.cpp
  50. +14 −0 src/plugins/maplayer/maplayertest.h
  51. +16 −3 src/plugins/plugin_builder.py
  52. +14 −0 src/plugins/qgisplugin.h
  53. +14 −0 src/plugins/spit/main.cpp
  54. +14 −1 src/plugins/spit/qgseditreservedwordsdialog.cpp
  55. +14 −0 src/plugins/spit/qgseditreservedwordsdialog.h
  56. +14 −0 src/plugins/spit/spit_icons.h
  57. +14 −0 src/providers/mysql/testmysql.cpp
  58. +15 −11 src/providers/ogr/qgsogrfactory.cpp
  59. +15 −11 src/providers/ogr/qgsogrfactory.h
  60. +2 −2 src/providers/ogr/qgsogrprovider.cpp
  61. +14 −0 src/providers/wfs/qgswfsdata.cpp
  62. +14 −0 src/providers/wfs/qgswfsdata.h
  63. +421 −359 src/ui/qgsrasterlayerpropertiesbase.ui
  64. +14 −0 tests/algorithms/projections/main.cpp
  65. +14 −0 tests/algorithms/projections/projectioncshandlingtest.h
  66. +14 −0 tests/algorithms/qgsproject/main.cpp
  67. +14 −0 tests/algorithms/qgsproject/projecttest.h
  68. +24 −12 tests/src/core/CMakeLists.txt
  69. +15 −0 tests/src/core/runtests.sh
  70. +15 −0 tests/src/core/test_builder.pl
  71. +15 −0 tests/src/core/test_suite_builder.sh
  72. +14 −0 tests/src/core/test_template.cpp
  73. +38 −121 tests/src/core/testqgsapplication.cpp
  74. +0 −29 tests/src/core/testqgsbookmarkitem.cpp
  75. +0 −32 tests/src/core/testqgscolortable.cpp
  76. +0 −44 tests/src/core/testqgscontexthelp.cpp
  77. +0 −24 tests/src/core/testqgscustomsymbol.cpp
  78. +0 −36 tests/src/core/testqgsdatamanager.cpp
  79. +0 −24 tests/src/core/testqgsdatasource.cpp
  80. +0 −72 tests/src/core/testqgsdistancearea.cpp
  81. +0 −168 tests/src/core/testqgsfeature.cpp
  82. +0 −36 tests/src/core/testqgsfeatureattribute.cpp
  83. +0 −64 tests/src/core/testqgsfield.cpp
  84. +0 −100 tests/src/core/testqgsgeometry.cpp
  85. +0 −36 tests/src/core/testqgsgeometryvertexindex.cpp
  86. +0 −32 tests/src/core/testqgslabelattributes.cpp
  87. +0 −48 tests/src/core/testqgsline.cpp
  88. +0 −24 tests/src/core/testqgslinesymbol.cpp
  89. +0 −32 tests/src/core/testqgsmarkercatalogue.cpp
  90. +0 −28 tests/src/core/testqgsnumericsortlistviewitem.cpp
  91. +0 −40 tests/src/core/testqgspluginitem.cpp
  92. +0 −48 tests/src/core/testqgspluginregistry.cpp
  93. +0 −40 tests/src/core/testqgspoint.cpp
  94. +0 −24 tests/src/core/testqgspolygonsymbol.cpp
  95. +0 −28 tests/src/core/testqgsprovidercountcalcevent.cpp
  96. +0 −28 tests/src/core/testqgsproviderextentcalcevent.cpp
  97. +0 −36 tests/src/core/testqgsprovidermetadata.cpp
  98. +0 −56 tests/src/core/testqgsproviderregistry.cpp
  99. +0 −32 tests/src/core/testqgsrangerenderitem.cpp
  100. +0 −28 tests/src/core/testqgsrasterdataprovider.cpp
  101. +0 −72 tests/src/core/testqgsrect.cpp
  102. +0 −28 tests/src/core/testqgsrenderer.cpp
  103. +0 −48 tests/src/core/testqgsrenderitem.cpp
  104. +0 −40 tests/src/core/testqgsscalecalculator.cpp
  105. +0 −40 tests/src/core/testqgssearchstring.cpp
  106. +0 −44 tests/src/core/testqgssearchtreenode.cpp
  107. +0 −100 tests/src/core/testqgssymbol.cpp
  108. +0 −72 tests/src/core/testqgsvectordataprovider.cpp
  109. +442 −0 tests/src/core/testqgsvectorfilewriter.cpp
  110. +0 −26 tests/src/gui/runtests.sh
  111. +0 −173 tests/src/gui/test_builder.pl
  112. +0 −9 tests/src/gui/test_suite_builder.sh
  113. +0 −20 tests/src/gui/test_template.cpp
  114. +0 −484 tests/src/gui/testqgisapp.cpp
  115. +0 −48 tests/src/gui/testqgsabout.cpp
  116. +0 −32 tests/src/gui/testqgsaddattrdialog.cpp
  117. +0 −68 tests/src/gui/testqgsattributeactiondialog.cpp
  118. +0 −32 tests/src/gui/testqgsattributedialog.cpp
  119. +0 −128 tests/src/gui/testqgsattributetable.cpp
  120. +0 −88 tests/src/gui/testqgsattributetabledisplay.cpp
  121. +0 −40 tests/src/gui/testqgsbookmarks.cpp
  122. +0 −40 tests/src/gui/testqgsclipboard.cpp
  123. +0 −36 tests/src/gui/testqgscontinuouscolordialog.cpp
  124. +0 −60 tests/src/gui/testqgscontinuouscolorrenderer.cpp
  125. +0 −60 tests/src/gui/testqgscoordinatetransform.cpp
  126. +0 −60 tests/src/gui/testqgscustomprojectiondialog.cpp
  127. +0 −92 tests/src/gui/testqgsdbsourceselect.cpp
  128. +0 −28 tests/src/gui/testqgsdelattrdialog.cpp
  129. +0 −28 tests/src/gui/testqgsencodingfiledialog.cpp
  130. +0 −24 tests/src/gui/testqgsfillstylewidget.cpp
  131. +0 −36 tests/src/gui/testqgsgeomtypedialog.cpp
  132. +0 −48 tests/src/gui/testqgsgraduatedsymboldialog.cpp
  133. +0 −56 tests/src/gui/testqgsgraduatedsymbolrenderer.cpp
  134. +0 −28 tests/src/gui/testqgshelpviewer.cpp
  135. +0 −80 tests/src/gui/testqgsidentifyresults.cpp
  136. +0 −36 tests/src/gui/testqgslabel.cpp
  137. +0 −48 tests/src/gui/testqgslabeldialog.cpp
  138. +0 −48 tests/src/gui/testqgslayerprojectionselector.cpp
  139. +0 −32 tests/src/gui/testqgslinestyledialog.cpp
  140. +0 −24 tests/src/gui/testqgslinestylewidget.cpp
  141. +0 −40 tests/src/gui/testqgsludialog.cpp
  142. +0 −264 tests/src/gui/testqgsmapcanvas.cpp
  143. +0 −52 tests/src/gui/testqgsmapcanvasitem.cpp
  144. +0 −36 tests/src/gui/testqgsmapcanvasmap.cpp
  145. +0 −160 tests/src/gui/testqgsmaplayer.cpp
  146. +0 −60 tests/src/gui/testqgsmaplayerregistry.cpp
  147. +0 −68 tests/src/gui/testqgsmapoverviewcanvas.cpp
  148. +0 −52 tests/src/gui/testqgsmaprender.cpp
  149. +0 −44 tests/src/gui/testqgsmapserverexport.cpp
  150. +0 −44 tests/src/gui/testqgsmaptool.cpp
  151. +0 −48 tests/src/gui/testqgsmaptoolcapture.cpp
  152. +0 −52 tests/src/gui/testqgsmaptoolidentify.cpp
  153. +0 −36 tests/src/gui/testqgsmaptoolpan.cpp
  154. +0 −36 tests/src/gui/testqgsmaptoolselect.cpp
  155. +0 −56 tests/src/gui/testqgsmaptoolvertexedit.cpp
  156. +0 −36 tests/src/gui/testqgsmaptoolzoom.cpp
  157. +0 −44 tests/src/gui/testqgsmarkerdialog.cpp
  158. +0 −88 tests/src/gui/testqgsmeasure.cpp
  159. +0 −36 tests/src/gui/testqgsmessageviewer.cpp
  160. +0 −36 tests/src/gui/testqgsnewconnection.cpp
  161. +0 −32 tests/src/gui/testqgsnewhttpconnection.cpp
  162. +0 −52 tests/src/gui/testqgsoptions.cpp
  163. +0 −56 tests/src/gui/testqgspastetransformations.cpp
  164. +0 −32 tests/src/gui/testqgspatterndialog.cpp
  165. +0 −48 tests/src/gui/testqgspgquerybuilder.cpp
  166. +0 −36 tests/src/gui/testqgspluginmanager.cpp
  167. +0 −36 tests/src/gui/testqgspluginmetadata.cpp
  168. +0 −24 tests/src/gui/testqgspointstylewidget.cpp
  169. +0 −96 tests/src/gui/testqgsproject.cpp
  170. +0 −56 tests/src/gui/testqgsprojectproperties.cpp
  171. +0 −36 tests/src/gui/testqgsrasterlayerproperties.cpp
  172. +0 −52 tests/src/gui/testqgsrubberband.cpp
  173. +0 −44 tests/src/gui/testqgsrunprocess.cpp
  174. +0 −44 tests/src/gui/testqgssearchquerybuilder.cpp
  175. +0 −76 tests/src/gui/testqgsserversourceselect.cpp
  176. +0 −88 tests/src/gui/testqgssinglesymboldialog.cpp
  177. +0 −56 tests/src/gui/testqgssinglesymbolrenderer.cpp
  178. +0 −124 tests/src/gui/testqgsspatialrefsys.cpp
  179. +0 −40 tests/src/gui/testqgsuniquevaluedialog.cpp
  180. +0 −68 tests/src/gui/testqgsuniquevaluerenderer.cpp
  181. +0 −48 tests/src/gui/testqgsvectorfilewriter.cpp
  182. +0 −312 tests/src/gui/testqgsvectorlayer.cpp
  183. +0 −44 tests/src/gui/testqgsvectorlayerproperties.cpp
  184. +0 −24 tests/src/gui/testqgsvectorsymbologywidget.cpp
  185. +0 −44 tests/src/gui/testqgsvertexmarker.cpp
  186. +14 −0 tests/src/runtests.sh
  187. +14 −0 tools/mapserver_export/ms_export.py
  188. +14 −0 tools/mapserver_export/ms_main.cpp
  189. +14 −0 tools/mapserver_export/msexport.i
  190. +15 −0 tools/mapserver_export/test_export.py
@@ -3,11 +3,11 @@ Section: science
Priority: extra
Maintainer: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
Uploaders: Francesco Paolo Lovergine <frankie@debian.org>
Build-Depends: debhelper (>= 5.0.0), libgdal1-dev, libpq-dev,
Build-Depends: debhelper (>= 5.0.0), libgdal1-dev | libgdal1-1.3.2-dev , libpq-dev,
libgeos-dev (>= 2.0.1-1), dpatch, grass-dev, libsqlite3-dev, libgsl0-dev, proj, libexpat1-dev,
flex, bison, python-dev, cmake (>=2.4.3) , python-sip4-dev, python-qt4-dev,
sharutils, sip4 (>= 4.7), libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
libqt4-qt3support (>=4.2.0), libqt4-sql (>=4.2.0), python-qt4 (>=4.2.0), python-qt4-dev (>=4.2.0)
sharutils, sip4 (>= 4.4), libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0),
libqt4-qt3support (>=4.2.0), libqt4-sql (>=4.2.0), python-qt4 (>=4.0.0), python-qt4-dev (>=4.0.0)
Standards-Version: 3.7.2

Package: qgis
@@ -43,7 +43,7 @@ Description: QGIS Geographic Information System - shared library

Package: libqgis1-dev
Architecture: any
Depends: qgis (= ${Source-Version}), libgdal1-dev, libpq-dev | postgresql-dev, libgeos-dev (>= 2.0.1-1), grass-dev, libsqlite3-dev, libgsl0-dev, proj, libexpat1-dev, libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0), libqt4-qt3support (>=4.2.0), libqt4-sql (>=4.2.0), python-qt4 (>=4.2.0), python-qt4-dev (>=4.2.0), qt4-designer (>=4.2.0)
Depends: qgis (= ${Source-Version}), libgdal1-dev | libgdal1-1.3.2-dev , libpq-dev | postgresql-dev, libgeos-dev (>= 2.0.1-1), grass-dev, libsqlite3-dev, libgsl0-dev, proj, libexpat1-dev, libqt4-core (>=4.2.0), libqt4-dev (>=4.2.0), libqt4-gui (>=4.2.0), libqt4-qt3support (>=4.2.0), libqt4-sql (>=4.2.0), python-qt4 (>=4.0.0), python-qt4-dev (>=4.0.0), qt4-designer (>=4.2.0)
Provides: libqgis-dev
Conflicts: libqgis-dev, qgis-dev
Replaces: qgis-dev
@@ -60,7 +60,7 @@ Description: QGIS Geographic Information System - development files

Package: qgis-plugin-grass
Architecture: any
Depends: qgis (= ${Source-Version}), libgdal1-1.4.0-grass
Depends: qgis (= ${Source-Version}), libgdal1-1.4.0-grass | libgdal1-1.3.2-grass
Description: Plugin for accessing GRASS data from QGIS
This plugin enables a GRASS data access toolbox in the QGIS
geographic data viewer.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -29,7 +29,10 @@ CMakeCache.txt: CMakeLists.txt
dh_testdir
# Add here commands to configure the package.
uudecode -o $(CURDIR)/src/plugins/georeferencer/pencil.png $(CURDIR)/debian/pencil.uu
cmake -D CMAKE_INSTALL_PREFIX=/usr -D GDAL_INCLUDE_DIR=/usr/include/gdal .
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D GDAL_INCLUDE_DIR=/usr/include/gdal \
-D GDAL_LIBRARY=/usr/lib/libgdal1.3.2.so \
.

build: patch build-stamp

@@ -674,7 +674,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)

//find out the last used filter
QSettings myQSettings; // where we keep last used filter in persistant state
QString myLastUsedFormat = myQSettings.readEntry("/UI/lastSaveAsImageFormat", "PNG" ); //<- BUG #729 is probably here
QString myLastUsedFormat = myQSettings.readEntry("/UI/lastSaveAsImageFormat", "png" );
QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsImageFile","qgis.png");
QFileInfo file(myLastUsedFile);

@@ -686,6 +686,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
{
QString myFormat=QString(QImageWriter::supportedImageFormats().at( myCounterInt ));
QString myFilter = myFormat + " " + tr("format") + " (*." + myFormat.lower() + " *." + myFormat.upper() + ")";

if ( myCounterInt > 0 ) myFilters += ";;";
myFilters += myFilter;
myFilterMap[myFilter] = myFormat;
@@ -32,8 +32,10 @@
#include <cmath>

QgsComposerMap::QgsComposerMap ( QgsComposition *composition, int id, int x, int y, int width, int height )
: QWidget(), QGraphicsRectItem(x,y,width,height,0)
: QWidget(), QGraphicsRectItem(0,0,width,height,0)
{
std::cout << "QgsComposerMap::QgsComposerMap()" << std::endl;

setupUi(this);

mComposition = composition;
@@ -47,6 +49,7 @@ QgsComposerMap::QgsComposerMap ( QgsComposition *composition, int id, int x, int
// Add to scene
mComposition->canvas()->addItem(this);

QGraphicsRectItem::setPos(x, y);
QGraphicsRectItem::show();

writeSettings();
@@ -48,7 +48,10 @@ QgsComposerVectorLegend::QgsComposerVectorLegend ( QgsComposition *composition,

init();

// Font and pen
// Font and pen
if(fontSize < 6){
fontSize = 6;
}
mFont.setPointSize ( fontSize );

// Set map to the first available if any
@@ -160,6 +163,7 @@ QRectF QgsComposerVectorLegend::render ( QPainter *p )
}

std::cout << "mComposition->scale() = " << mComposition->scale() << std::endl;

// Font size in canvas units
float titleSize = 25.4 * mComposition->scale() * mTitleFont.pointSizeFloat() / 72;
float sectionSize = 25.4 * mComposition->scale() * mSectionFont.pointSizeFloat() / 72;
@@ -393,7 +397,7 @@ std::cout << "widthScale: " << widthScale << std::endl;
painter->drawLine ( mMargin, localHeight+mSymbolHeight/2,
mMargin+mSymbolWidth, localHeight+mSymbolHeight/2 );
} else if ( vector->vectorType() == QGis::Polygon ) {
pen.setWidth(0); //use a cosmetic pen to outline the fill box
//pen.setWidth(0); //use a cosmetic pen to outline the fill box
pen.setCapStyle(Qt::FlatCap);
painter->setPen ( pen );
painter->drawRect ( mMargin, localHeight, mSymbolWidth, mSymbolHeight );
@@ -1356,6 +1356,22 @@ void QgsLegend::updateOverview()
mMapCanvas->updateOverview();
}

void QgsLegend::setOverviewAllLayers(bool inOverview)
{
QTreeWidgetItem* theItem = firstItem();
while(theItem)
{
QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>(theItem);
if(llf)
{
llf->setInOverview(inOverview);
}
theItem = nextItem(theItem);
}
updateMapCanvasLayerSet();
updateOverview();
}

std::deque<QString> QgsLegend::layerIDs()
{
std::deque<QString> layers;
@@ -147,6 +147,9 @@ class QgsLegend : public QTreeWidget
/**Updates overview*/
void updateOverview();

/**Show/remove all layer in/from overview*/
void setOverviewAllLayers(bool inOverview);

/**Adds an entry to mPixmapWidthValues*/
void addPixmapWidthValue(int width);

@@ -2355,7 +2355,7 @@ findMissingFile_( QString const & fileFilters, QDomNode & layerNode )

QStringList selectedFiles;
QString enc;
QString title( QObject::trUtf8("Open an OGR Supported Layer") );
QString title( QObject::tr("Where is '") + originalDataSource.fileName() + "'? (" + QObject::tr("original location: ") + originalDataSource.absoluteFilePath() + ")");

openFilesRememberingFilter_(memoryQualifier,
myFileFilters,
@@ -3219,40 +3219,26 @@ void QgisApp::saveMapAsImage(QString theImageFileNameQString, QPixmap * theQPixm
//reimplements method from base (gui) class
void QgisApp::addAllToOverview()
{
// TODO: move to legend
/*
std::map<QString, QgsMapLayer *> myMapLayers = QgsMapLayerRegistry::instance()->mapLayers();
std::map<QString, QgsMapLayer *>::iterator myMapIterator;
for ( myMapIterator = myMapLayers.begin(); myMapIterator != myMapLayers.end(); ++myMapIterator )
{
QgsMapLayer * myMapLayer = myMapIterator->second;
myMapLayer->inOverview(true); // won't do anything if already in overview
}
mMapCanvas->updateOverview();
if(mMapLegend)
{
mMapLegend->setOverviewAllLayers(true);
}

// notify the project we've made a change
QgsProject::instance()->dirty(true);
*/
}

//reimplements method from base (gui) class
void QgisApp::removeAllFromOverview()
{
// TODO: move to legend
/*
std::map<QString, QgsMapLayer *> myMapLayers = QgsMapLayerRegistry::instance()->mapLayers();
std::map<QString, QgsMapLayer *>::iterator myMapIterator;
for ( myMapIterator = myMapLayers.begin(); myMapIterator != myMapLayers.end(); ++myMapIterator )
{
QgsMapLayer * myMapLayer = myMapIterator->second;
myMapLayer->inOverview(false);
}
mMapCanvas->updateOverview();
if(mMapLegend)
{
mMapLegend->setOverviewAllLayers(false);
}

// notify the project we've made a change
QgsProject::instance()->dirty(true);
*/
} // QgisApp::removeAllFromOverview()
}


//reimplements method from base (gui) class
@@ -426,10 +426,29 @@ bool QgsAttributeTable::commitChanges(QgsVectorLayer* layer)
{
deletedIds.insert(provider->indexFromFieldName(*it));
}

QgsChangedAttributesMap attributeChanges; //convert mChangedValues to QgsChangedAttributesMap
int fieldIndex;

QMap<int, QMap<QString, QString> >::const_iterator att_it = mChangedValues.constBegin();
for(; att_it != mChangedValues.constEnd(); ++att_it)
{
QgsAttributeMap newAttMap;
QMap<QString, QString>::const_iterator record_it = att_it->constBegin();
for(; record_it != att_it->constEnd(); ++record_it)
{
fieldIndex = provider->indexFromFieldName(record_it.key());
if(fieldIndex != -1)
{
newAttMap.insert(fieldIndex, record_it.value());
}
}
attributeChanges.insert(att_it.key(), newAttMap);
}

isSuccessful = layer->commitAttributeChanges(deletedIds,
mAddedAttributes,
mChangedValues);
attributeChanges);
}
}

@@ -528,52 +547,23 @@ void QgsAttributeTable::putFeatureInTable(int row, QgsFeature& fet)
}
}

int QgsAttributeTable::colIndexFromFieldIndex(int fieldId)
{
int colIndex = 1; // index 0 is feature ID
QgsFieldMap::const_iterator it;
for (it = mFields.begin(); it != mFields.end(); ++it, ++colIndex)
{
if (it.key() == fieldId)
return colIndex;
}
return -1;
}

int QgsAttributeTable::fieldIndexFromColIndex(int colIndex)
{
colIndex--; // first one is feature ID
QgsFieldMap::const_iterator it;
for (it = mFields.begin(); it != mFields.end(); ++it, --colIndex)
{
if (colIndex == 0)
return it.key();
}
return -1;
}

void QgsAttributeTable::storeChangedValue(int row, int column)
{
//id column is not editable
if(column>0)
//id column is not editable
if(column>0)
{
//find feature id
int id=text(row,0).toInt();
int field = fieldIndexFromColIndex(column);

QgsDebugMsg("feature id: " + QString::number(id));
QgsDebugMsg("attribute: " + QString::number(field) + ": " + mFields[field].name());

// add empty map for feature if doesn't exist
if (!mChangedValues.contains(id))
{
mChangedValues.insert(id, QgsAttributeMap());
}

mChangedValues[id].insert(field, QVariant(text(row,column)) );

QgsDebugMsg("value: " + text(row,column));
mEdited=true;
//find feature id
int id=text(row,0).toInt();
QString field = horizontalHeader()->label(column);

// add empty map for feature if doesn't exist
if (!mChangedValues.contains(id))
{
mChangedValues.insert(id, QMap<QString, QString>());
}

mChangedValues[id].insert(field, text(row,column));
mEdited=true;
}
}

@@ -133,7 +133,8 @@ class QgsAttributeTable:public Q3Table
QSet<QString> mDeletedAttributes;
/**Nested map containing the changed attribute values. The int is the feature id,
the first QString the attribute name and the second QString the new value*/
QgsChangedAttributesMap mChangedValues;
QMap<int, QMap<QString, QString> > mChangedValues;

/**Stors the numbers of the last selected rows. This is used to check for selection changes before emit repaintRequested()*/
std::set<int> mLastSelectedRows;

@@ -154,11 +155,6 @@ class QgsAttributeTable:public Q3Table
/**This function compares the current selection and the selection of the last repaint. Returns true if there are differences in the selection.
Also, mLastSelectedRows is updated*/
bool checkSelectionChanges();

/** returns column index for field index or -1 on invalid field index */
int colIndexFromFieldIndex(int fieldId);
/** returns field index for a column or -1 when on invalid column */
int fieldIndexFromColIndex(int colIndex);

signals:

@@ -1,14 +1,21 @@
//
// C++ Implementation: qgscustomprojectiondialog
//
// Description:
//
//
// Author: Tim Sutton tim@linfiniti.com, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
/***************************************************************************
qgscustomprojectiondialog.cpp
-------------------
begin : 2005
copyright : (C) 2005 by Tim Sutton
email : tim@linfiniti.com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgscustomprojectiondialog.h"

//qgis includes
@@ -1,14 +1,20 @@
//
// C++ Interface: qgscustomprojectiondialog
//
// Description:
//
//
// Author: Tim Sutton tim@linfiniti.com, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
/***************************************************************************
qgscustomprojectiondialog.h
-------------------
begin : 2005
copyright : (C) 2005 by Tim Sutton
email : tim@linfiniti.com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSCUSTOMPROJECTIONDIALOG_H
#define QGSCUSTOMPROJECTIONDIALOG_H

0 comments on commit b41ce99

Please sign in to comment.