dfaure requested changes to this revision.
dfaure added a comment.
This revision now requires changes to proceed.


  The URL changes twice because you make it change twice ;)
  
  But that can lead to the application updating stuff twice, which doesn't seem 
very optimal. (actions getting disabled and then re-enabled, title bar 
flickering, stuff like that).
  
  Ideally it should change only once, either from oldURL to newURL, or from 
oldURL to QUrl() if loading failed.
  
  This might require a special bool checked by closeUrl(), since we can't just 
split closeUrl (because it's public *and* virtual - bad design practice - I was 
young).
  
  (if it wasn't virtual, then moving the code into a closeUrlImpl and having 
the public closeUrl() do closeUrlImpl()+setUrl(QUrl()) would be the best 
solution, but we can't do that since openUrl has to call the virtual closeUrl, 
not just closeUrlImpl. So I can't think of another solution than a bool member 
set by openUrl and checked by closeUrl to skip the setUrl(QUrl()) until after 
we try to open the new URL).

REVISION DETAIL
  https://phabricator.kde.org/D6856

To: elvisangelaccio, dfaure, #ktexteditor, #kate, #kdevelop
Cc: cullmann, #frameworks

Reply via email to