trying to fix models

This commit is contained in:
Chris Cochrun 2024-09-12 15:27:34 -05:00
parent a1f18f803d
commit b61e05a423
6 changed files with 20 additions and 28 deletions

View file

@ -206,7 +206,7 @@ Item {
}
function addVideo(url) {
videoProxyModel.videoModel.newItem(url);
videoModel.newItem(url);
selectedLibrary = "video";
videoLibrary.libraryList.currentIndex = videoProxyModel.videoModel.count - 1;
if (!editMode)
@ -215,7 +215,7 @@ Item {
}
function addImg(url) {
imageProxyModel.newItem(url);
imageModel.newItem(url);
selectedLibrary = "image";
imageLibrary.libraryList.currentIndex = imageProxyModel.imageModel.count - 1;
if (!editMode)
@ -249,7 +249,8 @@ Item {
}
function isDragFile(item) {
var extension = item.split('.').pop();
console.log(item.toString());
var extension = item.toString().split('.').pop();
var valid = false;
if(extension) {
@ -261,7 +262,7 @@ Item {
}
function addFile(file) {
let extension = file.split('.').pop();
let extension = file.toString().split('.').pop();
if (videoexts.includes(extension))
{
addVideo(file);
@ -281,7 +282,7 @@ Item {
showPassiveNotification("More than one file");
for (let i = 0; i < files.length; i++) {
let file = files[i];
let ext = file.split('.').pop()
let ext = file.toString().split('.').pop()
if (videoexts.includes(ext))
{
addVideo(file);

View file

@ -179,6 +179,10 @@ Controls.Page {
/* ImageProxyModel { id: imageProxyModel } */
/* PresentationProxyModel { id: presProxyModel } */
/* VideoProxyModel { id: videoProxyModel } */
SongModel { id: songModel }
VideoModel { id: videoModel }
PresentationModel { id: presentationModel }
ImageModel { id: imageModel }
ServiceThing { id: serviceThing }
FileHelper { id: fileHelper }
/* SlideHelper { id: slideHelper } */

View file

@ -81,7 +81,7 @@ Item {
id: serviceListItem
implicitWidth: serviceItemList.width
height: Kirigami.Units.gridUnit * 2
Component.onCompleted: Utils.dbg("SERVICEMODEL: " + name)
Component.onCompleted: Utils.dbg("HELLLLLOOOOOO: " + ServiceItemModel.getItem(0).name)
property var selectedItems
@ -161,7 +161,7 @@ Item {
anchors.rightMargin: 5
implicitWidth: Kirigami.Units.gridUnit
source: {
switch (type) {
switch (ty) {
case 'image': return "folder-pictures-symbolic";
case 'video': return "folder-videos-symbolic";
case 'song': return "folder-music-symbolic";