committed by
Dmitry Podgorny
parent
a5a7db9e2b
commit
054267d738
14
src/common.c
14
src/common.c
@@ -111,16 +111,10 @@ copy_file(const char *const sourcepath, const char *const targetpath, const gboo
|
||||
GFile *source = g_file_new_for_path(sourcepath);
|
||||
GFile *dest = g_file_new_for_path(targetpath);
|
||||
GError *error = NULL;
|
||||
gboolean success = false;
|
||||
|
||||
if (overwrite_existing)
|
||||
{
|
||||
success = g_file_copy (source, dest, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = g_file_copy (source, dest, G_FILE_COPY_NONE, NULL, NULL, NULL, &error);
|
||||
}
|
||||
GFileCopyFlags flags = overwrite_existing ? G_FILE_COPY_OVERWRITE : G_FILE_COPY_NONE;
|
||||
gboolean success = g_file_copy (source, dest, flags, NULL, NULL, NULL, &error);
|
||||
g_object_unref(source);
|
||||
g_object_unref(dest);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user