diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-11-12 15:55:20 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-11-12 15:55:20 +0100 |
commit | f6140ff1c9ec493d947da5b346508846e7a1a06f (patch) | |
tree | c01b9164ee4b0d46b6670ccee45f6181c6237d7f /src/LibraryFiles.vala | |
parent | 0f67b3cc674377559e66c5a6729fd499049a992f (diff) | |
parent | 2492891f112caac6076ce49721d9d5d78a152c3a (diff) |
Update upstream source from tag 'upstream/0.26.4'
Update to upstream version '0.26.4'
with Debian dir fae3cc48a8ec2f37979206f90dc828cbebee14c4
Diffstat (limited to 'src/LibraryFiles.vala')
-rw-r--r-- | src/LibraryFiles.vala | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/LibraryFiles.vala b/src/LibraryFiles.vala index 20d43ab..a49b77b 100644 --- a/src/LibraryFiles.vala +++ b/src/LibraryFiles.vala @@ -36,13 +36,23 @@ public File? generate_unique_file(string basename, MediaMetadata? metadata, time } // Optionally convert to lower-case. - string newbasename = basename; - if (Config.Facade.get_instance().get_use_lowercase_filenames()) - newbasename = newbasename.down(); + string newbasename = convert_basename(basename); return global::generate_unique_file(dir, newbasename, out collision); } +// Create the basename for files in the library. +// Depending on the setting USE_LOWERCASE_FILENAMES the basename will be converted to lower case or not +public string convert_basename(string basename) { + if (Config.Facade.get_instance().get_use_lowercase_filenames()) { + return basename.down(); + } else { + return basename; + } + +} + + // This function is thread-safe. private File duplicate(File src, FileProgressCallback? progress_callback, bool blacklist) throws Error { time_t timestamp = 0; @@ -59,7 +69,7 @@ private File duplicate(File src, FileProgressCallback? progress_callback, bool b metadata = reader.read_metadata(); } catch (Error err) { // ignored, leave metadata as null - } + } } else { PhotoFileReader reader = PhotoFileFormat.get_by_file_extension(src).create_reader( src.get_path()); |