227 @param fromfile filename of the first file (string) |
227 @param fromfile filename of the first file (string) |
228 @param tofile filename of the second file (string) |
228 @param tofile filename of the second file (string) |
229 @param fromfiledate modification time of the first file (string) |
229 @param fromfiledate modification time of the first file (string) |
230 @param tofiledate modification time of the second file (string) |
230 @param tofiledate modification time of the second file (string) |
231 """ |
231 """ |
232 paras = 0 |
232 for paras, line in enumerate( |
233 for line in unified_diff(a, b, fromfile, tofile, |
233 unified_diff(a, b, fromfile, tofile, fromfiledate, tofiledate) |
234 fromfiledate, tofiledate): |
234 ): |
235 self.__appendText(line) |
235 self.__appendText(line) |
236 paras += 1 |
|
237 if not (paras % self.updateInterval): |
236 if not (paras % self.updateInterval): |
238 QApplication.processEvents() |
237 QApplication.processEvents() |
239 |
238 |
240 if paras == 0: |
239 if self.contents.toPlainText().strip() == "": |
241 self.__appendText(self.tr('There is no difference.')) |
240 self.__appendText(self.tr('There is no difference.')) |
242 |
241 |
243 def __generateContextDiff(self, a, b, fromfile, tofile, |
242 def __generateContextDiff(self, a, b, fromfile, tofile, |
244 fromfiledate, tofiledate): |
243 fromfiledate, tofiledate): |
245 """ |
244 """ |
250 @param fromfile filename of the first file (string) |
249 @param fromfile filename of the first file (string) |
251 @param tofile filename of the second file (string) |
250 @param tofile filename of the second file (string) |
252 @param fromfiledate modification time of the first file (string) |
251 @param fromfiledate modification time of the first file (string) |
253 @param tofiledate modification time of the second file (string) |
252 @param tofiledate modification time of the second file (string) |
254 """ |
253 """ |
255 paras = 0 |
254 for paras, line in enumerate( |
256 for line in context_diff(a, b, fromfile, tofile, |
255 context_diff(a, b, fromfile, tofile, fromfiledate, tofiledate) |
257 fromfiledate, tofiledate): |
256 ): |
258 self.__appendText(line) |
257 self.__appendText(line) |
259 paras += 1 |
|
260 if not (paras % self.updateInterval): |
258 if not (paras % self.updateInterval): |
261 QApplication.processEvents() |
259 QApplication.processEvents() |
262 |
260 |
263 if paras == 0: |
261 if self.contents.toPlainText().strip() == "": |
264 self.__appendText(self.tr('There is no difference.')) |
262 self.__appendText(self.tr('There is no difference.')) |
265 |
263 |
266 def __fileChanged(self): |
264 def __fileChanged(self): |
267 """ |
265 """ |
268 Private slot to enable/disable the Compare button. |
266 Private slot to enable/disable the Compare button. |