diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2017-10-06 11:14:48 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2017-10-10 13:38:53 +0000 |
commit | 9cbc5be241bcd8abb0cafc7a7e4b04746e9fe291 (patch) | |
tree | f991fb1974d0117b532e341c16c1dd917a9cefdd | |
parent | 378da67208fe3d7f48ff3e494f5fe5984af407aa (diff) |
Ensure that the last screenshot can be opened
Ensure that lastSavePath (now lastSaveUrl) is converted
to a URL correctly by constructing it from screenshotsDir
rather than screenshotsDirStr.
It was resolved as a qrc path previously.
Change-Id: I5ccdad6166b3927a149875b6ff89ff53c2440c05
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r-- | tests/manual/screenshots/screenshots.qml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/manual/screenshots/screenshots.qml b/tests/manual/screenshots/screenshots.qml index 126f02e3..2b031dce 100644 --- a/tests/manual/screenshots/screenshots.qml +++ b/tests/manual/screenshots/screenshots.qml @@ -61,7 +61,7 @@ ApplicationWindow { height: Math.max(600, loader.implicitHeight) property string currentFilePath - property string lastSavePath + property url lastSaveUrl Shortcut { sequence: "Ctrl+Q" @@ -139,8 +139,8 @@ ApplicationWindow { ToolButton { text: "Open Last Screenshot" focusPolicy: Qt.NoFocus - enabled: lastSavePath.length > 0 - onClicked: Qt.openUrlExternally(lastSavePath) + enabled: lastSaveUrl.toString().length > 0 + onClicked: Qt.openUrlExternally(lastSaveUrl) } Item { @@ -159,7 +159,7 @@ ApplicationWindow { var savePath = screenshotsDirStr + "/" + snippetsListView.currentItem.baseName + ".png"; if (result.saveToFile(savePath)) { saveResultToolTip.text = "Successfully saved screenshot to output folder"; - lastSavePath = savePath; + lastSaveUrl = screenshotsDir + "/" + snippetsListView.currentItem.baseName + ".png"; } else { saveResultToolTip.text = "Failed to save screenshot"; } |