diff --git a/NEWS b/NEWS index 66f754c50d..fd675d7de1 100644 --- a/NEWS +++ b/NEWS @@ -1,157 +1,158 @@ digiKam 6.1.0 - Release date: 2019-03-31 ***************************************************************************************************** NEW FEATURES: General : New plugins interface for digiKam and Showfoto named dplugins. General : All export tools become generic plugins and are shared with Showfoto. General : Update internal libpgf to last 07193. General : Add compatiblity with OpenCV version 4. General : MacOS and AppImage bundles are now published with Qt 5.11.3. General : Add new optional configuration option to compile with Faces Engine Neural Network. General : Add optional support to ImageMagick codecs to support extra image formats as XCF, FITS, HEIC, etc. BQM : Add new advanced settings in resize tool. BQM : All Batch Queue Manager tools become Bqm plugins. Editor : All Image Editor tools become Editor plugins and are shared with Showfoto. Item View : Add sort items by modification date. DPlugin : New plugin to copy items to a local storage. DPlugin : New plugin to set image as Linux desktop wallpaper. ***************************************************************************************************** BUGFIXES: 001 ==> 279216 - "Resize image" feature is missing some useful options [patch]. 002 ==> 368779 - Missing translations to Plugin Categories columns in setup page. 003 ==> 165852 - Google Youtube video uploader. 004 ==> 404578 - Links broken on downloadpage for 6.0.0. 005 ==> 402069 - FAQ link on Support page is broken. 006 ==> 404503 - There is a typo in support section of website. 007 ==> 404621 - I can not import the album Google Photo. 008 ==> 404642 - digiKam flatpak: Please include mysql driver (for using an external mysql db). 009 ==> 404690 - There is an unwanted bar in the left screen edge in full screen view. 010 ==> 404736 - Merging tags keeps popping up confirmation dialogs every second. 011 ==> 404737 - digiKam does not compile with opencv 3.4.1. 012 ==> 404735 - F2 should edit tag name when tag name has focus. 013 ==> 404748 - Default Album rename dialog should be larger (or save its size when changed). 014 ==> 304811 - Offer a "stretch histogram" functionality to automatically adjust brightness & gamma. 015 ==> 374464 - Can start print wizzard. 016 ==> 316687 - ImageMagick-6.8.3.9 could not be found. 017 ==> 305137 - wish for integrated(?) clip-generator. 018 ==> 404821 - Presentation offset from full screen when OpenGL transitions selected. 019 ==> 404894 - 6.0.0 x86-64 appimage startup complains about mssing ']' (startup bash script being called). 020 ==> 368262 - Google services tool does not use kaccounts. 021 ==> 376913 - Can't create a new album in picasa/googlephoto. 022 ==> 404896 - Vertical video are displayed horizontally. 023 ==> 404859 - Using Batch Queue Manager to make a JPG copy of the images on completion the "arw" images are no longer visible in the originating album. 024 ==> 404893 - Digikam::DigikamApp::slotSolidDeviceChanged: slotSolidDeviceChanged: messages referring to directory that digikam should not care about. 025 ==> 264296 - Lack of right-click delete of points in Curves [patch]. 026 ==> 404954 - Places, Devices, and Removable Devices no longer show in "Select Target Location". 027 ==> 404962 - List of subfolders: incorrect encoding (spaces -> %20, accents). 028 ==> 402724 - digiKam Settings/Configuration: missing section "Plugins" in Windows/6.0.0B3. 029 ==> 404987 - Ability to select which import/export options are included in menu. 030 ==> 404999 - Inconsistency in facetag font size. 031 ==> 244259 - Last image is displayed twice when Advanced Slideshow with KenBurns effect is run more than once. 032 ==> 405043 - Add volume control to video playback. 033 ==> 401253 - Face detect crashes every time. 034 ==> 405042 - Ability to loop video playback. 035 ==> 405138 - Can not disable webservice plugin. 036 ==> 405137 - Original items visible in Thumbnails view. 037 ==> 400606 - Dead space above thumbnails. 038 ==> 380434 - 5.6.0-pre pkg does not detect filesystem changes. 039 ==> 405250 - Menus gone missing. 040 ==> 388198 - Menu Help -> What's this is not used. 041 ==> 392570 - Missing Option to display complete filename. 042 ==> 375474 - Renaming People Tag Causes Unpredictable Sort Order In People Menu. 043 ==> 398868 - Video upside down in Preview (Thumbnail ok). 044 ==> 380065 - "Open with" menu entry missing [patch]. 045 ==> 405258 - Provide an OpenWith... function to get a specific ImageEditor. 046 ==> 402807 - Progress manager doesn't seem to be involved in the fingerprint scanning (v6.0 beta 3). 047 ==> 278935 - Please make XMP Sidecar filename configurable [patch]. 048 ==> 405231 - Monitor Color Profile is not applied in "Presentation". 049 ==> 405347 - Selecting by aspect ratio: abs function in sqlite lowercase, in mariadb uppercase. 050 ==> 405327 - Position and size of faces display depends on configuration setting. 051 ==> 405234 - Refresh does no work. 052 ==> 403649 - Filesystem changes are not visible in album view [patch]. 053 ==> 400768 - Many different trash cans hard & slow to use. 054 ==> 296864 - SETUP : Create interface for changing physical location or path of album. 055 ==> 397189 - digikam is crashing when adding this photo. 056 ==> 405378 - Missing libz.dll on launch. 057 ==> 401306 - digikam-git r41326 doesn't compile with OpenCV 4 058 ==> 379049 - IPTC and XMP metadata not always read when adding a new album. 059 ==> 404939 - AppImage package: integration with the OS with AppImageLauncher. 060 ==> 405514 - Configure Shortcuts : Shortcuts file contains space in assigned_tags. 061 ==> 405149 - The "File Name" in the thumbnail view is not visible. 062 ==> 405512 - Meta Key Not Useful For Key Modifier In Windows. 063 ==> 405513 - Configure Shortcuts : Defaults Button Does Not Apply To New Schemes. 064 ==> 388334 - Auto Filter In People Tag List Confused With Shortcut Keys. 065 ==> 405518 - digiKam can not be added to the Gnome Dash as favorite. 066 ==> 405342 - Increase slideshow caption font size and keyboard shortcut or button to display/hide it. 067 ==> 405636 - When importing picture not all people tags are present. 068 ==> 379916 - Some people tags are missing. 069 ==> 386967 - digiKam with Adobe Bridge keywords under Windows. 070 ==> 402433 - Google Maps Doesn't Zoom With Mouse Wheel. 071 ==> 396920 - EXIF info not written when files from some cameras (Pentax K3) are edited and saved. 072 ==> 375468 - Cannot turn on Menubar. 073 ==> 387253 - No more menu bar in the Gnome desktop environment. 074 ==> 397405 - Large empty space in Digikams main icon view since ~20180707 appimage. 075 ==> 399237 - Thumbnails view shows an empty dock for thumbnails. 076 ==> 393935 - Segmentation fault during face detection. 077 ==> 388533 - UpdateSchemaFromV7ToV9 fails. 078 ==> 281493 - digiKam fails to install on Windows XP. 079 ==> 405537 - Strange behavior with tag in attached file. 080 ==> 405233 - digikam: symbol lookup error: /tmp/.mount_digika5N9rGH/usr/lib/libQt5XcbQpa.so.5: undefined symbol: FT_Property_Set. 081 ==> 404853 - digikam-6.0.0 faces engine fails to compile on PowerPC. 082 ==> 405625 - digiKam 6.0.0 faces engine fails to compile on PowerPC with AltiVec enabled. 083 ==> 372340 - Tagged face areas on portait (vertical) oriented images are mispositioned. 084 ==> 405743 - Customise Tool tab in editor. 085 ==> 376014 - Moving grouped photos from one folder to another breaks the group. 086 ==> 377782 - Group is lost when moved to another album. 087 ==> 385147 - Moving grouped images into another album removes groups. 088 ==> 342017 - Reverse Geocoding doesn't work. 089 ==> 405174 - Right-click advice menu. Open with another program. 090 ==> 399285 - Would it be possible to drop kio for a better 'open with' functionality across all platforms? 091 ==> 383079 - Open the photo in GIMP under windows. 092 ==> 374356 - "Show item in file explorer" as well as "open with". 093 ==> 208201 - Icons appears and disappears. 094 ==> 202955 - thumbnails in album view are flickering with high frequency. 095 ==> 208201 - Icons appears and disappears. 096 ==> 396933 - Tooltips of thumbnails and albums not readable in light designs. 097 ==> 393777 - Item Tool Tips are unreadable in Windows 10 (white on yellow). 098 ==> 240237 - Not possible to rotate the image. 099 ==> 366446 - Creating new albums fails due to invalid path name. 100 ==> 369235 - Menu bar is not translated. 101 ==> 403132 - Lazy Update not working (or: Stop when I say so). 102 ==> 404797 - digikam-6.0.0-x86-64.appimage: stack trace shortly after startup. 103 ==> 405789 - Sidebar widths revert to their defaults after switching back from full-screen view. 104 ==> 405813 - Tab-View do not show Rating information. 105 ==> 404138 - can't connect to my account. 106 ==> 403819 - Export to Google Photos not working (bad request). 107 ==> 382367 - Unreadable light on light tooltip. 108 ==> 405825 - Feature request: "Video date" in XMP Metadata Editor. 109 ==> 405799 - Not possible to add collection. 110 ==> 389549 - "Clear all faces on this image" Does Not Remove All People Tags. 111 ==> 405904 - The saved version of the image is not linked to the original. 112 ==> 372308 - Buttons for rotate does not show very well. 113 ==> 375375 - Various bugs detecting and tagging faces in current 5.4.0 Digikam appimage. 114 ==> 405700 - Lensfun supported Camera is missing. 115 ==> 400140 - Digikam crash when exporting on google photos. 116 ==> 397744 - Face recognition not working. 117 ==> 398000 - Multi/batch rename fails almost every time. 118 ==> 396496 - QSQLITE -> MYSQL loses grouping information. 119 ==> 382311 - Photos in collapsed groups are incorrectly excluded if first photo in group does not match filter. 120 ==> 400981 - Appimage not working anymore: /lib64/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var. 121 ==> 406054 - Export to google photo a picture with a "title" => no "title" in google photo. 122 ==> 254932 - New tool to export images as desktop wallpaper folder. 123 ==> 192020 - Tool to export as plasma backgrounds. 124 ==> 406171 - digiKam crashed on exit. 125 ==> 406276 - Error during Migration: "Error creating database schema". 126 ==> 406227 - Picture without any tag are not listed with button "No Tags". 127 ==> 401377 - Export to (Onedrive, Dropbox ...) crashes digikam (Segmentation Fault). 128 ==> 406309 - Tags reappear after being merged when several merge processes overlap(?). 129 ==> 387487 - Browsing through thumbnails quickly with right arrow key causes crash. 130 ==> 385726 - Add Support For Apple Live Photos. 131 ==> 360806 - digiKam doesn't show Gimp 2.9 xcf images [patch]. 132 ==> 393408 - Support for extra image formats as HEIC, FITS, JPEG-XR [patch]. 133 ==> 406356 - Crop to Selection not visible in Sidebar and Menubar. 134 ==> 406418 - Tag icon don't show after using and show a clock icon for used tag. -135 ==> +135 ==> 406440 - "Operation in all group items" even when only one item is selected. +136 ==> diff --git a/core/app/items/utils/groupingviewimplementation.cpp b/core/app/items/utils/groupingviewimplementation.cpp index 2f31be2740..4e79d66be3 100644 --- a/core/app/items/utils/groupingviewimplementation.cpp +++ b/core/app/items/utils/groupingviewimplementation.cpp @@ -1,95 +1,95 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2017-11-02 * Description : Implementation of grouping specific functions for views * * Copyright (C) 2017 by Simon Frei * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "groupingviewimplementation.h" // Qt includes #include // Local includes #include "iteminfolist.h" namespace Digikam { bool GroupingViewImplementation::needGroupResolving(ApplicationSettings::OperationType type, const ItemInfoList& infos) const { ApplicationSettings::ApplyToEntireGroup applyAll = ApplicationSettings::instance()->getGroupingOperateOnAll(type); if (applyAll == ApplicationSettings::No) { return false; } - foreach(const ItemInfo& info, infos) + foreach (const ItemInfo& info, infos) { if (hasHiddenGroupedImages(info)) { if (applyAll == ApplicationSettings::Yes) { return true; } return ApplicationSettings::instance()->askGroupingOperateOnAll(type); } } return false; } ItemInfoList GroupingViewImplementation::resolveGrouping(const ItemInfoList& infos) const { ItemInfoList outInfos; - foreach(const ItemInfo& info, infos) + foreach (const ItemInfo& info, infos) { outInfos << info; if (hasHiddenGroupedImages(info)) { outInfos << info.groupedImages(); } } return outInfos; } ItemInfoList GroupingViewImplementation::getHiddenGroupedInfos(const ItemInfoList& infos) const { ItemInfoList outInfos; - foreach(const ItemInfo& info, infos) + foreach (const ItemInfo& info, infos) { if (hasHiddenGroupedImages(info)) { outInfos << info.groupedImages(); } } return outInfos; } } // namespace Digikam diff --git a/core/libs/database/utils/ifaces/dbinfoiface.cpp b/core/libs/database/utils/ifaces/dbinfoiface.cpp index cc6b25281c..249a26f3cf 100644 --- a/core/libs/database/utils/ifaces/dbinfoiface.cpp +++ b/core/libs/database/utils/ifaces/dbinfoiface.cpp @@ -1,677 +1,677 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2017-05-06 * Description : interface to database information for shared tools. * * Copyright (C) 2017-2019 by Gilles Caulier * Copyright (C) 2017 by Mario Frank * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "dbinfoiface.h" // Qt includes #include // Local includes #include "albumselecttabs.h" #include "applicationsettings.h" #include "album.h" #include "albummodel.h" #include "albummanager.h" #include "albumfiltermodel.h" #include "albumselectwidget.h" #include "coredb.h" #include "collectionmanager.h" #include "coredbnamefilter.h" #include "collectionscanner.h" #include "digikamapp.h" #include "digikam_debug.h" #include "itemattributeswatch.h" #include "itemiconview.h" #include "itemcopyright.h" #include "iteminfo.h" #include "photoinfocontainer.h" #include "videoinfocontainer.h" #include "itemposition.h" #include "itemsortsettings.h" #include "coredbsearchxml.h" #include "itemlister.h" #include "itemlisterreceiver.h" #include "dio.h" namespace Digikam { class Q_DECL_HIDDEN DBInfoIface::Private { public: explicit Private() : albumManager(AlbumManager::instance()), albumsChooser(0), albumSelector(0), operationType(ApplicationSettings::Unspecified), withGroupedIsSet(false), withGrouped(false) { } AlbumManager* albumManager; AlbumSelectTabs* albumsChooser; AlbumSelectWidget* albumSelector; QList itemUrls; ApplicationSettings::OperationType operationType; bool withGroupedIsSet; bool withGrouped; public: /** get the images from the Physical album in database and return the items found. */ QList imagesFromPAlbum(PAlbum* const album) const { // get the images from the database and return the items found CoreDB::ItemSortOrder sortOrder = CoreDB::NoItemSorting; switch (ApplicationSettings::instance()->getImageSortOrder()) { default: case ItemSortSettings::SortByFileName: sortOrder = CoreDB::ByItemName; break; case ItemSortSettings::SortByFilePath: sortOrder = CoreDB::ByItemPath; break; case ItemSortSettings::SortByCreationDate: sortOrder = CoreDB::ByItemDate; break; case ItemSortSettings::SortByRating: sortOrder = CoreDB::ByItemRating; break; // ByISize not supported } QStringList list = CoreDbAccess().db()->getItemURLsInAlbum(album->id(), sortOrder); QList urlList; CoreDbNameFilter nameFilter(ApplicationSettings::instance()->getAllFileFilter()); for (QStringList::const_iterator it = list.constBegin() ; it != list.constEnd() ; ++it) { if (nameFilter.matches(*it)) { urlList << QUrl::fromLocalFile(*it); } } return urlList; } /** get the images from the Tags album in database and return the items found. */ QList imagesFromTAlbum(TAlbum* const album) const { QStringList list = CoreDbAccess().db()->getItemURLsInTag(album->id()); QList urlList; CoreDbNameFilter nameFilter(ApplicationSettings::instance()->getAllFileFilter()); for (QStringList::const_iterator it = list.constBegin() ; it != list.constEnd() ; ++it) { if (nameFilter.matches(*it)) { urlList << QUrl::fromLocalFile(*it); } } return urlList; } /** get the images from the search album in database and return the items found. */ QList imagesFromSAlbum(SAlbum* const album) const { QList urlList; CoreDbNameFilter nameFilter(ApplicationSettings::instance()->getAllFileFilter()); if (album->isDuplicatesSearch()) { // duplicates search album -> get the id list from the query SearchXmlReader reader(album->query()); reader.readToFirstField(); // Get the defined image ids. QList list; list << reader.valueToIntList(); foreach (int imageId, list) { ItemInfo imageInfo(imageId); if (imageInfo.isVisible()) { // if the image is visible, i.e. existent and not deleted, // add the url if the name filter matches QUrl imageUrl = imageInfo.fileUrl(); /* qCDebug(DIGIKAM_GENERAL_LOG) << "Duplicates search Image url " << imageUrl.toString(); */ if (nameFilter.matches(imageUrl.toString())) { urlList << imageUrl; } } } } else { // If we do not have a duplicates search, we use the image lister to get the images. ItemLister lister; lister.setListOnlyAvailable(true); ItemListerValueListReceiver receiver; if (album->searchType() == DatabaseSearch::HaarSearch) { lister.listHaarSearch(&receiver, album->query()); } else { lister.listSearch(&receiver, album->query(), 0, -1); } if (!receiver.hasError) { // if there were no error, fetch and process the results. foreach (const ItemListerRecord &record, receiver.records) { ItemInfo imageInfo(record); QUrl imageUrl = imageInfo.fileUrl(); /* qCDebug(DIGIKAM_GENERAL_LOG) << "Fuzzy/other search Image url " << imageUrl.toString(); */ if (nameFilter.matches(imageUrl.toString())) { urlList << imageUrl; } } } } return urlList; } /** Remove grouped images if user chose/chooses to. */ QList resolveGroupsFromAlbums(const QList& urlList) { QList lst = urlList; if (!(withGroupedIsSet && withGrouped)) { foreach (const QUrl& url, urlList) { ItemInfo info = ItemInfo::fromUrl(url); if (info.hasGroupedImages()) { if (!withGroupedIsSet) { withGroupedIsSet = true; withGrouped = ApplicationSettings::instance()->askGroupingOperateOnAll(operationType); if (withGrouped) { break; } } foreach (const ItemInfo& i, info.groupedImages()) { lst.removeOne(i.fileUrl()); } } } } return lst; } bool includeGroupedFromSelected() { if (withGroupedIsSet) { return withGrouped; } withGroupedIsSet = true; - withGrouped = DigikamApp::instance()->view()->allNeedGroupResolving(operationType); + withGrouped = DigikamApp::instance()->view()->selectedNeedGroupResolving(operationType); return withGrouped; } }; DBInfoIface::DBInfoIface(QObject* const parent, const QList& lst, const ApplicationSettings::OperationType type) : DInfoInterface(parent), d(new Private) { setObjectName(QLatin1String("DBInfoIface")); d->itemUrls = lst; d->operationType = type; } DBInfoIface::~DBInfoIface() { delete d; } void DBInfoIface::slotDateTimeForUrl(const QUrl& url, const QDateTime& dt, bool updModDate) { DIO::instance()->slotDateTimeForUrl(url, dt, updModDate); } void DBInfoIface::slotMetadataChangedForUrl(const QUrl& url) { // Refresh Database with new metadata from file. CollectionScanner scanner; scanner.scanFile(url.toLocalFile(), CollectionScanner::Rescan); ItemAttributesWatch::instance()->fileMetadataChanged(url); } QList DBInfoIface::currentAlbumItems() const { if (!d->itemUrls.isEmpty()) { return d->itemUrls; } if (d->albumManager->currentAlbums().isEmpty()) { return QList(); } Album* const currAlbum = d->albumManager->currentAlbums().first(); QList imageList = d->resolveGroupsFromAlbums(albumItems(currAlbum)); if (imageList.isEmpty()) { imageList = DigikamApp::instance()->view()->allUrls(d->includeGroupedFromSelected()); } return imageList; } QList DBInfoIface::currentSelectedItems() const { if (!d->itemUrls.isEmpty()) { return d->itemUrls; } return DigikamApp::instance()->view()->selectedUrls(d->includeGroupedFromSelected()); } QList DBInfoIface::allAlbumItems() const { QList imageList; const AlbumList palbumList = d->albumManager->allPAlbums(); for (AlbumList::ConstIterator it = palbumList.constBegin(); it != palbumList.constEnd(); ++it) { // don't add the root album if ((*it)->isRoot()) { continue; } PAlbum* const p = dynamic_cast(*it); if (p) { imageList.append(d->imagesFromPAlbum(p)); } } return imageList; } DBInfoIface::DInfoMap DBInfoIface::albumInfo(int gid) const { Album* const a = d->albumManager->findAlbum(gid); if (!a) { return DInfoMap(); } DInfoMap map; map.insert(QLatin1String("title"), a->title()); PAlbum* const p = dynamic_cast(a); if (p) { map.insert(QLatin1String("caption"), p->caption()); map.insert(QLatin1String("date"), p->date()); map.insert(QLatin1String("path"), p->folderPath()); } return map; } DBInfoIface::DInfoMap DBInfoIface::itemInfo(const QUrl& url) const { DInfoMap map; ItemInfo info = ItemInfo::fromUrl(url); if (!info.isNull()) { map.insert(QLatin1String("name"), info.name()); map.insert(QLatin1String("title"), info.title()); map.insert(QLatin1String("comment"), info.comment()); map.insert(QLatin1String("orientation"), info.orientation()); map.insert(QLatin1String("datetime"), info.dateTime()); map.insert(QLatin1String("rating"), info.rating()); map.insert(QLatin1String("colorlabel"), info.colorLabel()); map.insert(QLatin1String("picklabel"), info.pickLabel()); map.insert(QLatin1String("filesize"), info.fileSize()); map.insert(QLatin1String("dimensions"), info.dimensions()); // Get digiKam Tags Path list of picture from database. // Ex.: "City/Paris/Monuments/Notre Dame" QList tagIds = info.tagIds(); QStringList tagspath = AlbumManager::instance()->tagPaths(tagIds, false); map.insert(QLatin1String("tagspath"), tagspath); // Get digiKam Tags name (keywords) list of picture from database. // Ex.: "Notre Dame" QStringList tags = AlbumManager::instance()->tagNames(tagIds); map.insert(QLatin1String("keywords"), tags); // Get GPS location of picture from database. ItemPosition pos = info.imagePosition(); if (!pos.isEmpty()) { map.insert(QLatin1String("latitude"), pos.latitudeNumber()); map.insert(QLatin1String("longitude"), pos.longitudeNumber()); map.insert(QLatin1String("altitude"), pos.altitude()); } // Get Copyright information of picture from database. ItemCopyright rights = info.imageCopyright(); map.insert(QLatin1String("creators"), rights.creator()); map.insert(QLatin1String("credit"), rights.credit()); map.insert(QLatin1String("rights"), rights.rights()); map.insert(QLatin1String("source"), rights.source()); PhotoInfoContainer photoInfo = info.photoInfoContainer(); map.insert(QLatin1String("make"), photoInfo.make); map.insert(QLatin1String("model"), photoInfo.model); map.insert(QLatin1String("exposuretime"), photoInfo.exposureTime); map.insert(QLatin1String("sensitivity"), photoInfo.sensitivity); map.insert(QLatin1String("aperture"), photoInfo.aperture); map.insert(QLatin1String("focallength"), photoInfo.focalLength); map.insert(QLatin1String("focalLength35mm"), photoInfo.focalLength35mm); // TODO: add more video metadata as needed VideoInfoContainer videoInfo = info.videoInfoContainer(); map.insert(QLatin1String("videocodec"), videoInfo.videoCodec); qCDebug(DIGIKAM_GENERAL_LOG) << "Database Info populated for" << url; } else { qCDebug(DIGIKAM_GENERAL_LOG) << "Database Info is NULL for" << url; } return map; } void DBInfoIface::setItemInfo(const QUrl& url, const DInfoMap& map) const { ItemInfo info = ItemInfo::fromUrl(url); QStringList keys = map.keys(); if (map.contains(QLatin1String("orientation"))) { info.setOrientation(map[QLatin1String("orientation")].toInt()); keys.removeAll(QLatin1String("orientation")); } if (map.contains(QLatin1String("rating"))) { info.setRating(map[QLatin1String("rating")].toInt()); keys.removeAll(QLatin1String("rating")); } if (map.contains(QLatin1String("colorlabel"))) { info.setColorLabel(map[QLatin1String("colorlabel")].toInt()); keys.removeAll(QLatin1String("colorlabel")); } if (map.contains(QLatin1String("picklabel"))) { info.setPickLabel(map[QLatin1String("picklabel")].toInt()); keys.removeAll(QLatin1String("picklabel")); } if (!keys.isEmpty()) { qCWarning(DIGIKAM_GENERAL_LOG) << "Keys not yet supported in DMetaInfoIface::setItemInfo():" << keys; } } QList DBInfoIface::albumItems(Album* const album) const { if (!album) { return QList(); } QList imageList; switch (album->type()) { case Album::PHYSICAL: { PAlbum* const p = dynamic_cast(album); if (p) { imageList = d->imagesFromPAlbum(p); } break; } case Album::TAG: { TAlbum* const p = dynamic_cast(album); if (p) { imageList = d->imagesFromTAlbum(p); } break; } case Album::SEARCH: { SAlbum* const s = dynamic_cast(album); if (s) { imageList = d->imagesFromSAlbum(s); } break; } default: { qCWarning(DIGIKAM_GENERAL_LOG) << "Unknown album type"; break; } } return d->resolveGroupsFromAlbums(imageList); } QList DBInfoIface::albumItems(int id) const { return albumItems(d->albumManager->findAlbum(id)); } QList DBInfoIface::albumsItems(const DAlbumIDs& lst) const { QList imageList; foreach (int gid, lst) { imageList << albumItems(gid); } return d->resolveGroupsFromAlbums(imageList); } QWidget* DBInfoIface::albumChooser(QWidget* const parent) const { if (!d->albumsChooser) { d->albumsChooser = new AlbumSelectTabs(objectName(), parent); } connect(d->albumsChooser, SIGNAL(signalAlbumSelectionChanged()), this, SIGNAL(signalAlbumChooserSelectionChanged())); return d->albumsChooser; } DBInfoIface::DAlbumIDs DBInfoIface::albumChooserItems() const { if (!d->albumsChooser) { return DAlbumIDs(); } AlbumList lst = d->albumsChooser->selectedAlbums(); DAlbumIDs ids; foreach (Album* const a, lst) { if (a) ids << a->globalID(); } return ids; } bool DBInfoIface::supportAlbums() const { return true; } QWidget* DBInfoIface::uploadWidget(QWidget* const parent) const { if (!d->albumSelector) { d->albumSelector = new AlbumSelectWidget(parent); connect(d->albumSelector, SIGNAL(itemSelectionChanged()), this, SIGNAL(signalUploadUrlChanged())); } return d->albumSelector; } QUrl DBInfoIface::uploadUrl() const { QUrl url; if (d->albumSelector) { PAlbum* const p = d->albumSelector->currentAlbum(); if (p) { url = QUrl::fromLocalFile(p->folderPath()); } } return url; } QUrl DBInfoIface::defaultUploadUrl() const { QUrl place = QUrl::fromLocalFile(QDir::homePath()); QStringList pics = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); if (!pics.isEmpty()) place = QUrl::fromLocalFile(pics.first()); Album* const album = AlbumManager::instance()->currentAlbums().first(); if (album->type() == Album::PHYSICAL) { PAlbum* const p = dynamic_cast(album); if (p) { place = QUrl::fromLocalFile(p->folderPath()); } } else { QStringList cols = CollectionManager::instance()->allAvailableAlbumRootPaths(); if (!cols.isEmpty()) { place = QUrl::fromLocalFile(cols.first()); } } return place; } QAbstractItemModel* DBInfoIface::tagFilterModel() { TagModel* const tagModel = new TagModel(AbstractAlbumModel::IgnoreRootAlbum, this); TagPropertiesFilterModel* const filterModel = new TagPropertiesFilterModel(this); filterModel->setSourceAlbumModel(tagModel); filterModel->sort(0); return filterModel; } } // namespace Digikam