Add commits

This commit is contained in:
daleclack 2023-09-14 21:16:02 +08:00
parent 2934b08742
commit 24ef0ddd28
1 changed files with 5 additions and 1 deletions

View File

@ -1,13 +1,17 @@
/*
Patch for Microsoft Windows
*/
#pragma once
#include <gtk/gtk.h>
#include <cstring>
// Check the whether the selected file is directory
// This is a patch for Microsoft Windows
static inline gboolean check_directory(GFileInfo *info)
{
#ifdef _WIN32
// Since all files for windows will be "unknown" type,
// use content type to check file.
const char *file_type = g_file_info_get_content_type(info);
if(strncmp(file_type, "inode/directory", strlen("inode/directory")) == 0)
{