* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
#include <fcntl.h>
#include <errno.h>
#ifdef G_OS_UNIX
#include <gfileinfo-priv.h>
#include <gvfs.h>
-#ifndef G_OS_WIN32
+#ifdef G_OS_UNIX
+#include <unistd.h>
#include "glib-unix.h"
#include "glib-private.h"
#endif
-#include "glibintl.h"
#include "thumbnail-verify.h"
#include "gioerror.h"
#include "gthemedicon.h"
#include "gcontenttypeprivate.h"
+#include "glibintl.h"
struct ThumbMD5Context {
g_free (escaped_attr);
get_one_xattr_from_fd (fd, info, gio_attr, attr);
+ g_free (gio_attr);
}
len = strlen (attr) + 1;
static void
get_thumbnail_attributes (const char *path,
GFileInfo *info,
- const GStatBuf *stat_buf)
+ const GLocalFileStat *stat_buf)
{
GChecksum *checksum;
char *uri;
static const char *
get_icon_name (const char *path,
+ const char *content_type,
gboolean use_symbolic,
gboolean *with_fallbacks_out)
{
{
name = use_symbolic ? "folder-videos-symbolic" : "folder-videos";
}
+ else if (g_strcmp0 (content_type, "inode/directory") == 0)
+ {
+ name = use_symbolic ? "folder-symbolic" : "folder";
+ }
else
{
name = NULL;
static GIcon *
get_icon (const char *path,
const char *content_type,
- gboolean is_folder,
gboolean use_symbolic)
{
GIcon *icon = NULL;
const char *icon_name;
gboolean with_fallbacks;
- icon_name = get_icon_name (path, use_symbolic, &with_fallbacks);
+ icon_name = get_icon_name (path, content_type, use_symbolic, &with_fallbacks);
if (icon_name != NULL)
{
if (with_fallbacks)
icon = g_content_type_get_symbolic_icon (content_type);
else
icon = g_content_type_get_icon (content_type);
-
- if (G_IS_THEMED_ICON (icon) && is_folder)
- {
- g_themed_icon_append_name (G_THEMED_ICON (icon), use_symbolic ? "folder-symbolic" : "folder");
- }
}
return icon;
GIcon *icon;
/* non symbolic icon */
- icon = get_icon (path, content_type, S_ISDIR (statbuf.st_mode), FALSE);
+ icon = get_icon (path, content_type, FALSE);
if (icon != NULL)
{
g_file_info_set_icon (info, icon);
}
/* symbolic icon */
- icon = get_icon (path, content_type, S_ISDIR (statbuf.st_mode), TRUE);
+ icon = get_icon (path, content_type, TRUE);
if (icon != NULL)
{
g_file_info_set_symbolic_icon (info, icon);