Skip to content

Commit

Permalink
[ui] NodeLog: load file only if visible
Browse files Browse the repository at this point in the history
* when visibility changes, only load current file if log is actually visible
* set 'keepCursorPosition' default value to false in 'loadCurrentFile' method
  • Loading branch information
yann-lty committed Sep 6, 2018
1 parent 143b519 commit 3b656d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions meshroom/ui/qml/GraphEditor/NodeLog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ FocusScope {
property string currentFile: chunksLV.currentChunk ? chunksLV.currentChunk[currentItem.fileProperty] : ""
property string lastLoadedFile
property date lastModTime
onCurrentFileChanged: if(visible) loadCurrentFile(false)
onVisibleChanged: loadCurrentFile()
onCurrentFileChanged: if(visible) loadCurrentFile()
onVisibleChanged: if(visible) loadCurrentFile()


TabButton {
property string fileProperty: "logFile"
Expand Down Expand Up @@ -197,6 +198,8 @@ FocusScope {

function loadCurrentFile(keepCursorPosition)
{
if(keepCursorPosition == undefined)
keepCursorPosition = false
var xhr = new XMLHttpRequest;
xhr.open("GET", Filepath.stringToUrl(fileSelector.currentFile));
xhr.onreadystatechange = function() {
Expand Down

0 comments on commit 3b656d9

Please sign in to comment.