mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[fix] fix thumbnails deletion
This commit is contained in:
@@ -1285,13 +1285,9 @@ void Render::ProcessSdlEvent() {
|
||||
if (stream_window_ &&
|
||||
SDL_GetWindowID(stream_window_) == event.window.windowID) {
|
||||
foucs_on_stream_window_ = focus_gained;
|
||||
LOG_INFO("{} focus on stream window",
|
||||
focus_gained ? "Gained" : "Lost");
|
||||
} else if (main_window_ &&
|
||||
SDL_GetWindowID(main_window_) == event.window.windowID) {
|
||||
foucs_on_main_window_ = focus_gained;
|
||||
LOG_INFO("{} focus on main window",
|
||||
focus_gained ? "Gained" : "Lost");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -260,7 +260,8 @@ int Thumbnail::DeleteThumbnail(const std::string& filename_keyword) {
|
||||
for (const auto& entry : std::filesystem::directory_iterator(image_path_)) {
|
||||
if (entry.is_regular_file()) {
|
||||
const std::string filename = entry.path().filename().string();
|
||||
if (filename.find(filename_keyword) != std::string::npos) {
|
||||
std::string id_hostname = filename_keyword.substr(0, filename.find('@'));
|
||||
if (filename.find(id_hostname) != std::string::npos) {
|
||||
std::filesystem::remove(entry.path());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user