From 4e10e30c2f99d552239871aa1b27a08a6c18f1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 5 Jun 2016 04:23:39 +0200 Subject: Imported Upstream version 0.23.1 --- src/db/DatabaseTable.vala | 15 +++++++++++---- src/db/Db.vala | 2 +- src/db/EventTable.vala | 2 +- src/db/PhotoTable.vala | 2 +- src/db/SavedSearchDBTable.vala | 2 +- src/db/TagTable.vala | 2 +- src/db/TombstoneTable.vala | 2 +- src/db/VersionTable.vala | 2 +- src/db/VideoTable.vala | 2 +- 9 files changed, 19 insertions(+), 12 deletions(-) (limited to 'src/db') diff --git a/src/db/DatabaseTable.vala b/src/db/DatabaseTable.vala index 235ac06..42eac69 100644 --- a/src/db/DatabaseTable.vala +++ b/src/db/DatabaseTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -69,10 +69,17 @@ public abstract class DatabaseTable { db = null; string backup_path = filename + ".bak"; - string cmdline = "cp " + backup_path + " " + filename; - Posix.system(cmdline); - prepare_db(filename); + try { + File src = File.new_for_commandline_arg(backup_path); + File dest = File.new_for_commandline_arg(filename); + src.copy(dest, + FileCopyFlags.OVERWRITE | + FileCopyFlags.ALL_METADATA); + prepare_db(filename); + } catch (Error error) { + AppWindow.panic(_("Unable to restore photo database %s").printf(error.message)); + } } // disable synchronized commits for performance reasons ... this is not vital, hence we diff --git a/src/db/Db.vala b/src/db/Db.vala index c6b69d9..d536b41 100644 --- a/src/db/Db.vala +++ b/src/db/Db.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. diff --git a/src/db/EventTable.vala b/src/db/EventTable.vala index 04310b8..593d51c 100644 --- a/src/db/EventTable.vala +++ b/src/db/EventTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. diff --git a/src/db/PhotoTable.vala b/src/db/PhotoTable.vala index 21a8d5e..5be08e7 100644 --- a/src/db/PhotoTable.vala +++ b/src/db/PhotoTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. diff --git a/src/db/SavedSearchDBTable.vala b/src/db/SavedSearchDBTable.vala index 9baab4e..93c8237 100644 --- a/src/db/SavedSearchDBTable.vala +++ b/src/db/SavedSearchDBTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. diff --git a/src/db/TagTable.vala b/src/db/TagTable.vala index 05b2daa..d650641 100644 --- a/src/db/TagTable.vala +++ b/src/db/TagTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. diff --git a/src/db/TombstoneTable.vala b/src/db/TombstoneTable.vala index 861cba4..892198f 100644 --- a/src/db/TombstoneTable.vala +++ b/src/db/TombstoneTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. diff --git a/src/db/VersionTable.vala b/src/db/VersionTable.vala index 3711b83..101b8fb 100644 --- a/src/db/VersionTable.vala +++ b/src/db/VersionTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. diff --git a/src/db/VideoTable.vala b/src/db/VideoTable.vala index bd45750..7bd1bb7 100644 --- a/src/db/VideoTable.vala +++ b/src/db/VideoTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* 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. -- cgit v1.2.3