Skip to content

Commit

Permalink
BookPage is properly destroyed when book is closed and not kept behind
Browse files Browse the repository at this point in the history
  • Loading branch information
TronFortyTwo committed Mar 4, 2021
1 parent 3f11b1e commit 025ddf1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion po/sturmreader.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sturmreader.emanuelesorce\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2021-03-04 12:02+0000\n"
"POT-Creation-Date: 2021-03-04 12:26+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
5 changes: 1 addition & 4 deletions ui/qml/BookPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,9 @@ Page {
Action {
icon.name: "go-home"
onTriggered: {
// turn stuff off and exit
content.close();
controls.close();
controls.interactive = false;
pageStack.pop()
mainView.title = mainView.defaultTitle
closeFile();
}
}
]
Expand Down
8 changes: 8 additions & 0 deletions ui/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,15 @@ ApplicationWindow {
converter.converted_filename = dir + "/" + newfilename;
}

// close file
function closeFile() {
while (pageStack.currentItem != localBooks)
pageStack.pop()
bookPage.destroy();
mainView.title = mainView.defaultTitle;
}

// Open file
function loadFile(filename) {
if (server.reader.load(filename)) {
while (pageStack.currentItem != localBooks)
Expand Down

0 comments on commit 025ddf1

Please sign in to comment.