Package: zim / 0.65-4

reload-pages.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Description: Do not cache the content of pages
 Every time that we load page in the window, flush the cache
 before to ensure we get the latest copy in case it has been
 externally modified (for example through a file sharing service
 like Owncloud or Dropbox).
Author: Roland Mas <lolando@debian.org>
Bug: https://bugs.launchpad.net/zim/+bug/792058
Bug-Debian: https://bugs.debian.org/799303

--- a/zim/gui/__init__.py
+++ b/zim/gui/__init__.py
@@ -3198,6 +3198,7 @@ class OpenPageDialog(Dialog):
 	def do_response_ok(self):
 		path = self.form['page']
 		if path:
+			self.ui.notebook.flush_page_cache(path)
 			self.ui.open_page(path)
 			return True
 		else:
@@ -3310,6 +3311,7 @@ class ImportPageDialog(FileDialog):
 
 		page.parse('wiki', file.readlines())
 		self.ui.notebook.store_page(page)
+		self.ui.notebook.flush_page_cache(page)
 		self.ui.open_page(page)
 		return True
 
--- a/zim/gui/pageindex.py
+++ b/zim/gui/pageindex.py
@@ -549,6 +549,7 @@ class PageTreeView(BrowserTreeView):
 			self.emit('page-activated', path)
 
 	def do_page_activated(self, path):
+		self.ui.notebook.flush_page_cache(path)
 		self.ui.open_page(path)
 
 	def do_key_press_event(self, event):
--- a/zim/gui/pageview.py
+++ b/zim/gui/pageview.py
@@ -5332,6 +5332,7 @@ class PageView(gtk.VBox):
 				if new_window:
 					self.ui.open_new_window(path)
 				else:
+					self.ui.notebook.flush_page_cache(path)
 					self.ui.open_page(path)
 			elif type == 'file':
 				path = self.ui.notebook.resolve_file(href, self.page)
--- a/zim/gui/pathbar.py
+++ b/zim/gui/pathbar.py
@@ -464,6 +464,7 @@ class PathBar(ScrolledHBox):
 			set_active(self._selected, True)
 
 	def on_button_clicked(self, button):
+		self.ui.notebook.flush_page_cache(button.zim_path)
 		self.ui.open_page(button.zim_path)
 
 	def do_button_release_event(self, button, event):
--- a/zim/gui/recentchangesdialog.py
+++ b/zim/gui/recentchangesdialog.py
@@ -91,5 +91,6 @@ class RecentChangesTreeView(BrowserTreeV
 
 	def _do_open_page(self, view, path, col):
 		page = Path( self.get_model()[path][self.NAME_COL].decode('utf-8') )
+		self.ui.notebook.flush_page_cache(page)
 		self.ui.open_page(page)
 
--- a/zim/gui/searchdialog.py
+++ b/zim/gui/searchdialog.py
@@ -221,6 +221,7 @@ class SearchResultsTreeView(BrowserTreeV
 
 	def _do_open_page(self, view, path, col):
 		page = Path( self.get_model()[path][0].decode('utf-8') )
+		self.ui.notebook.flush_page_cache(page)
 		self.ui.open_page(page)
 
 		# Popup find dialog with same query