adding validation for files to make sure the underlying filesystem

hasn't deleted or moved files in the database
This commit is contained in:
Chris Cochrun 2023-02-17 13:12:23 -06:00
parent 0d3e057734
commit 3b35424a0c
2 changed files with 52 additions and 8 deletions

View file

@ -485,16 +485,25 @@ Item {
Item{
implicitWidth: ListView.view.width
height: selectedLibrary == "videos" ? 50 : 0
Kirigami.BasicListItem {
id: videoListItem
property bool rightMenu: false
property bool fileValidation: fileHelper.validate(filePath)
implicitWidth: videoLibraryList.width
height: selectedLibrary == "videos" ? 50 : 0
clip: true
label: title
/* subtitle: author */
icon: "folder-videos-symbolic"
iconSize: Kirigami.Units.gridUnit
subtitle: {
if (fileValidation)
filePath;
else
"file is missing"
}
supportsMouseEvents: false
backgroundColor: {
if (parent.ListView.isCurrentItem) {
@ -506,10 +515,14 @@ Item {
}
}
textColor: {
if (parent.ListView.isCurrentItem || videoDragHandler.containsMouse)
activeTextColor;
if (fileValidation) {
if (parent.ListView.isCurrentItem || videoDragHandler.containsMouse)
activeTextColor;
else
Kirigami.Theme.textColor;
}
else
Kirigami.Theme.textColor;
"red"
}
Behavior on height {
@ -772,12 +785,20 @@ Item {
id: imageListItem
property bool rightMenu: false
property bool fileValidation: fileHelper.validate(filePath)
implicitWidth: imageLibraryList.width
height: selectedLibrary == "images" ? 50 : 0
clip: true
label: title
/* subtitle: author */
icon: "folder-pictures-symbolic"
iconSize: Kirigami.Units.gridUnit
subtitle: {
if (fileValidation)
filePath;
else
"file is missing"
}
supportsMouseEvents: false
backgroundColor: {
if (parent.ListView.isCurrentItem) {
@ -789,10 +810,14 @@ Item {
}
}
textColor: {
if (parent.ListView.isCurrentItem || imageDragHandler.containsMouse)
activeTextColor;
if (fileValidation) {
if (parent.ListView.isCurrentItem || imageDragHandler.containsMouse)
activeTextColor;
else
Kirigami.Theme.textColor;
}
else
Kirigami.Theme.textColor;
"red"
}
Behavior on height {