the image_model.rs is working

The basic functions are all working properly. Now the model works by
using diesel to connect the sql database and retrieve all the items
and organize them. Then it'll ensure any additions and deletions are
correct and happen first on the database before adding them to the
model.

There is still a C++ proxyModel inbetween QML and Rust, but
this proxyModel interfaces with the Rust model instead of the C++
SqlTableModel.
This commit is contained in:
Chris Cochrun 2023-04-06 05:49:28 -05:00
parent caed6e6367
commit fc2d0492fa
9 changed files with 170 additions and 79 deletions

View file

@ -90,7 +90,7 @@ Item {
itemIcon: "folder-pictures-symbolic"
itemSubtitle: {
if (fileValidation)
model.filePath;
model.path;
else
"file is missing"
}
@ -299,11 +299,11 @@ Item {
}
function addImg(url) {
imageProxyModel.imageModel.newImage(url);
imageProxyModel.imageModel.newItem(url);
selectedLibrary = "image";
imageLibraryList.currentIndex = imageProxyModel.imageModel.rowCount();
console.log(imageProxyModel.imageModel.getImage(imageLibraryList.currentIndex));
const image = imageProxyModel.imageModel.getImage(imageLibraryList.currentIndex);
imageLibrary.libraryList.currentIndex = imageProxyModel.imageModel.count();
console.log(imageProxyModel.getImage(imageLibrary.libraryList.currentIndex));
const image = imageProxyModel.getImage(imageLibrary.libraryList.currentIndex);
showPassiveNotification("newest image: " + image.title);
if (!editMode)
editMode = true;