/* LibraryFiles.c generated by valac 0.34.7, the Vala compiler
 * generated from LibraryFiles.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdio.h>
#include <glib/gstdio.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_MEDIA_METADATA (media_metadata_get_type ())
#define MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_METADATA, MediaMetadata))
#define MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_METADATA, MediaMetadataClass))
#define IS_MEDIA_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_METADATA))
#define IS_MEDIA_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_METADATA))
#define MEDIA_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_METADATA, MediaMetadataClass))

typedef struct _MediaMetadata MediaMetadata;
typedef struct _MediaMetadataClass MediaMetadataClass;

#define TYPE_METADATA_DATE_TIME (metadata_date_time_get_type ())
#define METADATA_DATE_TIME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_DATE_TIME, MetadataDateTime))
#define METADATA_DATE_TIME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_DATE_TIME, MetadataDateTimeClass))
#define IS_METADATA_DATE_TIME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_DATE_TIME))
#define IS_METADATA_DATE_TIME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_DATE_TIME))
#define METADATA_DATE_TIME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_DATE_TIME, MetadataDateTimeClass))

typedef struct _MetadataDateTime MetadataDateTime;
typedef struct _MetadataDateTimeClass MetadataDateTimeClass;
#define _metadata_date_time_unref0(var) ((var == NULL) ? NULL : (var = (metadata_date_time_unref (var), NULL)))

#define TYPE_CONFIGURATION_FACADE (configuration_facade_get_type ())
#define CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacade))
#define CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
#define IS_CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION_FACADE))
#define IS_CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION_FACADE))
#define CONFIGURATION_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))

typedef struct _ConfigurationFacade ConfigurationFacade;
typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;

#define CONFIG_TYPE_FACADE (config_facade_get_type ())
#define CONFIG_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_TYPE_FACADE, ConfigFacade))
#define CONFIG_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_TYPE_FACADE, ConfigFacadeClass))
#define CONFIG_IS_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_TYPE_FACADE))
#define CONFIG_IS_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_TYPE_FACADE))
#define CONFIG_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_TYPE_FACADE, ConfigFacadeClass))

typedef struct _ConfigFacade ConfigFacade;
typedef struct _ConfigFacadeClass ConfigFacadeClass;

#define TYPE_VIDEO_READER (video_reader_get_type ())
#define VIDEO_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_READER, VideoReader))
#define VIDEO_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_READER, VideoReaderClass))
#define IS_VIDEO_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_READER))
#define IS_VIDEO_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_READER))
#define VIDEO_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_READER, VideoReaderClass))

typedef struct _VideoReader VideoReader;
typedef struct _VideoReaderClass VideoReaderClass;

#define TYPE_VIDEO_METADATA (video_metadata_get_type ())
#define VIDEO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_METADATA, VideoMetadata))
#define VIDEO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_METADATA, VideoMetadataClass))
#define IS_VIDEO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_METADATA))
#define IS_VIDEO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_METADATA))
#define VIDEO_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_METADATA, VideoMetadataClass))

typedef struct _VideoMetadata VideoMetadata;
typedef struct _VideoMetadataClass VideoMetadataClass;
#define _media_metadata_unref0(var) ((var == NULL) ? NULL : (var = (media_metadata_unref (var), NULL)))
#define _video_reader_unref0(var) ((var == NULL) ? NULL : (var = (video_reader_unref (var), NULL)))

#define TYPE_PHOTO_FILE_ADAPTER (photo_file_adapter_get_type ())
#define PHOTO_FILE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapter))
#define PHOTO_FILE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapterClass))
#define IS_PHOTO_FILE_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_ADAPTER))
#define IS_PHOTO_FILE_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_ADAPTER))
#define PHOTO_FILE_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_ADAPTER, PhotoFileAdapterClass))

typedef struct _PhotoFileAdapter PhotoFileAdapter;
typedef struct _PhotoFileAdapterClass PhotoFileAdapterClass;

#define TYPE_PHOTO_FILE_READER (photo_file_reader_get_type ())
#define PHOTO_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_FILE_READER, PhotoFileReader))
#define PHOTO_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_FILE_READER, PhotoFileReaderClass))
#define IS_PHOTO_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_FILE_READER))
#define IS_PHOTO_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_FILE_READER))
#define PHOTO_FILE_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_FILE_READER, PhotoFileReaderClass))

typedef struct _PhotoFileReader PhotoFileReader;
typedef struct _PhotoFileReaderClass PhotoFileReaderClass;

#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())

#define TYPE_PHOTO_METADATA (photo_metadata_get_type ())
#define PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_METADATA, PhotoMetadata))
#define PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_METADATA, PhotoMetadataClass))
#define IS_PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_METADATA))
#define IS_PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_METADATA))
#define PHOTO_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_METADATA, PhotoMetadataClass))

typedef struct _PhotoMetadata PhotoMetadata;
typedef struct _PhotoMetadataClass PhotoMetadataClass;
#define _photo_file_adapter_unref0(var) ((var == NULL) ? NULL : (var = (photo_file_adapter_unref (var), NULL)))
#define _fclose0(var) ((var == NULL) ? NULL : (var = (fclose (var), NULL)))

typedef enum  {
	PHOTO_FILE_FORMAT_JFIF,
	PHOTO_FILE_FORMAT_RAW,
	PHOTO_FILE_FORMAT_PNG,
	PHOTO_FILE_FORMAT_TIFF,
	PHOTO_FILE_FORMAT_BMP,
	PHOTO_FILE_FORMAT_UNKNOWN
} PhotoFileFormat;


extern gboolean library_files_use_fallback_copy_func;
gboolean library_files_use_fallback_copy_func = FALSE;

void library_files_select_copy_function (void);
GFile* app_dirs_get_import_dir (void);
gpointer media_metadata_ref (gpointer instance);
void media_metadata_unref (gpointer instance);
GParamSpec* param_spec_media_metadata (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_media_metadata (GValue* value, gpointer v_object);
void value_take_media_metadata (GValue* value, gpointer v_object);
gpointer value_get_media_metadata (const GValue* value);
GType media_metadata_get_type (void) G_GNUC_CONST;
GFile* library_files_generate_unique_file (const gchar* basename, MediaMetadata* metadata, time_t ts, gboolean* collision, GError** error);
gpointer metadata_date_time_ref (gpointer instance);
void metadata_date_time_unref (gpointer instance);
GParamSpec* param_spec_metadata_date_time (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_metadata_date_time (GValue* value, gpointer v_object);
void value_take_metadata_date_time (GValue* value, gpointer v_object);
gpointer value_get_metadata_date_time (const GValue* value);
GType metadata_date_time_get_type (void) G_GNUC_CONST;
MetadataDateTime* media_metadata_get_creation_date_time (MediaMetadata* self);
time_t metadata_date_time_get_timestamp (MetadataDateTime* self);
GFile* app_dirs_get_baked_import_dir (time_t tm);
GType configuration_facade_get_type (void) G_GNUC_CONST;
GType config_facade_get_type (void) G_GNUC_CONST;
ConfigFacade* config_facade_get_instance (void);
gboolean configuration_facade_get_use_lowercase_filenames (ConfigurationFacade* self);
GFile* generate_unique_file (GFile* dir, const gchar* basename, gboolean* collision, GError** error);
GFile* library_files_duplicate (GFile* src, GFileProgressCallback progress_callback, void* progress_callback_target, gboolean blacklist, GError** error);
time_t query_file_modified (GFile* file, GError** error);
gboolean video_reader_is_supported_video_file (GFile* file);
gpointer video_reader_ref (gpointer instance);
void video_reader_unref (gpointer instance);
GParamSpec* param_spec_video_reader (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_video_reader (GValue* value, gpointer v_object);
void value_take_video_reader (GValue* value, gpointer v_object);
gpointer value_get_video_reader (const GValue* value);
GType video_reader_get_type (void) G_GNUC_CONST;
VideoReader* video_reader_new (GFile* file);
VideoReader* video_reader_construct (GType object_type, GFile* file);
GType video_metadata_get_type (void) G_GNUC_CONST;
VideoMetadata* video_reader_read_metadata (VideoReader* self, GError** error);
gpointer photo_file_adapter_ref (gpointer instance);
void photo_file_adapter_unref (gpointer instance);
GParamSpec* param_spec_photo_file_adapter (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_photo_file_adapter (GValue* value, gpointer v_object);
void value_take_photo_file_adapter (GValue* value, gpointer v_object);
gpointer value_get_photo_file_adapter (const GValue* value);
GType photo_file_adapter_get_type (void) G_GNUC_CONST;
GType photo_file_reader_get_type (void) G_GNUC_CONST;
GType photo_file_format_get_type (void) G_GNUC_CONST;
PhotoFileFormat photo_file_format_get_by_file_extension (GFile* file);
PhotoFileReader* photo_file_format_create_reader (PhotoFileFormat self, const gchar* filepath);
GType photo_metadata_get_type (void) G_GNUC_CONST;
PhotoMetadata* photo_file_reader_read_metadata (PhotoFileReader* self, GError** error);
void library_monitor_blacklist_file (GFile* file, const gchar* reason);
void library_files_fallback_copy (GFile* src, GFile* dst, GFileProgressCallback callback, void* callback_target, GError** error);
void library_monitor_unblacklist_file (GFile* file);
gchar* md5_file (GFile* file, GError** error);


static gchar* bool_to_string (gboolean self) {
	gchar* result = NULL;
#line 37 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
	if (self) {
#line 196 "LibraryFiles.c"
		gchar* _tmp0_ = NULL;
#line 38 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp0_ = g_strdup ("true");
#line 38 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = _tmp0_;
#line 38 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 204 "LibraryFiles.c"
	} else {
		gchar* _tmp1_ = NULL;
#line 40 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		_tmp1_ = g_strdup ("false");
#line 40 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		result = _tmp1_;
#line 40 "/usr/share/vala-0.34/vapi/glib-2.0.vapi"
		return result;
#line 213 "LibraryFiles.c"
	}
}


void library_files_select_copy_function (void) {
	GFile* import_dir = NULL;
	GFile* _tmp0_ = NULL;
	gboolean _tmp6_ = FALSE;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	GError * _inner_error_ = NULL;
#line 12 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp0_ = app_dirs_get_import_dir ();
#line 12 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	import_dir = _tmp0_;
#line 229 "LibraryFiles.c"
	{
		GFileInfo* info = NULL;
		GFileInfo* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_ = NULL;
#line 15 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp1_ = g_file_query_filesystem_info (import_dir, "filesystem::type", NULL, &_inner_error_);
#line 15 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		info = _tmp1_;
#line 15 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 241 "LibraryFiles.c"
			goto __catch465_g_error;
		}
#line 16 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp2_ = g_file_info_get_attribute_as_string (info, "filesystem::type");
#line 16 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp3_ = _tmp2_;
#line 16 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		library_files_use_fallback_copy_func = g_strcmp0 (_tmp3_, "nfs") == 0;
#line 16 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp3_);
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (info);
#line 254 "LibraryFiles.c"
	}
	goto __finally465;
	__catch465_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_error_ = _inner_error_;
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_inner_error_ = NULL;
#line 18 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp4_ = _error_;
#line 18 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp5_ = _tmp4_->message;
#line 18 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_critical ("LibraryFiles.vala:18: Failed to query fs type: %s", _tmp5_);
#line 19 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		library_files_use_fallback_copy_func = TRUE;
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_error_free0 (_error_);
#line 276 "LibraryFiles.c"
	}
	__finally465:
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (import_dir);
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_clear_error (&_inner_error_);
#line 14 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return;
#line 289 "LibraryFiles.c"
	}
#line 22 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp6_ = library_files_use_fallback_copy_func;
#line 22 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp7_ = bool_to_string (_tmp6_);
#line 22 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp8_ = _tmp7_;
#line 22 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	g_info ("LibraryFiles.vala:22: Using fallback copy: %s", _tmp8_);
#line 22 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_free0 (_tmp8_);
#line 11 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_object_unref0 (import_dir);
#line 303 "LibraryFiles.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 49 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	return self ? g_error_copy (self) : NULL;
#line 310 "LibraryFiles.c"
}


GFile* library_files_generate_unique_file (const gchar* basename, MediaMetadata* metadata, time_t ts, gboolean* collision, GError** error) {
	gboolean _vala_collision = FALSE;
	GFile* result = NULL;
	time_t timestamp = 0;
	time_t _tmp0_ = 0;
	MediaMetadata* _tmp1_ = NULL;
	GFile* dir = NULL;
	time_t _tmp9_ = 0;
	GFile* _tmp10_ = NULL;
	gchar* newbasename = NULL;
	const gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	ConfigFacade* _tmp17_ = NULL;
	ConfigFacade* _tmp18_ = NULL;
	gboolean _tmp19_ = FALSE;
	gboolean _tmp20_ = FALSE;
	GFile* _tmp23_ = NULL;
	GFile* _tmp24_ = NULL;
	const gchar* _tmp25_ = NULL;
	gboolean _tmp26_ = FALSE;
	GFile* _tmp27_ = NULL;
	GFile* _tmp28_ = NULL;
	GError * _inner_error_ = NULL;
#line 29 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	g_return_val_if_fail (basename != NULL, NULL);
#line 29 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	g_return_val_if_fail ((metadata == NULL) || IS_MEDIA_METADATA (metadata), NULL);
#line 34 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp0_ = ts;
#line 34 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	timestamp = _tmp0_;
#line 35 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp1_ = metadata;
#line 35 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp1_ != NULL) {
#line 349 "LibraryFiles.c"
		MetadataDateTime* date_time = NULL;
		MediaMetadata* _tmp2_ = NULL;
		MetadataDateTime* _tmp3_ = NULL;
		MetadataDateTime* _tmp4_ = NULL;
#line 36 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp2_ = metadata;
#line 36 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp3_ = media_metadata_get_creation_date_time (_tmp2_);
#line 36 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		date_time = _tmp3_;
#line 37 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp4_ = date_time;
#line 37 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (_tmp4_ != NULL) {
#line 364 "LibraryFiles.c"
			MetadataDateTime* _tmp5_ = NULL;
			time_t _tmp6_ = 0;
#line 38 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp5_ = date_time;
#line 38 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp6_ = metadata_date_time_get_timestamp (_tmp5_);
#line 38 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			timestamp = _tmp6_;
#line 373 "LibraryFiles.c"
		} else {
			time_t _tmp7_ = 0;
#line 39 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp7_ = timestamp;
#line 39 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			if (_tmp7_ == ((time_t) 0)) {
#line 380 "LibraryFiles.c"
				time_t _tmp8_ = 0;
#line 40 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_tmp8_ = time (NULL);
#line 40 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				timestamp = _tmp8_;
#line 386 "LibraryFiles.c"
			}
		}
#line 35 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_metadata_date_time_unref0 (date_time);
#line 391 "LibraryFiles.c"
	}
#line 44 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp9_ = timestamp;
#line 44 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp10_ = app_dirs_get_baked_import_dir (_tmp9_);
#line 44 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	dir = _tmp10_;
#line 399 "LibraryFiles.c"
	{
		GFile* _tmp11_ = NULL;
#line 46 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp11_ = dir;
#line 46 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_file_make_directory_with_parents (_tmp11_, NULL, &_inner_error_);
#line 46 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 408 "LibraryFiles.c"
			goto __catch466_g_error;
		}
	}
	goto __finally466;
	__catch466_g_error:
	{
		GError* err = NULL;
		GError* _tmp12_ = NULL;
#line 45 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		err = _inner_error_;
#line 45 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_inner_error_ = NULL;
#line 48 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp12_ = err;
#line 48 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (!g_error_matches (_tmp12_, G_IO_ERROR, G_IO_ERROR_EXISTS)) {
#line 425 "LibraryFiles.c"
			GError* _tmp13_ = NULL;
			GError* _tmp14_ = NULL;
#line 49 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp13_ = err;
#line 49 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp14_ = _g_error_copy0 (_tmp13_);
#line 49 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_inner_error_ = _tmp14_;
#line 49 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_error_free0 (err);
#line 436 "LibraryFiles.c"
			goto __finally466;
		}
#line 45 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_error_free0 (err);
#line 441 "LibraryFiles.c"
	}
	__finally466:
#line 45 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 45 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 45 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (dir);
#line 45 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return NULL;
#line 452 "LibraryFiles.c"
	}
#line 55 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp15_ = basename;
#line 55 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp16_ = g_strdup (_tmp15_);
#line 55 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	newbasename = _tmp16_;
#line 56 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp17_ = config_facade_get_instance ();
#line 56 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp18_ = _tmp17_;
#line 56 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp19_ = configuration_facade_get_use_lowercase_filenames (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
#line 56 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp20_ = _tmp19_;
#line 56 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_object_unref0 (_tmp18_);
#line 56 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp20_) {
#line 472 "LibraryFiles.c"
		const gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
#line 57 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp21_ = newbasename;
#line 57 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp22_ = g_utf8_strdown (_tmp21_, (gssize) -1);
#line 57 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (newbasename);
#line 57 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		newbasename = _tmp22_;
#line 483 "LibraryFiles.c"
	}
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp24_ = dir;
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp25_ = newbasename;
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp27_ = generate_unique_file (_tmp24_, _tmp25_, &_tmp26_, &_inner_error_);
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_vala_collision = _tmp26_;
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp23_ = _tmp27_;
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (newbasename);
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (dir);
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return NULL;
#line 505 "LibraryFiles.c"
	}
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp28_ = _tmp23_;
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp23_ = NULL;
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	result = _tmp28_;
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_object_unref0 (_tmp23_);
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_free0 (newbasename);
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_object_unref0 (dir);
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (collision) {
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		*collision = _vala_collision;
#line 523 "LibraryFiles.c"
	}
#line 59 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	return result;
#line 527 "LibraryFiles.c"
}


GFile* library_files_duplicate (GFile* src, GFileProgressCallback progress_callback, void* progress_callback_target, gboolean blacklist, GError** error) {
	GFile* result = NULL;
	time_t timestamp = 0;
	MediaMetadata* metadata = NULL;
	GFile* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	gboolean collision = FALSE;
	GFile* dest = NULL;
	GFile* _tmp27_ = NULL;
	gchar* _tmp28_ = NULL;
	gchar* _tmp29_ = NULL;
	MediaMetadata* _tmp30_ = NULL;
	time_t _tmp31_ = 0;
	gboolean _tmp32_ = FALSE;
	GFile* _tmp33_ = NULL;
	GFile* _tmp34_ = NULL;
	GFile* _tmp35_ = NULL;
	gboolean _tmp37_ = FALSE;
	GError * _inner_error_ = NULL;
#line 63 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	g_return_val_if_fail (G_IS_FILE (src), NULL);
#line 64 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	timestamp = (time_t) 0;
#line 554 "LibraryFiles.c"
	{
		time_t _tmp0_ = 0;
		GFile* _tmp1_ = NULL;
		time_t _tmp2_ = 0;
#line 66 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp1_ = src;
#line 66 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp2_ = query_file_modified (_tmp1_, &_inner_error_);
#line 66 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp0_ = _tmp2_;
#line 66 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 567 "LibraryFiles.c"
			goto __catch467_g_error;
		}
#line 66 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		timestamp = _tmp0_;
#line 572 "LibraryFiles.c"
	}
	goto __finally467;
	__catch467_g_error:
	{
		GError* err = NULL;
		GFile* _tmp3_ = NULL;
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GError* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
#line 65 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		err = _inner_error_;
#line 65 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_inner_error_ = NULL;
#line 68 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp3_ = src;
#line 68 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp4_ = g_file_get_path (_tmp3_);
#line 68 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp5_ = _tmp4_;
#line 68 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp6_ = err;
#line 68 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp7_ = _tmp6_->message;
#line 68 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_critical ("LibraryFiles.vala:68: Unable to access file modification for %s: %s", _tmp5_, _tmp7_);
#line 68 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp5_);
#line 65 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_error_free0 (err);
#line 603 "LibraryFiles.c"
	}
	__finally467:
#line 65 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 65 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 65 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return NULL;
#line 612 "LibraryFiles.c"
	}
#line 71 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	metadata = NULL;
#line 72 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp8_ = src;
#line 72 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp9_ = video_reader_is_supported_video_file (_tmp8_);
#line 72 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp9_) {
#line 622 "LibraryFiles.c"
		VideoReader* reader = NULL;
		GFile* _tmp10_ = NULL;
		VideoReader* _tmp11_ = NULL;
#line 73 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp10_ = src;
#line 73 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp11_ = video_reader_new (_tmp10_);
#line 73 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		reader = _tmp11_;
#line 632 "LibraryFiles.c"
		{
			VideoMetadata* _tmp12_ = NULL;
			VideoReader* _tmp13_ = NULL;
			VideoMetadata* _tmp14_ = NULL;
			VideoMetadata* _tmp15_ = NULL;
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp13_ = reader;
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp14_ = video_reader_read_metadata (_tmp13_, &_inner_error_);
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp12_ = _tmp14_;
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 646 "LibraryFiles.c"
				goto __catch468_g_error;
			}
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp15_ = _tmp12_;
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp12_ = NULL;
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_media_metadata_unref0 (metadata);
#line 75 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			metadata = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_MEDIA_METADATA, MediaMetadata);
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_media_metadata_unref0 (_tmp12_);
#line 659 "LibraryFiles.c"
		}
		goto __finally468;
		__catch468_g_error:
		{
			GError* err = NULL;
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			err = _inner_error_;
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_inner_error_ = NULL;
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_error_free0 (err);
#line 671 "LibraryFiles.c"
		}
		__finally468:
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			g_propagate_error (error, _inner_error_);
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_video_reader_unref0 (reader);
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_media_metadata_unref0 (metadata);
#line 74 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			return NULL;
#line 684 "LibraryFiles.c"
		}
#line 72 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_video_reader_unref0 (reader);
#line 688 "LibraryFiles.c"
	} else {
		PhotoFileReader* reader = NULL;
		GFile* _tmp16_ = NULL;
		PhotoFileFormat _tmp17_ = 0;
		GFile* _tmp18_ = NULL;
		gchar* _tmp19_ = NULL;
		gchar* _tmp20_ = NULL;
		PhotoFileReader* _tmp21_ = NULL;
		PhotoFileReader* _tmp22_ = NULL;
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp16_ = src;
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp17_ = photo_file_format_get_by_file_extension (_tmp16_);
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp18_ = src;
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp19_ = g_file_get_path (_tmp18_);
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp20_ = _tmp19_;
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp21_ = photo_file_format_create_reader (_tmp17_, _tmp20_);
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp22_ = _tmp21_;
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp20_);
#line 80 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		reader = _tmp22_;
#line 716 "LibraryFiles.c"
		{
			PhotoMetadata* _tmp23_ = NULL;
			PhotoFileReader* _tmp24_ = NULL;
			PhotoMetadata* _tmp25_ = NULL;
			PhotoMetadata* _tmp26_ = NULL;
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp24_ = reader;
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp25_ = photo_file_reader_read_metadata (_tmp24_, &_inner_error_);
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp23_ = _tmp25_;
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 730 "LibraryFiles.c"
				goto __catch469_g_error;
			}
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp26_ = _tmp23_;
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp23_ = NULL;
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_media_metadata_unref0 (metadata);
#line 83 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			metadata = G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, TYPE_MEDIA_METADATA, MediaMetadata);
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_media_metadata_unref0 (_tmp23_);
#line 743 "LibraryFiles.c"
		}
		goto __finally469;
		__catch469_g_error:
		{
			GError* err = NULL;
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			err = _inner_error_;
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_inner_error_ = NULL;
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_error_free0 (err);
#line 755 "LibraryFiles.c"
		}
		__finally469:
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			g_propagate_error (error, _inner_error_);
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_photo_file_adapter_unref0 (reader);
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_media_metadata_unref0 (metadata);
#line 82 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			return NULL;
#line 768 "LibraryFiles.c"
		}
#line 72 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_photo_file_adapter_unref0 (reader);
#line 772 "LibraryFiles.c"
	}
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp27_ = src;
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp28_ = g_file_get_basename (_tmp27_);
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp29_ = _tmp28_;
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp30_ = metadata;
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp31_ = timestamp;
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp33_ = library_files_generate_unique_file (_tmp29_, _tmp30_, _tmp31_, &_tmp32_, &_inner_error_);
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	collision = _tmp32_;
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp34_ = _tmp33_;
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_free0 (_tmp29_);
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	dest = _tmp34_;
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_media_metadata_unref0 (metadata);
#line 90 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return NULL;
#line 802 "LibraryFiles.c"
	}
#line 91 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp35_ = dest;
#line 91 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp35_ == NULL) {
#line 808 "LibraryFiles.c"
		GError* _tmp36_ = NULL;
#line 92 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp36_ = g_error_new_literal (G_FILE_ERROR, G_FILE_ERROR_FAILED, "Unable to generate unique pathname for destination");
#line 92 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_inner_error_ = _tmp36_;
#line 92 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 92 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (dest);
#line 92 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_media_metadata_unref0 (metadata);
#line 92 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return NULL;
#line 822 "LibraryFiles.c"
	}
#line 94 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp37_ = blacklist;
#line 94 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp37_) {
#line 828 "LibraryFiles.c"
		GFile* _tmp38_ = NULL;
#line 95 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp38_ = dest;
#line 95 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		library_monitor_blacklist_file (_tmp38_, "LibraryFiles.duplicate");
#line 834 "LibraryFiles.c"
	}
	{
		gboolean _tmp39_ = FALSE;
		gboolean _tmp46_ = FALSE;
#line 98 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp39_ = library_files_use_fallback_copy_func;
#line 98 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (_tmp39_) {
#line 843 "LibraryFiles.c"
			GFile* _tmp40_ = NULL;
			GFile* _tmp41_ = NULL;
			GFileProgressCallback _tmp42_ = NULL;
			void* _tmp42__target = NULL;
#line 99 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp40_ = src;
#line 99 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp41_ = dest;
#line 99 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp42_ = progress_callback;
#line 99 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp42__target = progress_callback_target;
#line 99 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			library_files_fallback_copy (_tmp40_, _tmp41_, _tmp42_, _tmp42__target, &_inner_error_);
#line 99 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 860 "LibraryFiles.c"
				goto __catch470_g_error;
			}
		} else {
			GFile* _tmp43_ = NULL;
			GFile* _tmp44_ = NULL;
			GFileProgressCallback _tmp45_ = NULL;
			void* _tmp45__target = NULL;
#line 101 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp43_ = src;
#line 101 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp44_ = dest;
#line 101 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp45_ = progress_callback;
#line 101 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp45__target = progress_callback_target;
#line 101 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			g_file_copy (_tmp43_, _tmp44_, G_FILE_COPY_ALL_METADATA | G_FILE_COPY_OVERWRITE, NULL, _tmp45_, _tmp45__target, &_inner_error_);
#line 101 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 880 "LibraryFiles.c"
				goto __catch470_g_error;
			}
		}
#line 103 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp46_ = blacklist;
#line 103 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (_tmp46_) {
#line 888 "LibraryFiles.c"
			GFile* _tmp47_ = NULL;
#line 104 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp47_ = dest;
#line 104 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			library_monitor_unblacklist_file (_tmp47_);
#line 894 "LibraryFiles.c"
		}
	}
	goto __finally470;
	__catch470_g_error:
	{
		GError* err = NULL;
		GFile* _tmp48_ = NULL;
		gchar* _tmp49_ = NULL;
		gchar* _tmp50_ = NULL;
		GError* _tmp51_ = NULL;
		const gchar* _tmp52_ = NULL;
		gboolean _tmp53_ = FALSE;
		gboolean _tmp54_ = FALSE;
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		err = _inner_error_;
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_inner_error_ = NULL;
#line 106 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp48_ = src;
#line 106 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp49_ = g_file_get_path (_tmp48_);
#line 106 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp50_ = _tmp49_;
#line 106 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp51_ = err;
#line 106 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp52_ = _tmp51_->message;
#line 106 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_message ("LibraryFiles.vala:106: There was a problem copying %s: %s", _tmp50_, _tmp52_);
#line 106 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp50_);
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp54_ = blacklist;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (_tmp54_) {
#line 930 "LibraryFiles.c"
			gchar* _tmp55_ = NULL;
			GFile* _tmp56_ = NULL;
			gchar* _tmp57_ = NULL;
			gchar* _tmp58_ = NULL;
			GFile* _tmp59_ = NULL;
			gchar* _tmp60_ = NULL;
			gchar* _tmp61_ = NULL;
			gchar* _tmp62_ = NULL;
			gchar* _tmp63_ = NULL;
			gchar* _tmp64_ = NULL;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp56_ = src;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp57_ = md5_file (_tmp56_, &_inner_error_);
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp55_ = _tmp57_;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_g_error_free0 (err);
#line 951 "LibraryFiles.c"
				goto __finally470;
			}
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp59_ = dest;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp60_ = md5_file (_tmp59_, &_inner_error_);
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp58_ = _tmp60_;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_g_free0 (_tmp55_);
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_g_error_free0 (err);
#line 966 "LibraryFiles.c"
				goto __finally470;
			}
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp61_ = _tmp55_;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp55_ = NULL;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp62_ = _tmp61_;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp63_ = _tmp58_;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp58_ = NULL;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp64_ = _tmp63_;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp53_ = g_strcmp0 (_tmp62_, _tmp64_) != 0;
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_free0 (_tmp64_);
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_free0 (_tmp62_);
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_free0 (_tmp58_);
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_free0 (_tmp55_);
#line 991 "LibraryFiles.c"
		} else {
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp53_ = FALSE;
#line 995 "LibraryFiles.c"
		}
#line 107 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (_tmp53_) {
#line 999 "LibraryFiles.c"
			GFile* _tmp65_ = NULL;
#line 108 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp65_ = dest;
#line 108 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			library_monitor_unblacklist_file (_tmp65_);
#line 1005 "LibraryFiles.c"
		}
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_error_free0 (err);
#line 1009 "LibraryFiles.c"
	}
	__finally470:
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (dest);
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_media_metadata_unref0 (metadata);
#line 97 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return NULL;
#line 1022 "LibraryFiles.c"
	}
	{
		GFileInfo* info = NULL;
		GFile* _tmp66_ = NULL;
		GFileInfo* _tmp67_ = NULL;
		guint32 mode = 0U;
		GFileInfo* _tmp68_ = NULL;
		guint32 _tmp69_ = 0U;
		gboolean _tmp70_ = FALSE;
		GFile* _tmp71_ = NULL;
		guint32 _tmp72_ = 0U;
		gboolean _tmp73_ = FALSE;
#line 113 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp66_ = dest;
#line 113 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp67_ = g_file_query_info (_tmp66_, G_FILE_ATTRIBUTE_UNIX_MODE, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
#line 113 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		info = _tmp67_;
#line 113 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1043 "LibraryFiles.c"
			goto __catch471_g_error;
		}
#line 114 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp68_ = info;
#line 114 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp69_ = g_file_info_get_attribute_uint32 (_tmp68_, G_FILE_ATTRIBUTE_UNIX_MODE);
#line 114 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		mode = _tmp69_ | 0600;
#line 115 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp71_ = dest;
#line 115 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp72_ = mode;
#line 115 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp73_ = g_file_set_attribute_uint32 (_tmp71_, G_FILE_ATTRIBUTE_UNIX_MODE, _tmp72_, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
#line 115 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp70_ = _tmp73_;
#line 115 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 115 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_object_unref0 (info);
#line 1064 "LibraryFiles.c"
			goto __catch471_g_error;
		}
#line 115 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (!_tmp70_) {
#line 116 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			g_warning ("LibraryFiles.vala:116: Could not make file writable");
#line 1071 "LibraryFiles.c"
		}
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (info);
#line 1075 "LibraryFiles.c"
	}
	goto __finally471;
	__catch471_g_error:
	{
		GError* err = NULL;
		GError* _tmp74_ = NULL;
		const gchar* _tmp75_ = NULL;
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		err = _inner_error_;
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_inner_error_ = NULL;
#line 119 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp74_ = err;
#line 119 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp75_ = _tmp74_->message;
#line 119 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_warning ("LibraryFiles.vala:119: Could not make file writable: %s", _tmp75_);
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_error_free0 (err);
#line 1095 "LibraryFiles.c"
	}
	__finally471:
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_object_unref0 (dest);
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_media_metadata_unref0 (metadata);
#line 112 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return NULL;
#line 1108 "LibraryFiles.c"
	}
#line 122 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	result = dest;
#line 122 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_media_metadata_unref0 (metadata);
#line 122 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	return result;
#line 1116 "LibraryFiles.c"
}


void library_files_fallback_copy (GFile* src, GFile* dst, GFileProgressCallback callback, void* callback_target, GError** error) {
	gboolean _tmp0_ = FALSE;
	GFile* _tmp1_ = NULL;
	FILE* f = NULL;
	GFile* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	FILE* _tmp6_ = NULL;
	FILE* _tmp7_ = NULL;
	FILE* _tmp8_ = NULL;
	GError * _inner_error_ = NULL;
#line 125 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	g_return_if_fail ((src == NULL) || G_IS_FILE (src));
#line 125 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	g_return_if_fail ((dst == NULL) || G_IS_FILE (dst));
#line 126 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp1_ = src;
#line 126 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp1_ == NULL) {
#line 126 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp0_ = TRUE;
#line 1141 "LibraryFiles.c"
	} else {
		GFile* _tmp2_ = NULL;
#line 126 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp2_ = dst;
#line 126 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp0_ = _tmp2_ == NULL;
#line 1148 "LibraryFiles.c"
	}
#line 126 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp0_) {
#line 127 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return;
#line 1154 "LibraryFiles.c"
	}
#line 130 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp3_ = src;
#line 130 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp4_ = g_file_get_path (_tmp3_);
#line 130 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp5_ = _tmp4_;
#line 130 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp6_ = g_fopen (_tmp5_, "rb");
#line 130 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp7_ = _tmp6_;
#line 130 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_g_free0 (_tmp5_);
#line 130 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	f = _tmp7_;
#line 131 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_tmp8_ = f;
#line 131 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	if (_tmp8_ != NULL) {
#line 1174 "LibraryFiles.c"
		FILE* _tmp9_ = NULL;
		glong size = 0L;
		FILE* _tmp10_ = NULL;
		glong _tmp11_ = 0L;
		FILE* _tmp12_ = NULL;
		GFile* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		GFile* _tmp16_ = NULL;
		gchar* _tmp17_ = NULL;
		gchar* _tmp18_ = NULL;
		glong _tmp19_ = 0L;
		FILE* g = NULL;
		GFile* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		FILE* _tmp23_ = NULL;
		FILE* _tmp24_ = NULL;
		FILE* _tmp25_ = NULL;
#line 132 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp9_ = f;
#line 132 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		fseek (_tmp9_, (glong) 0, SEEK_END);
#line 133 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp10_ = f;
#line 133 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp11_ = ftell (_tmp10_);
#line 133 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		size = _tmp11_;
#line 134 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp12_ = f;
#line 134 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		fseek (_tmp12_, (glong) 0, SEEK_SET);
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp13_ = src;
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp14_ = g_file_get_path (_tmp13_);
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp15_ = _tmp14_;
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp16_ = dst;
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp17_ = g_file_get_path (_tmp16_);
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp18_ = _tmp17_;
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp19_ = size;
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_debug ("LibraryFiles.vala:135: Copying %s to %s, size is %ld", _tmp15_, _tmp18_, _tmp19_);
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp18_);
#line 135 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp15_);
#line 137 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp20_ = dst;
#line 137 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp21_ = g_file_get_path (_tmp20_);
#line 137 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp22_ = _tmp21_;
#line 137 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp23_ = g_fopen (_tmp22_, "wb");
#line 137 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp24_ = _tmp23_;
#line 137 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp22_);
#line 137 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g = _tmp24_;
#line 138 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp25_ = g;
#line 138 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		if (_tmp25_ != NULL) {
#line 1246 "LibraryFiles.c"
			guint8 buffer[4096] = {0};
			gsize written = 0UL;
#line 140 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			written = (gsize) 0;
#line 142 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			while (TRUE) {
#line 1253 "LibraryFiles.c"
				FILE* _tmp26_ = NULL;
				gboolean _tmp27_ = FALSE;
				gsize len = 0UL;
				FILE* _tmp28_ = NULL;
				gsize _tmp29_ = 0UL;
				gsize _tmp30_ = 0UL;
#line 142 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_tmp26_ = f;
#line 142 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_tmp27_ = feof (_tmp26_);
#line 142 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				if (!(!_tmp27_)) {
#line 142 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					break;
#line 1268 "LibraryFiles.c"
				}
#line 143 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_tmp28_ = f;
#line 143 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_tmp29_ = fread (buffer, (gsize) 1, 4096, _tmp28_);
#line 143 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				len = _tmp29_;
#line 144 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				_tmp30_ = len;
#line 144 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
				if (_tmp30_ > ((gsize) 0)) {
#line 1280 "LibraryFiles.c"
					gsize out_len = 0UL;
					FILE* _tmp31_ = NULL;
					gsize _tmp32_ = 0UL;
					gsize _tmp33_ = 0UL;
					gsize _tmp34_ = 0UL;
					gsize _tmp43_ = 0UL;
					gsize _tmp44_ = 0UL;
					GFileProgressCallback _tmp45_ = NULL;
					void* _tmp45__target = NULL;
#line 145 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp31_ = g;
#line 145 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp32_ = len;
#line 145 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp33_ = fwrite (buffer + 0, (gsize) 1, ((gint) _tmp32_) - 0, _tmp31_);
#line 145 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					out_len = _tmp33_;
#line 146 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp34_ = out_len;
#line 146 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					if (_tmp34_ < ((gsize) 0)) {
#line 1302 "LibraryFiles.c"
						GFile* _tmp35_ = NULL;
						gchar* _tmp36_ = NULL;
						gchar* _tmp37_ = NULL;
						GFile* _tmp38_ = NULL;
						gchar* _tmp39_ = NULL;
						gchar* _tmp40_ = NULL;
						GError* _tmp41_ = NULL;
						GError* _tmp42_ = NULL;
#line 147 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp35_ = dst;
#line 147 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp36_ = g_file_get_path (_tmp35_);
#line 147 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp37_ = _tmp36_;
#line 147 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						g_critical ("LibraryFiles.vala:147: Failed to write to file %s: %m", _tmp37_);
#line 147 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_g_free0 (_tmp37_);
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp38_ = dst;
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp39_ = g_file_get_path (_tmp38_);
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp40_ = _tmp39_;
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp41_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "Failed to write to %s", _tmp40_);
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp42_ = _tmp41_;
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_g_free0 (_tmp40_);
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_inner_error_ = _tmp42_;
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						g_propagate_error (error, _inner_error_);
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_fclose0 (g);
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_fclose0 (f);
#line 148 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						return;
#line 1343 "LibraryFiles.c"
					}
#line 150 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp43_ = written;
#line 150 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp44_ = len;
#line 150 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					written = _tmp43_ + _tmp44_;
#line 152 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp45_ = callback;
#line 152 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp45__target = callback_target;
#line 152 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					if (_tmp45_ != NULL) {
#line 1357 "LibraryFiles.c"
						GFileProgressCallback _tmp46_ = NULL;
						void* _tmp46__target = NULL;
						gsize _tmp47_ = 0UL;
						glong _tmp48_ = 0L;
#line 153 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp46_ = callback;
#line 153 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp46__target = callback_target;
#line 153 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp47_ = written;
#line 153 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp48_ = size;
#line 153 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp46_ ((gint64) _tmp47_, (gint64) _tmp48_, _tmp46__target);
#line 1372 "LibraryFiles.c"
					}
				} else {
					gsize _tmp49_ = 0UL;
#line 154 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					_tmp49_ = len;
#line 154 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
					if (_tmp49_ < ((gsize) 0)) {
#line 1380 "LibraryFiles.c"
						GFile* _tmp50_ = NULL;
						gchar* _tmp51_ = NULL;
						gchar* _tmp52_ = NULL;
						GFile* _tmp53_ = NULL;
						gchar* _tmp54_ = NULL;
						gchar* _tmp55_ = NULL;
						GError* _tmp56_ = NULL;
						GError* _tmp57_ = NULL;
#line 155 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp50_ = src;
#line 155 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp51_ = g_file_get_path (_tmp50_);
#line 155 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp52_ = _tmp51_;
#line 155 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						g_critical ("LibraryFiles.vala:155: Failed to read from file %s: %m", _tmp52_);
#line 155 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_g_free0 (_tmp52_);
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp53_ = src;
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp54_ = g_file_get_path (_tmp53_);
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp55_ = _tmp54_;
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp56_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "Failed to read from %s", _tmp55_);
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_tmp57_ = _tmp56_;
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_g_free0 (_tmp55_);
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_inner_error_ = _tmp57_;
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						g_propagate_error (error, _inner_error_);
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_fclose0 (g);
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						_fclose0 (f);
#line 156 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
						return;
#line 1421 "LibraryFiles.c"
					}
				}
			}
		} else {
			GFile* _tmp58_ = NULL;
			gchar* _tmp59_ = NULL;
			gchar* _tmp60_ = NULL;
			GFile* _tmp61_ = NULL;
			gchar* _tmp62_ = NULL;
			gchar* _tmp63_ = NULL;
			GError* _tmp64_ = NULL;
			GError* _tmp65_ = NULL;
#line 160 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp58_ = dst;
#line 160 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp59_ = g_file_get_path (_tmp58_);
#line 160 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp60_ = _tmp59_;
#line 160 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			g_critical ("LibraryFiles.vala:160: Failed to open %s: %m", _tmp60_);
#line 160 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_free0 (_tmp60_);
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp61_ = dst;
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp62_ = g_file_get_path (_tmp61_);
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp63_ = _tmp62_;
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp64_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "Failed to open %s", _tmp63_);
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_tmp65_ = _tmp64_;
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_g_free0 (_tmp63_);
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_inner_error_ = _tmp65_;
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			g_propagate_error (error, _inner_error_);
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_fclose0 (g);
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			_fclose0 (f);
#line 161 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
			return;
#line 1466 "LibraryFiles.c"
		}
#line 131 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_fclose0 (g);
#line 1470 "LibraryFiles.c"
	} else {
		GFile* _tmp66_ = NULL;
		gchar* _tmp67_ = NULL;
		gchar* _tmp68_ = NULL;
		GFile* _tmp69_ = NULL;
		gchar* _tmp70_ = NULL;
		gchar* _tmp71_ = NULL;
		GError* _tmp72_ = NULL;
		GError* _tmp73_ = NULL;
#line 164 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp66_ = src;
#line 164 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp67_ = g_file_get_path (_tmp66_);
#line 164 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp68_ = _tmp67_;
#line 164 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_critical ("LibraryFiles.vala:164: Failed to open %s: %m", _tmp68_);
#line 164 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp68_);
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp69_ = src;
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp70_ = g_file_get_path (_tmp69_);
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp71_ = _tmp70_;
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp72_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "Failed to open %s", _tmp71_);
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_tmp73_ = _tmp72_;
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_g_free0 (_tmp71_);
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_inner_error_ = _tmp73_;
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		g_propagate_error (error, _inner_error_);
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		_fclose0 (f);
#line 165 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
		return;
#line 1510 "LibraryFiles.c"
	}
#line 125 "/home/jens/Source/shotwell/src/LibraryFiles.vala"
	_fclose0 (f);
#line 1514 "LibraryFiles.c"
}



