Erik Grinaker avatar Erik Grinaker committed fe71b6d

fix crashes in applet and with drag/drop on 64-bit systems

Comments (0)

Files changed (4)

 
 	* added MyPasswordSafe import/export
 
+	* fix crashes in applet and with drag/drop on 64-bit systems
+
 2005-08-17  Erik Grinaker <erikg@codepoet.no>
 
 	* default lock timeout for applet set to 10 minutes
 
 Bugfixes:
 - fix crash when searching with non-Unicode locale
+- fix crashes in applet and with drag/drop on 64-bit systems
 - encode data as Unicode when loading from files
 - fix incorrect magic string in MIME-type entry
 - set correct app version number in datafile header

src/revelation-applet.in

 		self.locktimer.reset()
 
 		# from gnome 2.10, the panel doesn't receive focus when clicked
+		# (the OverflowError exception is a workaround for what I suspect
+		# is a pygtk bug - see pygtk bug #300012)
 		if data.button == 1 and hasattr(gnomemisc, "panel_applet_request_focus") == True:
-			gnomemisc.panel_applet_request_focus(self.applet, long(data.time))
+			try:
+				gnomemisc.panel_applet_request_focus(self.applet, long(data.time))
+
+			except OverflowError:
+				gnomemisc.panel_applet_request_focus(self.applet, 0L)
 
 
 	def __cb_file_autolock(self, widget, data = None):

src/revelation.in

 		destpath = self.entrystore.get_path(destiter)
 
 		# avoid drops to current iter or descentants
+		# (the OverflowError exceptions are basically workarounds
+		# for a suspected pygtk bug - see bug ¤300012)
 		for sourceiter in sourceiters:
 			sourcepath = self.entrystore.get_path(sourceiter)
 
 			if self.entrystore.is_ancestor(sourceiter, destiter) == True or sourcepath == destpath:
-				context.finish(False, False, time)
+				try:
+					context.finish(False, False, long(time))
+
+				except OverflowError:
+					context.finish(False, False, 0L)
+
 				return
 
 			elif pos == gtk.TREE_VIEW_DROP_BEFORE and sourcepath[:-1] == destpath[:-1] and sourcepath[-1] == destpath[-1] - 1:
-				context.finish(False, False, time)
+				try:
+					context.finish(False, False, long(time))
+
+				except OverflowError:
+					context.finish(False, False, 0L)
+
 				return
 
 			elif pos == gtk.TREE_VIEW_DROP_AFTER and sourcepath[:-1] == destpath[:-1] and sourcepath[-1] == destpath[-1] + 1:
-				context.finish(False, False, time)
+				try:
+					context.finish(False, False, long(time))
+
+				except OverflowError:
+					context.finish(False, False, 0L)
+
 				return
 
 
 			sibling = self.entrystore.get_iter(sibpath)
 
 		self.entry_move(sourceiters, parent, sibling)
-		context.finish(True, True, time)
+
+		try:
+			context.finish(False, False, long(time))
+
+		except OverflowError:
+			context.finish(False, False, 0L)
 
 
 	def __cb_tree_keypress(self, widget, data = None):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.