diff options
author | Slávek Banko <[email protected]> | 2014-03-03 13:46:44 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2014-03-03 13:46:44 +0100 |
commit | 2e02da046d3e56cdf4744f644af35ad07424f48b (patch) | |
tree | f2dcf353aa2338eae1c2ff2c41af971c580c2762 /src/collections/filecatalog.cpp | |
parent | 3c13229d98167ae4ae0710d5eeef23fef5005bf0 (diff) | |
download | tellico-2e02da046d3e56cdf4744f644af35ad07424f48b.tar.gz tellico-2e02da046d3e56cdf4744f644af35ad07424f48b.zip |
Update to upstream version 1.3.6
Diffstat (limited to 'src/collections/filecatalog.cpp')
-rw-r--r-- | src/collections/filecatalog.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/collections/filecatalog.cpp b/src/collections/filecatalog.cpp index 92d088f..afba7fc 100644 --- a/src/collections/filecatalog.cpp +++ b/src/collections/filecatalog.cpp @@ -102,4 +102,21 @@ Tellico::Data::FieldVec FileCatalog::defaultFields() { return list; } +int FileCatalog::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const { + // equal urls are always equal, even if modification time or something is different + if(Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("url"), this) > 0) { + return 100; // good match + } + // if volume or created time is different, it can't be same entry + if(Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("volume"), this) == 0 || + Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("created"), this) == 0 || + Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("size"), this) == 0) { + return 0; + } + int res = Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("title"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("description"), this); + res += Entry::compareValues(entry1_, entry2_, TQString::fromLatin1("mimetype"), this); + return res; +} + #include "filecatalog.moc" |