Releases: alketola/harbour-ostos
No functional additions, just using QtStandard Paths now
Even this release won't make it to the Harbour
I have trouble with the Jolla Harbour RPM validator. It doesn't allow Qt.labs.folderlistmodel. I already fixed the "hardcoded paths" problem, by coding hard and putting new methods to the Filester to obtain them from Qt C++ side. So be it. The lack of file picker is annoying, and when I picked Qt.labs.folderlistmodel, my eye did not catch warning that it's not Harbour-compatible.
These limitations make me consider alternatives to publish this application in the future. Anyway, this has been no source of income, just a passion and a favourite waste of time.
I will consider to a) working more days to circumvent the folderlist gap b) move publishing to OpenRepos c) switch to Android. Maybe all of them...
Export database to CSV
New feature
This release has new feature to save the database to a .CSV file. It can be found in Settings page from pulldown menu as "Export database as CSV" option.
One can select database path and name, as well as save path and save file name, but unfortunately it seems impossible to save it outside /home/nemo/... maybe a problem with permissions. The uniqueness of save file is ensured by adding _n (where n is first unused integer in the file name end, if there are any other files with same name).
"Accept" will save the file, but gives no sign of success or failure, maybe that could be considered as a bug.
This release will not be released in Jolla Harbour, because it uses harbour-incompatible fixed paths. I will later change them to comply.
Notable software lessons in this release
Qt C++ code is now integrated to QML, one might consider this as an example of somewhat successful integration. I couldn't find too many other examples like this.
src/filester.h and src/Filester.cpp contain the C++ code.
The file selection is done with Qt.labs.folderlistmodel, biting the example code from codeandcreate. Version 1.0 is sufficient if showHidden property is not necessary, version 2.1 will bring the property.
Little is documented by Jolla the proper way to use PageStack! Surprising, as is one of the most advertised features. The basic tutorials miss the way to pass parameters to opened pages, and the way to jump back to main page gracefully without filling up the page stack.
The way to open a new page with parameters and read back results:
// ExportDialog.qml
onClicked: {
var cacFileSelect = pageStack.push(Qt.resolvedUrl("CacFileSelect.qml"),
{
setRootFolder:"//",
setFolder:"/home/nemo/",
fileNameFilter:"*"
})
cacFileSelect.accepted.connect(function() {
backuppath.text = cacFileSelect.selectedFileName; // selectedFileName is a property
})
}
On the page, the graceful exit pop()ing the pages from page stack goes like this. Note that the firstPage has to be found using find, and additional property "pagemark" placed on the firstPage.
// ExportDialog.qml
acceptDestination: pageStack.find(function(page) {
return page.pagemark==="firstPage";
});
acceptDestinationAction: PageStackAction.Pop
onAccepted: {
console.log("onAccepted")
theFilester.setSaveFileName(backupfilename.text)
console.log("Saving to "+theFilester.saveFileName)
theFilester.saveDataBase()
}
The (own added) pagemark property on firstPage:
// FirstPage.qml
Dialog {
id: firstPage
property string pagemark: "firstPage"
....
French translation added - traduction français ajoutée
The version 1.8-0, to have a nice version number
Only changed the version info. I uploaded 1.07-2 to Jolla Market, but it appeared as 1.06-0 with the old binary, so I had to make a new version and upload it again. Se here is to you, v 1.8-0
Version 1.07 that passed also Jolla's RPM QA, is v1.07-2
The latest contributions to Swedish translation from Åke included.
There were also some minor issues.
- I had written path to the database to a comment which RPM validator detected as a hardcoded path :-( . Removed a few slashes in comments. RPM validator is sensitive to /home/nemo string.
- I had copied Button to create SpecialButton, in order to have a button with property textwidth, to limit text not to overflow the button . However, RPM validator does not allow importing Sailfish.Silica.private 1.0, which I then removed. In consequence, had to remove DragFilter refrences from SpecialButton, which seemed to be of no use.
List Sections, improvement of translations, usability and more
The most recommendable version so far.
Added ability to sort the list also by shopping list item class/category, and show category section headings, and they are optionally selectable in settings.
Some practical testing also done. Can't say I did full regression yet.
Better working, new shop filter, fixed translations - but still alpha
The performance is better than ever. I must admit that the use of PageStack was defective in this app from the beginning, the stack grew infinitively, eating up the memory and perfomance.
I have learned a few lessons:
- PageStack.Pop does not work with forward navigation
- PageStack.Push does not reuse pages already in the stack
- A chain of Dialogs cannot be ended with forward navigarion but with a separate button to PageStack.clear() and PageStack.push(Qt.resolvedURL("FirstPage.qml)
The ShopSelector in the firstPage is now replaced with the FilterPage.qml, which allows selection of multiple shops to view items to shop from.
The translations are (somewhat) fixed. The v1.06 has some bad .ts files in commit.
Noticeable performance improvement.
After some profiling I found out that UI is spent a lot of time creating and deleting. The heavy bit was the context menu, which here is heavier than in many case because of graphics and some additional functionality.
Now the ContextMenu is created dynamically, and it's destruction should be dynamic too. The menu is destroy():ed when closing normally, but deleteLater:ed in some cases. I'm not sure if deleteLater really works for QML. It's not hogging memory much, anyway, and I hope it's not my fault this time.
The Shop list is now handling properly shop names like O'Malley's and amazon.com... there were errors in escaping for SQL and especially for JSON.parse().
Completed inclusion of contributions
Swedish (sv) and German (de) should be now completely included.
Version info updated.
Next releases will include Italian and Spanish language contributions promised earlier.
The version history went a little too complicated as I worked on two machines.
Performance improvement. Added and improved translations for Swedish and German.
Performance improvement was achieved by removing unnecessary signal handlers from ListItems. Added translations, translations/harbour-ostos-sv.ts
and transalations/harbour-ostos-de.ts
. Some code clean-up.