135 Commits

Author SHA1 Message Date
jef
f8277d9154 use ctid as temporary feature id in postgres provider if there is no other primary key available
git-svn-id: http://svn.osgeo.org/qgis/trunk@10474 c8812cc2-4d05-0410-92ff-de0c093fc19c
2009-04-05 10:51:35 +00:00
jef
9addfdbbd2 fix feature count in postgres provider
git-svn-id: http://svn.osgeo.org/qgis/trunk@10426 c8812cc2-4d05-0410-92ff-de0c093fc19c
2009-03-27 17:40:08 +00:00
cfarmer
539ee46f24 Ensures that features (properly) fetched from provider (via nextFeature)
are set as valid
Ensures that only valid features are rendered on the map canvas


git-svn-id: http://svn.osgeo.org/qgis/trunk@10272 c8812cc2-4d05-0410-92ff-de0c093fc19c
2009-03-11 23:45:23 +00:00
jef
72cfd51023 string translation update:
- collect concatenated strings into one string to get more translation context (foo + tr(" bar ") + baz => tr("%1 bar %2)").arg( foo ).arg( bar) 
- don't qualify tr(), when not necessary (QObject::tr => tr)
- remove QString cast/ctor where not necessary ( QString( tr(...) ) => tr (...) )
- add numerusforms where applicable
- fix QgsGrassEdit::setCanvasPrompt (was setCanvasPropmt) and more typos
- remove plugin template strings from coordinate capture plugin
- add Q_OBJECT to classes using QObject::tr (fixes lupdate warnings)



git-svn-id: http://svn.osgeo.org/qgis/trunk@9897 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-12-26 21:07:03 +00:00
jef
6fbda00825 automatic indentation update (r9447-r9780)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9781 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-12-13 11:07:45 +00:00
wonder
1be590bf14 Allow opening layers with M dimension, but explicitly disable editation of geometries (would corrupt M dimension) and creation of new features (would keep invalid M dimension).
git-svn-id: http://svn.osgeo.org/qgis/trunk@9709 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-11-25 23:42:35 +00:00
jef
bb63eac685 postgres provider update:
- handle secondary geometry columns as text in EWKT.
- improve handling of errornous queries.
- kudos to Stefanie Tellex for the initial patch



git-svn-id: http://svn.osgeo.org/qgis/trunk@9619 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-11-10 19:40:00 +00:00
timlinux
b40ceb2d62 API cleanups for QgsRect that got overlooked...
git-svn-id: http://svn.osgeo.org/qgis/trunk@9605 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-11-09 00:14:12 +00:00
timlinux
67fdbb5efb Changed begin() to rewind() on provider interface
git-svn-id: http://svn.osgeo.org/qgis/trunk@9582 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-11-08 00:49:59 +00:00
timlinux
bb9c89abbb qgsprovidercountcalcevent api cleanups
git-svn-id: http://svn.osgeo.org/qgis/trunk@9538 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-24 22:12:40 +00:00
timlinux
394993ea8f API cleanups for qgsgeometry
git-svn-id: http://svn.osgeo.org/qgis/trunk@9515 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-22 07:31:05 +00:00
timlinux
314e8e6065 Api cleanups for qgsfeature
git-svn-id: http://svn.osgeo.org/qgis/trunk@9506 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-20 21:44:15 +00:00
timlinux
9884ef0758 Remove abbreviation of connectionInfo
git-svn-id: http://svn.osgeo.org/qgis/trunk@9502 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-20 20:24:36 +00:00
timlinux
dcfedaad21 remove get prefix for crs accessor
git-svn-id: http://svn.osgeo.org/qgis/trunk@9501 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-20 20:08:43 +00:00
jef
8094f1d4c6 hackfest commit from timlinux:
- more API cleanups
- single click (instead of drag) to select a feature (fixes #1154)
- fixes for topological editing


git-svn-id: http://svn.osgeo.org/qgis/trunk@9471 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-10 20:02:22 +00:00
timlinux
3072d71114 API cleanups: getNextFeature becomes nextFeature, getFeatureAtId becomes featureAtId, getDefaultValue becomes defaultValue, allAttributeList becomes attributeIndexes and reset becomes begin on data provider api.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9449 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-07 07:36:24 +00:00
timlinux
107a21bfd0 API Cleanup: Use begin() instead of reset() to move to start of selected features
git-svn-id: http://svn.osgeo.org/qgis/trunk@9447 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-06 21:11:54 +00:00
jef
099fe8f618 postgres provider: use default values for primary key
git-svn-id: http://svn.osgeo.org/qgis/trunk@9382 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-09-23 06:28:35 +00:00
jef
ef10609f17 vector bugfixes
- QgsVectorLayer::commitChanges: handle deleted added features
- QgsPostgresProvider:
  - update ids of added features only, when they were actually inserted
  - deallocate prepared statements after rollback (fixes #1328)



git-svn-id: http://svn.osgeo.org/qgis/trunk@9381 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-09-23 05:42:44 +00:00
jef
e3cfb78796 vector provider update:
- rename maxValue to maximumValue
- rename getUniqueValues to uniqueValues and let it return a list
  of variants instead of strings.
- add protected convertValue to convert string values to attribute values
- update attribute dialog, continuous color dialog, graduated symbol dialog,
  unique value dialog, postgres provider and ogr provider accordingly
- fixes #1250



git-svn-id: http://svn.osgeo.org/qgis/trunk@9196 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-27 22:13:27 +00:00
jef
874b29b71f minor update (indentation, debug output, plenks)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9189 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-27 12:57:47 +00:00
jef
b9452c2dd8 postgres provider update
- track open cursors and commit transaction whenever no open cursors are left
- close cursor after immediately after feature retrieval (releases locks earlier)
- wrap postgres calls in Conn class
- introduce Result class to handle PQclear mostly transparently (fixes minor leaks)
- remove executeDbCommand method (duplicate of PQexecNR)
- introduce support for estimate_extents (fixes #582)
- introduce support for enum types (fixes #1210)



git-svn-id: http://svn.osgeo.org/qgis/trunk@9183 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-27 08:00:57 +00:00
ersts
dfcacb69a3 -Propogated updates for QgsRect setYMin/setYMax
git-svn-id: http://svn.osgeo.org/qgis/trunk@9177 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-26 20:47:53 +00:00
jef
4b46398bc4 astyle re-indentation & iostream=>QgsDebugMsg migration cleanup
git-svn-id: http://svn.osgeo.org/qgis/trunk@9138 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-23 21:37:31 +00:00
jef
120a61cabe various code cleanups by mloskot for GCC 4.1 (fixes #1239, #1240).
Inspired by it I also enabled pedantic mode for MSVC and cleaned
up some more warnings found by GCC 4.3 and MSVC.




git-svn-id: http://svn.osgeo.org/qgis/trunk@9133 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-23 14:06:01 +00:00
jef
31327f51fd Merged rest of composer branch (9087-9115)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9125 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-23 09:19:49 +00:00
jef
753a1c449e fix #1237
git-svn-id: http://svn.osgeo.org/qgis/trunk@9120 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-22 10:32:29 +00:00
timlinux
a4bd78c9f8 Refactor spatial reference system to coordinate reference system (finalise fix of ticket #15). Also updated some more core api docs / module assignments.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9108 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-21 21:11:56 +00:00
jef
f2cdcca6bc remove 'with hold' from postgres cursors
git-svn-id: http://svn.osgeo.org/qgis/trunk@9095 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-20 15:16:49 +00:00
jef
43278d720b handling vector data geometry and attribute updates refactored
QgsVectorLayer:
  - move attribute part of editing to vector layer class and unify with geometry handling:
    * remove commitAttributeChanges(), addedFeatures(), deletedFeatureIds(), changedAttributes()
      and replace with changeAttributeValue(), deleteFeature(), addAttribute()
      and deleteAttribute()
    * add pendingFields(), pendingAttributeList(), pendingFeatureCount()
    * emit signals on start editing and commit, change of attribute values, adding/deleting of
      attributes and layer or feature removal (currently used in the attribute table)
  - new commitErrors() method to query errors from commitChanges()
  - replaced featuresInRectangle with select/getNextFeature combo
  - edit types added to support more input widgets and input constraints

QgsFeature:
  - remove update aware ctor
  - unify geometry handling in ctors

QgsVectorDataProvider:
  - add QVariant::Type to supportNativeTypes()

QgisApp:
  - add instance() method to query QgisApp object
  - replace code at various place to use it instead of passing the pointer
    arround or searching it in the widget tree.
  - move toggleEditing() code from the legend here

QgsAttributeTable/QgsAttributeTableDisplay:
  - move attribute table creation legend here
  - make attribute table dockable (from Tim)
  - most editing logic moved to QgsVectorLayer
  - adding/deleting attributes moved to QgsVectorLayerProperties

QgsIdentifyResults:
  - add support for attribute editing when it edit mode

QgsVectorLayerProperties:
  add a new tab to show attribute list:
    * start/stop editing
    * add/delete attributes
    * assign edit type to attributes (unique values, value map, ranges)

QgsAttributeDialog:
  add support for attribute edit types:
   * selection from unique value render classes (combobox)
   * selection from unique values of existing features (combobox or line edits with completion)
   * spinboxes for ranges

QgsPostgresProvider:
 - use read-only connection for cursors and read-write connection for updates
 - updated native types

QgsOgrProvider:
 - remove unused references to GEOS geometry factory
 - updated native types


git-svn-id: http://svn.osgeo.org/qgis/trunk@9092 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-20 12:15:14 +00:00
telwertowski
784ce74d40 Remove use of Qt3 support inline routines which redirect old Qt3 names to new Qt4 names. Remove USE_QT3SUPPORT from top-level CMakeLists and add it to GRASS provider/plugin CMakeLists so that all use of Qt3 names and libraries is limited to these two directories.
git-svn-id: http://svn.osgeo.org/qgis/trunk@8630 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-06-09 03:30:50 +00:00
jef
42b8445ba9 update feature id of added features in OGR and PostgrSQL provider
git-svn-id: http://svn.osgeo.org/qgis/trunk@8583 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-06-03 14:41:04 +00:00
telwertowski
21708a56fb Remove all use of Qt3 compatibiliy routines except for the GRASS provider/plugin. Automatic casts of QString to char* have also been removed for compatibility with Qt/Mac-Cocoa (64-bit).
git-svn-id: http://svn.osgeo.org/qgis/trunk@8406 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-05-07 05:15:58 +00:00
jef
38fc0b9e77 fix for #130:
- skip type check for unchanged defaults in QgsAttributDialog
- don't replace NULL default value with empty string


git-svn-id: http://svn.osgeo.org/qgis/trunk@8390 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-04-30 20:15:02 +00:00
jef
518a97b880 fix #1052
git-svn-id: http://svn.osgeo.org/qgis/trunk@8389 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-04-30 19:04:20 +00:00
jef
adaa577fd4 postgres provider update
- handle PQsendQuery in one getNextFeature run (fixes nested iteration of
  cursors with connection pooling)
- beautify DELETE and ALTER TABLE statements


git-svn-id: http://svn.osgeo.org/qgis/trunk@8313 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-04-02 22:35:33 +00:00
jef
509223bc2f postgres provider update
- remove some unnecessary includes
- add private PQexec method with additional debug output
- update all changed attributes of a feature at once
- fix quoting and beautify creation of SQL statements
- replace assertion on unexpected field types with useful debug output and
    consider values as NULL


git-svn-id: http://svn.osgeo.org/qgis/trunk@8307 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-31 19:02:58 +00:00
jef
a0c1772d4c yet another postgres provider update
- apply patch #1009 from Steven Mizuno. Thanks.
- remove column name and use of PQfnumber for cursors


git-svn-id: http://svn.osgeo.org/qgis/trunk@8292 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-28 11:02:05 +00:00
jef
fa696cdabb another postgres provider update:
- make declareCursor and getFeature private
- there's no need to track column names in cursors
  (which contained a bug triggering #962 again and more)
- introduce private method field(index) that verifies that
  the index in valid or throws an exception.
- use that in public methods that get indexes from
  outside (minValue, maxValue, uniqueValues...)


git-svn-id: http://svn.osgeo.org/qgis/trunk@8290 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-27 23:50:45 +00:00
jef
c598dc2783 More work on the postgres provider:
- put common code from select/getNextFeature and getFeatureById methods 
  to new declareCursor and getFeature methods
- unify type handling and support bool, arrays and time types
  (fixes #1009)
- ignore columns not explicitly supported (might apply to columns
  previously supported implicitly; please file a bug if you run into
  one)
- fixes a unreported problem with getFeatureById returning only NULL
  attributes.

Please test!


git-svn-id: http://svn.osgeo.org/qgis/trunk@8285 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-27 00:44:22 +00:00
jef
5eaa4a8c9d reintroduce connection pooling, but use cursors independantly of transactions
by declaring them "WITH HOLD" and "CLOSE" them when done.


git-svn-id: http://svn.osgeo.org/qgis/trunk@8273 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-25 21:24:56 +00:00
jef
9893f4af87 fix #1007
git-svn-id: http://svn.osgeo.org/qgis/trunk@8267 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-25 17:55:34 +00:00
jef
af1b88d847 fix #1001 introduced with r8233
git-svn-id: http://svn.osgeo.org/qgis/trunk@8248 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-19 16:40:17 +00:00
jef
d8460108ff - add getUniqueValues method to QgsVectorDataProvider
- implement getUniqueValues in QgsPostgresProvider (fixes #399)
 - implement getUniqueValues, minValue and maxValue in OgsOgrProvider
 - use getUniqueValues in QgsUniqueValueDialog
- update QgsPostgresProvider::storageType interface (fixes #995)
  (applied patch from Steven Mizuno, thanks again)


git-svn-id: http://svn.osgeo.org/qgis/trunk@8233 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-16 16:52:11 +00:00
jef
ee95b957e1 fix gcc compile error
git-svn-id: http://svn.osgeo.org/qgis/trunk@8219 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-13 21:17:13 +00:00
jef
93284cccf3 fix compile error
git-svn-id: http://svn.osgeo.org/qgis/trunk@8218 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-13 19:48:19 +00:00
jef
f86a0afa49 - Support NULL database values (fixes #987 and #988)
- check for NULL values on load
  - show "NULL" in attribute table and identify results
  - support entry of "NULL" in attribute table or dialog
- free result of PQexec in postgres provider (fixes memory leaks)


git-svn-id: http://svn.osgeo.org/qgis/trunk@8217 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-13 18:43:35 +00:00
jef
2ea7615b9c - applied patch from Steven Mizuno from #964. Nice work. Thank you very much.
- better privilege handling (fixes #955)
  - better postgis i18n (unicode handling, identifier quotation)
  - password saving fixed
  - support for int8 type added
- let provider capabilities follow table privileges (fixes #976)
- use prepared statements for adding features (fixed #977)
- remove connection pooling (fixes cursor problem)
- clear attribute list on loadFields (fixes #984)
- ignore bytea fields
- handle transactions/error reporting better
- some cleanups


git-svn-id: http://svn.osgeo.org/qgis/trunk@8213 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-03-12 21:02:40 +00:00
mhugent
1542231de3 Patch from smizuno to fix bug #954. Thanks!
git-svn-id: http://svn.osgeo.org/qgis/trunk@8172 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-02-21 16:21:43 +00:00
mhugent
b3e835e670 Fixed a memory leak in postgres provider (that was caused by my own modifications a week ago)
git-svn-id: http://svn.osgeo.org/qgis/trunk@8136 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-02-11 17:18:22 +00:00