[gnue] r10255 - in trunk/gnue-common: . src/datasources/drivers/Base

[email protected] Thu, 2 Dec 2010 16:24:56 -0600 (CST)
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: reinhard
Date: 2010-12-02 16:24:56 -0600 (Thu, 02 Dec 2010)
New Revision: 10255

Modified:
   trunk/gnue-common/
   trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
Log:
When moving out of a freshly inserted record, the empty record should be
discarded. Fixed this for cases when the record pointer was moved to "no
record".



Property changes on: trunk/gnue-common
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-11-30 15:23:56.974999905 +0100
committer: Reinhard M=C3=BCller <[email protected]>
properties:=20
	branch-nick: common

   + timestamp: 2010-12-02 00:52:01.973999977 +0100
committer: Reinhard M=C3=BCller <[email protected]>
properties:=20
	branch-nick: common

Name: bzr:file-ids
   - src/datasources/drivers/Base/Behavior.py	7560@3a364389-8fce-0310-8f1=
1-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2Fdrivers%2FBase%2FB=
ehavior.py

   + src/datasources/drivers/Base/ResultSet.py	4887@3a364389-8fce-0310-8f=
11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2Fdrivers%2FBase%2F=
ResultSet.py

Name: bzr:revision-id:v4
   - 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]
3123 [email protected]
3124 [email protected]
3125 [email protected]
3126 [email protected]
3127 [email protected]
3128 [email protected]
3129 [email protected]
3130 [email protected]
3131 [email protected]
3132 [email protected]
3133 [email protected]
3134 [email protected]
3135 [email protected]
3136 [email protected]
3137 [email protected]
3138 [email protected]
3139 [email protected]
3140 [email protected]
3141 [email protected]

   + 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]
3123 [email protected]
3124 [email protected]
3125 [email protected]
3126 [email protected]
3127 [email protected]
3128 [email protected]
3129 [email protected]
3130 [email protected]
3131 [email protected]
3132 [email protected]
3133 [email protected]
3134 [email protected]
3135 [email protected]
3136 [email protected]
3137 [email protected]
3138 [email protected]
3139 [email protected]
3140 [email protected]
3141 [email protected]
3142 [email protected]

Name: bzr:text-parents
   - src/datasources/drivers/Base/Behavior.py	svn-v3-single1-dHJ1bmsvZ251=
ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:995=
4

   + src/datasources/drivers/Base/ResultSet.py	reinhard.mueller@bytewise.=
at-20101028152619-p6ytgkke9zw38o7a


Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py	2010-12-0=
2 20:47:51 UTC (rev 10254)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py	2010-12-0=
2 22:24:56 UTC (rev 10255)
@@ -925,24 +925,28 @@
         else:
             self.current =3D self.__cached_records[self.__current_index]
=20
-        # If the current record has *really* changed (this method can be=
 called
-        # for non-changing records after requery or merge) to a new curr=
ent
-        # record, bring all detail records in sync.
+        # The following lines are only executed if the current record ha=
s
+        # *really* changed (this method can be called for non-changing r=
ecords
+        # after requery or merge) to a new current record.
         if self.current !=3D old_current:
+
+            # If the cursor moved out of an empty record, throw it away.
+            if old_current and old_current.isEmpty():
+                if old_current in self.__cached_records:
+                    index =3D self.__cached_records.index(old_current)
+                    self.__remove_record(index)
+
+            # Bring all detail records in sync.
             if self.current is not None:
-                if old_current and old_current.isEmpty():
-                    # If the cursor moved out of an empty record, throw =
it away
-                    if old_current in self.__cached_records:
-                        index =3D self.__cached_records.index(old_curren=
t)
-                        self.__remove_record(index)
                 self.current._activate()
             else:
                 # Pointer moved to "no record": Create empty detail resu=
ltsets.
                 for detail_ds in self.__details.keys():
                     detail_ds.clearResultSet()
=20
-        if send_event and self.__eventController is not None:
-            self.__eventController.dispatchEvent('dsCursorMoved')
+            # Send event to update UI.
+            if send_event and self.__eventController is not None:
+                self.__eventController.dispatchEvent('dsCursorMoved')
=20
=20
     # ------------------------------------------------------------------=
-------
@@ -1010,9 +1014,10 @@
         if index <=3D self.__current_index:
             self.__current_index -=3D 1
=20
-        # ... but don't move below 0 unless there is *really* no record =
left
-        if self.__current_index < 0 and self.__record_count:
-            self.__current_index =3D 0
+            # ... but don't move below 0 unless there is *really* no rec=
ord
+            # left.
+            if self.__current_index < 0 and self.__record_count:
+                self.__current_index =3D 0
=20
=20
     # ------------------------------------------------------------------=
-------