fix: allow symbolic links, no effects on unix(-like) systems though

This commit is contained in:
2025-08-06 02:37:25 +02:00
parent 304f71f913
commit b99c108503
4 changed files with 11 additions and 5 deletions
+7 -1
View File
@@ -1,4 +1,10 @@
#!/bin/env bash
###
# @Author: Uyanide pywang0608@foxmail.com
# @Date: 2025-08-06 01:43:32
# @LastEditTime: 2025-08-06 02:28:12
# @Description:
###
path="$(dirname "$(readlink -f "$0")")"
@@ -10,7 +16,7 @@ cmake --build "$path/../build" --target install || exit 1
cp "$path/wallpaper_chooser.desktop" "$HOME"/.local/share/applications/wallpaper_chooser.desktop
echo -e "\nExec=$HOME/.local/bin/wallpaper_chooser" >> "$HOME"/.local/share/applications/wallpaper_chooser.desktop
echo "Exec=$HOME/.local/bin/wallpaper_chooser" >> "$HOME"/.local/share/applications/wallpaper_chooser.desktop
if command -v update-desktop-database &> /dev/null; then
update-desktop-database "$HOME"/.local/share/applications/
+1 -1
View File
@@ -5,4 +5,4 @@ Name=Wallpaper Chooser
Comment=A small wallpaper utility made with Qt
Terminal=false
Categories=Application;Utility;
StartupNotify=true
StartupNotify=true
+1 -1
View File
@@ -7,7 +7,7 @@
"~/.config/backgrounds"
],
"excludes": [
"~/.config/backgrounds/nao-start-crop-adjusted.jpg",
"~/.config/backgrounds/nao-stars-crop-adjust-flop.jpg",
"~/.config/backgrounds/miku-gate.jpg",
"~/.config/backgrounds/README.md"
]
+2 -2
View File
@@ -1,7 +1,7 @@
/*
* @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 01:34:52
* @LastEditTime: 2025-08-06 00:23:54
* @LastEditTime: 2025-08-06 02:34:10
* @Description: Configuration manager.
*/
#include "config.h"
@@ -227,7 +227,7 @@ bool Config::isValidImageFile(const QString &filePath) {
}
// check if normal file
QFileInfo fileInfo(filePath);
if (!fileInfo.isFile() || !fileInfo.isReadable()) {
if (!(fileInfo.isFile() || fileInfo.isSymbolicLink()) || !fileInfo.isReadable()) {
warn(QString("Invalid file: %1").arg(filePath));
return false;
}