Commits

Erik Grinaker committed 5706a9d

fixed a drag/drop undo crasher

Comments (0)

Files changed (4)

 
 ---------------[ xxxx-xx-xx : 0.4.0-pre2 ]---------------
 
+2005-02-01  Erik Grinaker <erikg@codepoet.no>
+
+	* fixed a crasher bug when undoing an entry drag/drop under
+	certain circumstances
+
 2005-01-29  Erik Grinaker <erikg@codepoet.no>
 
 	* check for fd.o shared MIME utils at build-time, and avoid
 
 Bugfixes:
 - allow entry drag'n'drop to folder directly before/after entry
+- crash when undoing an entry drag/drop under certain circumstances
 - place Revelation under Accessories in the GNOME menu (Utility category)
 - install mimetype icon into correct directory
 - run update-desktop-database on install, to register app for mimetype
 		if iter is None:
 			return None
 
-		return self.get_value(iter, COLUMN_ENTRY).copy()
+		e = self.get_value(iter, COLUMN_ENTRY)
+
+		if e is None:
+			return None
+
+		else:
+			return e.copy()
 
 
 	def get_iter(self, path):

src/revelation.in

 			prepath, postpath = list(prepath), list(postpath)
 
 			# adjust path if necessary
-			if postpath[:len(prepath) - 1] == prepath[:-1]:
+			if prepath[:-1] == postpath[:-1]:
 				if prepath[-1] <= postpath[len(prepath) - 1]:
 					postpath[len(prepath) - 1] += 1
 
 			prepath, postpath = list(prepath), list(postpath)
 
 			# adjust path if necessary
-			if postpath[:-1] == prepath[:-1]:
-				if prepath[-1] > postpath[len(prepath) - 1]:
-					prepath[-1] += 1
+			if postpath[:-1] == prepath[:len(postpath) - 1]:
+				if postpath[-1] <= prepath[len(postpath) - 1]:
+					prepath[len(postpath) - 1] += 1
 
 			newiter = self.entrystore.move_entry(
 				self.entrystore.get_iter(postpath),