diff --git a/NEWS b/NEWS index ea73fdf5cb..cc2aa9d0d2 100644 --- a/NEWS +++ b/NEWS @@ -1,248 +1,249 @@ digiKam 6.0.0 - Release date: 2018-xx-xx ***************************************************************************************************** NEW FEATURES: ImageEditor : New clone tool to replace old CImg in-painting tool. ImageEditor : Add Web services Import and Export tools. Showfoto : Add Web services Import and Export tools. LightTable : Add Web services Import and Export tools. Database : Similarity database has been moved to a dedicated file to not bloat core database with computed finger-prints. This will speed-up query in core database in case of Similarity feature is used. Database : New video metadata parser based on ffmpeg to populate database. Search : Add video support to find files based on properties registered on database. General : Add QWebEngine support. General : Update internal Libraw to last 0.18.12. General : Fix all Krazy static analyzer reports. Tags : Add possibility to merge tags by drag & drop. HTML Gallery : New Vanilla theme to emulate export to HTML from Adobe LightRoom. HTML Gallery : New Blue Frame theme. HTML Gallery : New Kiosk-Mode theme. ***************************************************************************************************** BUGFIXES: 001 ==> 172650 - No export tools available. 002 ==> 149591 - The export menu is blank. 003 ==> 300424 - Export tools not detected. 004 ==> 327743 - MediaWiki export not displayed. 005 ==> 348146 - Export tools configuration module. 006 ==> 243275 - Crashing when calling configuration. 007 ==> 257134 - Crashes when entering its settings. 008 ==> 230666 - Crash during start. 009 ==> 306698 - Crashes after update to KDE. 010 ==> 207640 - Crashes immediately at startup, sometimes at closing. 011 ==> 245628 - Crash when enabling/disabling Facebook import/export. 012 ==> 097317 - sigsegv [New Thread 1100241184 (LWP 5665)]. 013 ==> 245776 - Crashes when selecting Settings. 014 ==> 245775 - Crashes even without export tools installed. 015 ==> 254283 - Crash as soon as i click settings. 016 ==> 255733 - crash when reopening configuration dialog. 017 ==> 262050 - Crash after new install and scan to mysql database. 018 ==> 263871 - Crashed after searching for duplicates. 019 ==> 268242 - Crashes after I clicked on 'Settings'. 020 ==> 276882 - Add export tool buttons to toolbar. 021 ==> 284801 - Export to picasaweb crashes. 022 ==> 277669 - Crash after files moved. 023 ==> 281250 - Crash after disabling Export tools. 024 ==> 202637 - Crash trying to start export tool. 025 ==> 306693 - after update to KDE host application crashes on startup. 026 ==> 282781 - Crashes when reopening configuration dialog after disabling export tools. 027 ==> 285499 - Crash when settings window opened. 028 ==> 297629 - Crashed when importing from Nikon P7000. 029 ==> 303338 - Crashes when clicking "send to" button. 030 ==> 307619 - Refuses to load Export tools. 031 ==> 311812 - Export tools not loading, SO version not defined. 032 ==> 313186 - Crashes on attempt to use the "Send to" menu. 033 ==> 313356 - Crashed when clicking the "send to" button. 034 ==> 313577 - Crashes when pressing the "send to" button. 035 ==> 313890 - Crash when clicking "Send to...". 036 ==> 315033 - Crashes on pressing Send To... button. 037 ==> 315914 - The facebook tool crashes everytime on initialization. 038 ==> 326556 - Export tools are not loaded when starting host application for second time. 039 ==> 095175 - crash on loading, signal 11 SIGSEGV. 040 ==> 175844 - Crashes at startup loading Export tools. 041 ==> 306511 - Crash during start. 042 ==> 234021 - Crash on loading. 043 ==> 219772 - Opening the application causes crash. 044 ==> 294173 - Crash after Image resize start. 045 ==> 306881 - Crashed when attempting to open Export tools. 046 ==> 306495 - Crash changing settings linux ubuntu lucid. 047 ==> 306497 - Crash after changing settings segmentation fault possible 2nd report? 048 ==> 185470 - "Import from facebook" is listed twice in import menu. 049 ==> 334045 - MediaWiki option not available in Export menu when plugin activated. 050 ==> 142112 - Can't save on my webspace with ShowFoto. 051 ==> 167417 - Showfoto cannot save files of CIFS mount. 052 ==> 125164 - Flickr export tool should respect host application selection. 053 ==> 238927 - Host application quits when uploading to Flickr. 054 ==> 326740 - Selection of tools is set to default after each update. 055 ==> 233063 - Add progress indicator when moving or copy files [patch]. 056 ==> 361829 - Rotated MP4 video with "Orientation" flag are not played back in the correct rotation angle. 057 ==> 329854 - digiKam doesn't rotate video thumbnail. 058 ==> 376661 - When importing ~200,000 video files Digikam crashes in about 2-5 seconds of starting. 059 ==> 377072 - Cannot read video metadata. 060 ==> 374453 - Extract right video date from MP4 files metadata. 061 ==> 377177 - Geolocation / GPS information doesn't appear in video metadata. 062 ==> 383588 - Imported video files have time shifted exactly 2 hours later. 063 ==> 380847 - MP4 video not importing with correct date. 064 ==> 373682 - geolocalisation filter does not take care of the videos geolocalisation tags. 065 ==> 340925 - digiKam crash when start it. 066 ==> 331506 - digiKam crashes on startup. 067 ==> 335816 - Crash when trying to add a big collection. 068 ==> 353295 - digiKam repeatedly crashes while importing pictures. 069 ==> 341433 - Crash when opening digiKam application. 070 ==> 375562 - digiKam crashes while scanning images into sqlite database. 071 ==> 334782 - Crash while doing nothing. 072 ==> 362672 - Crash on start of digiKam. 073 ==> 341023 - Crash after startup during check for updated images. 074 ==> 386891 - Crashed while adding pictures. 075 ==> 342666 - digiKam crashes during find new items. 076 ==> 341274 - digiKam crash on startup. 077 ==> 343708 - Crash when scanning album. 078 ==> 332721 - Crash when reading a certain MP4 video file. 079 ==> 343736 - Crashes when rebuilding thumbnails from database. 080 ==> 346356 - digiKam crashes when adding 90.000 pictures to library. 081 ==> 343714 - digiKam crash when scanning for new items. 082 ==> 341091 - digiKam crashes when updating the MySQL database of a a hudge photo collection. 083 ==> 340879 - digiKam crashes after getting unexpected but reasonable output from libexiv2. 084 ==> 342712 - Crash on collection scanning. 085 ==> 356704 - digiKam still crashes while scanning a new photo directory and subdirs. 086 ==> 339269 - Segfault when opening a folder that contains unknown file types (mov, avi, xcf). 087 ==> 364635 - digiKam crashes on startup. 088 ==> 357356 - digiKam crash on startup while scanning photos. 089 ==> 341554 - digiKam crashed by Data-Import from NFS. 090 ==> 345457 - digiKam crashes at "loading tools". 091 ==> 349635 - Crash of digiKam - moving album. 092 ==> 342604 - digiKam crash. 093 ==> 331450 - Signal 8 on album opening. 094 ==> 342030 - digiKam crashes when checking an AVI video file using exiv2. 095 ==> 352777 - Crash during scan. 096 ==> 352944 - digiKam crashes on start. 097 ==> 343643 - digiKam crashes while perform initial scanning of custom photo folder. 098 ==> 342000 - digiKam crash when opening folder with Videos (Album or SD Card import). 099 ==> 353447 - digiKam crashes when scanning files. 100 ==> 346807 - Crashes on startup. 101 ==> 364639 - digiKam crashed while opening database. 102 ==> 341504 - Crash while using application. 103 ==> 367691 - Searching for pictures crashes at 30% every time. 104 ==> 334604 - Crash after changing disk partions. 105 ==> 351689 - Crash on opening digiKam. 106 ==> 149267 - digiKam crashes after finding avi and so on. 107 ==> 170387 - Add movies management. 108 ==> 369629 - digiKam does not use GPS data from video files. 109 ==> 367880 - Nexus 5X videos show up upside-down in digiKam. 110 ==> 330116 - digiKam does not take care about GPS info stored in MP4 video files. 111 ==> 339150 - digikam crashes when trying to display video file. 112 ==> 344406 - Crash at start. 113 ==> 339909 - digiKam Segmentation Fault on open. 114 ==> 343231 - Crash at scanning for new fotos. 115 ==> 340373 - Crash on scanning video directory. 116 ==> 134679 - Video and audio files are not imported. 117 ==> 375357 - No video preview. 118 ==> 261773 - Batch renaming does not complete when MP4 video file is processed. 119 ==> 185915 - Album View: "Created" time of video set to "00:00". 120 ==> 303218 - digiKam import crashes when you select video files. 121 ==> 374241 - Bad video date rename. 122 ==> 375646 - Be able to scan only photo, not video and audio. 123 ==> 262499 - Cannot rename .AVI files. 124 ==> 199261 - Import avi movies from sdcard wrong date and no thumbnail. 125 ==> 181521 - NEF's in descending order, AVI in ascending order in import from SD-card. 126 ==> 392019 - Two persons can point to the same face tag in pictures. 127 ==> 392013 - Metadata explorer does not show XMP face rectangles. 128 ==> 389508 - Dates Side Menu Is Not Updated Automatically After Exif Date Change [patch]. 129 ==> 331864 - Merge Tags with same name when moving to same hierarchy level. 130 ==> 347302 - Reassign name to face. 131 ==> 391747 - BQM Tool "Remove Metadata" doesn't remove all metadata from image. 132 ==> 285683 - Already imported pictures not recognized after daylight savings time. 133 ==> 392309 - Icons are pixelated when my display scale factor is 1.2 134 ==> 392405 - Function 'getImageIdsFromArea' argument order different. 135 ==> 386224 - Metadata is not updated when moving tags. 136 ==> 370245 - Be able to rename tags which have been setted in pictures. 137 ==> 374470 - Deleted tags are not removed from file metadata. 138 ==> 374516 - Persons metadata are not updated after a tag removed. 139 ==> 392436 - Count Files in directory. 140 ==> 363859 - digiKam core port from QWebKit to QWebEngine [patch]. 141 ==> 392427 - Cannot add collection on network drive. 142 ==> 392022 - Position of a face tag appears on top of bottom of the list, instead of being sorted alphabetically. 143 ==> 372763 - Rename does not give options on Conflict. 144 ==> 391533 - Feature request: add "NOT" tag matching condition in "Filters" panel. 145 ==> 381222 - digiKam crash on fuzzy search. 146 ==> 386275 - Crash caused by QtAV. 147 ==> 372342 - Face tag area is very short [patch]. 148 ==> 391348 - People Side Menu Shows Only Faces Not People Tagged Images. 149 ==> 385630 - Views Requiring Maps Takes ~30s to Launch. 150 ==> 192908 - Allow to split icon-view in order to show multiple albums at the same time. 151 ==> 339088 - GIT master: crash when clicking through images in preview, with face recognition running in background. 152 ==> 341605 - Crash if I attempt to use left-sidebar tags tab. 153 ==> 227266 - Handle Video Date from metadata. 154 ==> 227259 - Needs to Edit Video Date. 155 ==> 373284 - digiKam crashed with SIGSEGV in QSortFilterProxyModel::parent(). 156 ==> 384807 - digikam 5.7.0 AppImage bundle : provide a more recent ffmpeg version for video support. 157 ==> 391835 - Deleted pictures still appear in group. 158 ==> 387483 - Elegant theme: Selected frame colors swapped [patch]. 159 ==> 375424 - Thumbnails are not being removed from AlbumsView after moving the images to Trash. 160 ==> 368796 - Problem with Exif-tags: ImageDescription and UserComment. 161 ==> 392417 - AppImage (5.9.0-01-x86-64) does not support "--install" cli parameter. 162 ==> 392922 - digikam-6.0.0 fail to start. 163 ==> 391399 - Not possible to add location bookmarks in Digikam >5.6.0. 164 ==> 380876 - Tags in Digikam DB maintained after being removed from file and file re-scanned. 165 ==> 392017 - Merging, renaming and removing face tags. 166 ==> 352711 - Externally removed tags are not removed from digiKam. 167 ==> 393108 - Tags not always visible when selecting multiple pictures in a group. 168 ==> 392656 - Selecting a root album for face scan doesn't include subfolders, but rather scans an unexpected album set. 169 ==> 329438 - Rename function with Date & Time does not work with NTFS. 170 ==> 376473 - Can"t set empty IPTC country code when using metadata templates. 171 ==> 380289 - Cannot write to Albums residing on NFS. 172 ==> 384465 - With Compact Flash Card Created date in thumbnails is wrong. 173 ==> 381958 - Cannot add additional collection. 174 ==> 383747 - "Rotate only by setting a flag" Changes Image Instead. 175 ==> 387977 - No icon only view of "Extras sidebar": sidebar taking up a lot of space. 176 ==> 277502 - All versions of version set always displayed in Album view [patch]. 177 ==> 393283 - Caption not updating Exif.Image.ImageDescription field. 178 ==> 391060 - Crashes on undo of very large tif. 179 ==> 366305 - Add a message at startup about the lack of temporary space to perform Undo operations. 180 ==> 366391 - Rotating an image seems to forget to reset the orientation flag. 181 ==> 393654 - Not able to select gpx file. 182 ==> 367596 - Sub-folder count images but don't show them (unsupported JPEG file?). 183 ==> 379922 - Digikam won't remove tags set by Windows Explorer. 184 ==> 379081 - GPS data are in file but geolocation indicator is not shown and map view empty. 185 ==> 354819 - Specific pictures not showing up in digikam. 186 ==> 393855 - MySQL/MariaDB upgrade fails. 187 ==> 384603 - Camera Creation Date not set from EXIF data. 188 ==> 386959 - Properties view: wrong creation date [patch]. 189 ==> 393970 - No mts video thumbnails. 190 ==> 393728 - Reread metadata from Video uses sidecar only. 191 ==> 393925 - UpdateSchemaFromV7ToV9 fails due to duplicate key in album_2. 192 ==> 393773 - showfoto crashes when geotagging. 193 ==> 388199 - No context menu to copy coordinates from map. 194 ==> 393399 - Windows defender freaks out in windows 10 and Edge. 195 ==> 392134 - SIGSEGV While Scanning Faces [patch]. 196 ==> 394168 - OSM Search Yields No Results. 197 ==> 377719 - Cannot rename file with overwrite [patch]. 198 ==> 388002 - remove kio related legacy [patch] 199 ==> 394242 - Import settings unneccesarily asks to overwrite image database, and crashes when I decline. 200 ==> 394278 - A slideshow theme for kiosk mode. 201 ==> 340389 - digiKam crashes while editing pictures for color balancing on OSX [patch]. 202 ==> 394413 - Unify group handling [patch]. 203 ==> 394573 - Revers geodata from open street map does not work. 204 ==> 394590 - Feature request: being able to filter on all metadatas fields. 205 ==> 394671 - Distortion on Panasonic DMC-LX15. 206 ==> 393205 - Advanced rename very slow. 207 ==> 382474 - Thumbnail regeneration. 208 ==> 394865 - digikam suspicious crash on exit. 209 ==> 390541 - Tooltip background cannot be changed. 210 ==> 391521 - "Tool-tip" box difficult to read due to default color scheme. 211 ==> 377849 - Albums disappear when the network is interrupted. 212 ==> 394988 - PgDown and PgUp hardcoded in preview mode. 213 ==> 366312 - Efficient photo tagging workflow got lost in transition from 4.x to 5. 214 ==> 395093 - Being able to export a list of paths from a selection of thumbnails. 215 ==> 395144 - When zooming in preview, face tags show on wrong places. 216 ==> 275671 - Scan single image for faces. 217 ==> 263347 - Print wizard ignores selected paper size, reverts to A4. -218 ==> +218 ==> 395579 - Only one tag being exported to flickr. +219 ==> diff --git a/core/utilities/assistants/webservices/flickr/flickrwindow.cpp b/core/utilities/assistants/webservices/flickr/flickrwindow.cpp index 9578531ca2..e78b3a9b1c 100644 --- a/core/utilities/assistants/webservices/flickr/flickrwindow.cpp +++ b/core/utilities/assistants/webservices/flickr/flickrwindow.cpp @@ -1,869 +1,875 @@ /* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2005-17-06 * Description : a tool to export images to Flickr web service * * Copyright (C) 2005-2008 by Vardhman Jain * Copyright (C) 2008-2018 by Gilles Caulier * Copyright (C) 2009 by Luka Renko * * 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 "flickrwindow.h" // Qt includes #include #include #include #include #include #include #include #include #include #include #include // KDE includes #include #include // Local includes #include "dprogresswdg.h" #include "flickrtalker.h" #include "flickritem.h" #include "flickrlist.h" #include "wsselectuserdlg.h" #include "digikam_debug.h" #include "flickrnewalbumdlg.h" #include "previewloadthread.h" #include "flickrwidget_p.h" namespace Digikam { class FlickrWindow::Private { public: explicit Private() { uploadCount = 0; uploadTotal = 0; newAlbumBtn = 0; changeUserButton = 0; removeAccount = 0; albumsListComboBox = 0; publicCheckBox = 0; familyCheckBox = 0; friendsCheckBox = 0; exportHostTagsCheckBox = 0; stripSpaceTagsCheckBox = 0; addExtraTagsCheckBox = 0; originalCheckBox = 0; resizeCheckBox = 0; dimensionSpinBox = 0; imageQualitySpinBox = 0; extendedPublicationButton = 0; extendedTagsButton = 0; contentTypeComboBox = 0; safetyLevelComboBox = 0; userNameDisplayLabel = 0; authProgressDlg = 0; tagsLineEdit = 0; widget = 0; talker = 0; imglst = 0; select = 0; albumDlg = 0; iface = 0; } unsigned int uploadCount; unsigned int uploadTotal; QString serviceName; QPushButton* newAlbumBtn; QPushButton* changeUserButton; QPushButton* removeAccount; QComboBox* albumsListComboBox; QCheckBox* publicCheckBox; QCheckBox* familyCheckBox; QCheckBox* friendsCheckBox; QCheckBox* exportHostTagsCheckBox; QCheckBox* stripSpaceTagsCheckBox; QCheckBox* addExtraTagsCheckBox; QCheckBox* originalCheckBox; QCheckBox* resizeCheckBox; QSpinBox* dimensionSpinBox; QSpinBox* imageQualitySpinBox; QPushButton* extendedPublicationButton; QPushButton* extendedTagsButton; WSComboBoxIntermediate* contentTypeComboBox; WSComboBoxIntermediate* safetyLevelComboBox; QString username; QString userId; QString lastSelectedAlbum; QLabel* userNameDisplayLabel; QProgressDialog* authProgressDlg; QList< QPair > uploadQueue; QLineEdit* tagsLineEdit; FlickrWidget* widget; FlickrTalker* talker; FlickrList* imglst; WSSelectUserDlg* select; FlickrNewAlbumDlg* albumDlg; DInfoInterface* iface; }; FlickrWindow::FlickrWindow(DInfoInterface* const iface, QWidget* const /*parent*/, const QString& serviceName) : WSToolDialog(0), d(new Private) { d->iface = iface; d->serviceName = serviceName; setWindowTitle(i18n("Export to %1 Web Service", d->serviceName)); setModal(false); KConfig config; KConfigGroup grp = config.group(QString::fromLatin1("%1Export Settings").arg(d->serviceName)); if (grp.exists()) { qCDebug(DIGIKAM_WEBSERVICES_LOG) << QString::fromLatin1("%1Export Settings").arg(d->serviceName) << " exists, deleting it"; grp.deleteGroup(); } d->select = new WSSelectUserDlg(0, serviceName); d->uploadCount = 0; d->uploadTotal = 0; d->widget = new FlickrWidget(this, iface, serviceName); d->albumDlg = new FlickrNewAlbumDlg(this, QString::fromLatin1("Flickr")); d->albumsListComboBox = d->widget->getAlbumsCoB(); d->newAlbumBtn = d->widget->getNewAlbmBtn(); d->originalCheckBox = d->widget->getOriginalCheckBox(); d->resizeCheckBox = d->widget->getResizeCheckBox(); d->publicCheckBox = d->widget->d->publicCheckBox; d->familyCheckBox = d->widget->d->familyCheckBox; d->friendsCheckBox = d->widget->d->friendsCheckBox; d->dimensionSpinBox = d->widget->getDimensionSpB(); d->imageQualitySpinBox = d->widget->getImgQualitySpB(); d->extendedTagsButton = d->widget->d->extendedTagsButton; d->addExtraTagsCheckBox = d->widget->d->addExtraTagsCheckBox; d->extendedPublicationButton = d->widget->d->extendedPublicationButton; d->safetyLevelComboBox = d->widget->d->safetyLevelComboBox; d->contentTypeComboBox = d->widget->d->contentTypeComboBox; d->tagsLineEdit = d->widget->d->tagsLineEdit; d->exportHostTagsCheckBox = d->widget->d->exportHostTagsCheckBox; d->stripSpaceTagsCheckBox = d->widget->d->stripSpaceTagsCheckBox; d->changeUserButton = d->widget->getChangeUserBtn(); d->removeAccount = d->widget->d->removeAccount; d->userNameDisplayLabel = d->widget->getUserNameLabel(); d->imglst = d->widget->d->imglst; startButton()->setText(i18n("Start Uploading")); startButton()->setToolTip(QString()); setMainWidget(d->widget); d->widget->setMinimumSize(800, 600); connect(d->imglst, SIGNAL(signalImageListChanged()), this, SLOT(slotImageListChanged())); // -------------------------------------------------------------------------- d->talker = new FlickrTalker(this, serviceName, d->iface); connect(d->talker, SIGNAL(signalError(QString)), d->talker, SLOT(slotError(QString))); connect(d->talker, SIGNAL(signalBusy(bool)), this, SLOT(slotBusy(bool))); connect(d->talker, SIGNAL(signalAddPhotoSucceeded()), this, SLOT(slotAddPhotoSucceeded())); connect(d->talker, SIGNAL(signalAddPhotoFailed(QString)), this, SLOT(slotAddPhotoFailed(QString))); connect(d->talker, SIGNAL(signalAddPhotoSetSucceeded()), this, SLOT(slotAddPhotoSetSucceeded())); connect(d->talker, SIGNAL(signalListPhotoSetsSucceeded()), this, SLOT(slotPopulatePhotoSetComboBox())); connect(d->talker, SIGNAL(signalListPhotoSetsFailed(QString)), this, SLOT(slotListPhotoSetsFailed(QString))); connect(d->talker, SIGNAL(signalLinkingSucceeded()), this, SLOT(slotLinkingSucceeded())); connect(d->widget->progressBar(), SIGNAL(signalProgressCanceled()), this, SLOT(slotAddPhotoCancelAndClose())); connect(d->widget->getReloadBtn(), SIGNAL(clicked()), this, SLOT(slotReloadPhotoSetRequest())); // -------------------------------------------------------------------------- connect(d->changeUserButton, SIGNAL(clicked()), this, SLOT(slotUserChangeRequest())); connect(d->removeAccount, SIGNAL(clicked()), this, SLOT(slotRemoveAccount())); connect(d->newAlbumBtn, SIGNAL(clicked()), this, SLOT(slotCreateNewPhotoSet())); // -------------------------------------------------------------------------- d->authProgressDlg = new QProgressDialog(this); d->authProgressDlg->setModal(true); d->authProgressDlg->setAutoReset(true); d->authProgressDlg->setAutoClose(true); d->authProgressDlg->setMaximum(0); d->authProgressDlg->reset(); connect(d->authProgressDlg, SIGNAL(canceled()), this, SLOT(slotAuthCancel())); d->talker->m_authProgressDlg = d->authProgressDlg; // -------------------------------------------------------------------------- connect(this, &QDialog::finished, this, &FlickrWindow::slotFinished); connect(this, SIGNAL(cancelClicked()), this, SLOT(slotCancelClicked())); connect(startButton(), &QPushButton::clicked, this, &FlickrWindow::slotUser1); d->select->reactivate(); readSettings(d->select->getUserName()); d->talker->link(d->select->getUserName()); } FlickrWindow::~FlickrWindow() { delete d->select; delete d->authProgressDlg; delete d->talker; delete d->widget; delete d; } void FlickrWindow::setItemsList(const QList& urls) { d->widget->imagesList()->slotAddImages(urls); } void FlickrWindow::closeEvent(QCloseEvent* e) { if (!e) { return; } slotFinished(); e->accept(); } void FlickrWindow::slotFinished() { writeSettings(); d->imglst->listView()->clear(); } void FlickrWindow::setUiInProgressState(bool inProgress) { setRejectButtonMode(inProgress ? QDialogButtonBox::Cancel : QDialogButtonBox::Close); if (inProgress) { d->widget->progressBar()->show(); } else { d->widget->progressBar()->hide(); d->widget->progressBar()->progressCompleted(); } } void FlickrWindow::slotCancelClicked() { d->talker->cancel(); d->uploadQueue.clear(); setUiInProgressState(false); } void FlickrWindow::slotAddPhotoCancelAndClose() { writeSettings(); d->imglst->listView()->clear(); d->uploadQueue.clear(); d->widget->progressBar()->reset(); setUiInProgressState(false); d->talker->cancel(); reject(); } void FlickrWindow::reactivate() { d->userNameDisplayLabel->setText(QString()); readSettings(d->select->getUserName()); d->talker->link(d->select->getUserName()); d->widget->d->imglst->loadImagesFromCurrentSelection(); show(); } void FlickrWindow::readSettings(QString uname) { KConfig config; - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Group name is : "<serviceName, uname); - KConfigGroup grp = config.group(QString::fromLatin1("%1%2Export Settings").arg(d->serviceName, uname)); - d->exportHostTagsCheckBox->setChecked(grp.readEntry("Export Host Tags", false)); - d->extendedTagsButton->setChecked(grp.readEntry("Show Extended Tag Options", false)); - d->addExtraTagsCheckBox->setChecked(grp.readEntry("Add Extra Tags", false)); - d->stripSpaceTagsCheckBox->setChecked(grp.readEntry("Strip Space From Tags", false)); - d->stripSpaceTagsCheckBox->setEnabled(d->exportHostTagsCheckBox->isChecked()); - d->exportHostTagsCheckBox->setEnabled(false); - d->stripSpaceTagsCheckBox->setEnabled(false); + QString groupName = QString::fromLatin1("%1%2Export Settings").arg(d->serviceName, uname); + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Group name is:" << groupName; + KConfigGroup grp = config.group(groupName); + + d->exportHostTagsCheckBox->setChecked(grp.readEntry("Export Host Tags", false)); + d->extendedTagsButton->setChecked(grp.readEntry("Show Extended Tag Options", false)); + d->addExtraTagsCheckBox->setChecked(grp.readEntry("Add Extra Tags", false)); + d->stripSpaceTagsCheckBox->setChecked(grp.readEntry("Strip Space From Tags", false)); d->publicCheckBox->setChecked(grp.readEntry("Public Sharing", false)); d->familyCheckBox->setChecked(grp.readEntry("Family Sharing", false)); d->friendsCheckBox->setChecked(grp.readEntry("Friends Sharing", false)); d->extendedPublicationButton->setChecked(grp.readEntry("Show Extended Publication Options", false)); int safetyLevel = d->safetyLevelComboBox->findData(QVariant(grp.readEntry("Safety Level", 0))); if (safetyLevel == -1) { safetyLevel = 0; } d->safetyLevelComboBox->setCurrentIndex(safetyLevel); int contentType = d->contentTypeComboBox->findData(QVariant(grp.readEntry("Content Type", 0))); if (contentType == -1) { contentType = 0; } d->contentTypeComboBox->setCurrentIndex(contentType); d->originalCheckBox->setChecked(grp.readEntry("Upload Original", false)); d->resizeCheckBox->setChecked(grp.readEntry("Resize", false)); d->dimensionSpinBox->setValue(grp.readEntry("Maximum Width", 1600)); d->imageQualitySpinBox->setValue(grp.readEntry("Image Quality", 85)); winId(); KConfigGroup dialogGroup = config.group(QString::fromLatin1("%1Export Dialog").arg(d->serviceName)); KWindowConfig::restoreWindowSize(windowHandle(), dialogGroup); resize(windowHandle()->size()); } void FlickrWindow::writeSettings() { KConfig config; - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Group name is : "<serviceName,d->username); + QString groupName = QString::fromLatin1("%1%2Export Settings").arg(d->serviceName, d->username); + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Group name is:" << groupName; - if (QString::compare(QString::fromLatin1("%1Export Settings").arg(d->serviceName), - QString::fromLatin1("%1%2Export Settings").arg(d->serviceName, d->username), Qt::CaseInsensitive) == 0) + if (QString::compare(QString::fromLatin1("%1Export Settings").arg(d->serviceName), groupName) == 0) { - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Not writing entry of group " << QString::fromLatin1("%1%2Export Settings").arg(d->serviceName,d->username); + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Not writing entry of group" << groupName; return; } - KConfigGroup grp = config.group(QString::fromLatin1("%1%2Export Settings").arg(d->serviceName, d->username)); + KConfigGroup grp = config.group(groupName); + grp.writeEntry("username", d->username); grp.writeEntry("Export Host Tags", d->exportHostTagsCheckBox->isChecked()); grp.writeEntry("Show Extended Tag Options", d->extendedTagsButton->isChecked()); grp.writeEntry("Add Extra Tags", d->addExtraTagsCheckBox->isChecked()); grp.writeEntry("Strip Space From Tags", d->stripSpaceTagsCheckBox->isChecked()); grp.writeEntry("Public Sharing", d->publicCheckBox->isChecked()); grp.writeEntry("Family Sharing", d->familyCheckBox->isChecked()); grp.writeEntry("Friends Sharing", d->friendsCheckBox->isChecked()); grp.writeEntry("Show Extended Publication Options", d->extendedPublicationButton->isChecked()); int safetyLevel = d->safetyLevelComboBox->itemData(d->safetyLevelComboBox->currentIndex()).toInt(); grp.writeEntry("Safety Level", safetyLevel); int contentType = d->contentTypeComboBox->itemData(d->contentTypeComboBox->currentIndex()).toInt(); grp.writeEntry("Content Type", contentType); grp.writeEntry("Resize", d->resizeCheckBox->isChecked()); grp.writeEntry("Upload Original", d->originalCheckBox->isChecked()); grp.writeEntry("Maximum Width", d->dimensionSpinBox->value()); grp.writeEntry("Image Quality", d->imageQualitySpinBox->value()); KConfigGroup dialogGroup = config.group(QString::fromLatin1("%1Export Dialog").arg(d->serviceName)); KWindowConfig::saveWindowSize(windowHandle(), dialogGroup); config.sync(); } void FlickrWindow::slotLinkingSucceeded() { d->username = d->talker->getUserName(); d->userId = d->talker->getUserId(); - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "SlotLinkingSucceeded invoked setting user Display name to " << d->username; + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "SlotLinkingSucceeded invoked setting user Display name to" << d->username; d->userNameDisplayLabel->setText(QString::fromLatin1("%1").arg(d->username)); KConfig config; foreach(const QString& group, config.groupList()) { if (!(group.contains(d->serviceName))) continue; KConfigGroup grp = config.group(group); if (group.contains(d->username)) { readSettings(d->username); break; } } writeSettings(); d->talker->listPhotoSets(); } void FlickrWindow::slotBusy(bool val) { if (val) { setCursor(Qt::WaitCursor); } else { setCursor(Qt::ArrowCursor); } } void FlickrWindow::slotError(const QString& msg) { QMessageBox::critical(this, i18n("Error"), msg); } void FlickrWindow::slotUserChangeRequest() { writeSettings(); d->userNameDisplayLabel->setText(QString()); - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Slot Change User Request "; + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Slot Change User Request"; d->select->reactivate(); readSettings(d->select->getUserName()); d->talker->link(d->select->getUserName()); } void FlickrWindow::slotRemoveAccount() { KConfig config; - KConfigGroup grp = config.group(QString::fromLatin1("%1%2Export Settings").arg(d->serviceName).arg(d->username)); + QString groupName = QString::fromLatin1("%1%2Export Settings").arg(d->serviceName, d->username); + KConfigGroup grp = config.group(groupName); if (grp.exists()) { - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Removing Account having group"<serviceName); + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Removing Account having group" << groupName; grp.deleteGroup(); } d->talker->unLink(); d->talker->removeUserName(d->serviceName + d->username); d->userNameDisplayLabel->setText(QString()); d->username = QString(); } /** * Try to guess a sensible set name from the urls given. * Currently, it extracs the last path name component, and returns the most * frequently seen. The function could be expanded to, for example, only * accept the path if it occurs at least 50% of the time. It could also look * further up in the path name. */ QString FlickrWindow::guessSensibleSetName(const QList& urlList) const { QMap nrFolderOccurences; // Extract last component of directory foreach(const QUrl& url, urlList) { QString dir = url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile(); QStringList list = dir.split(QLatin1Char('/')); if (list.isEmpty()) continue; nrFolderOccurences[list.last()]++; } int maxCount = 0; int totalCount = 0; QString name; for (QMap::const_iterator it = nrFolderOccurences.constBegin(); it != nrFolderOccurences.constEnd() ; ++it) { totalCount += it.value(); if (it.value() > maxCount) { maxCount = it.value(); name = it.key(); } } // If there is only one entry or one name appears at least twice, return the suggestion if (totalCount == 1 || maxCount > 1) return name; return QString(); } /** This method is called when the photo set creation button is pressed. It * summons a creation dialog for user input. When that is closed, it * creates a new photo set in the local list. The id gets the form of * UNDEFINED_ followed by a number, to indicate that it doesn't exist on * Flickr yet. */ void FlickrWindow::slotCreateNewPhotoSet() { if (d->albumDlg->exec() == QDialog::Accepted) { FPhotoSet fps; d->albumDlg->getFolderProperties(fps); - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "in slotCreateNewPhotoSet() " << fps.title; + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "in slotCreateNewPhotoSet()" << fps.title; // Lets find an UNDEFINED_ style id that isn't taken yet.s QString id; int i = 0; id = QString::fromLatin1("UNDEFINED_") + QString::number(i); QLinkedList::iterator it = d->talker->m_photoSetsList->begin(); while (it != d->talker->m_photoSetsList->end()) { FPhotoSet fps = *it; if (fps.id == id) { id = QString::fromLatin1("UNDEFINED_") + QString::number(++i); it = d->talker->m_photoSetsList->begin(); } ++it; } fps.id = id; - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Created new photoset with temporary id " << id; + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Created new photoset with temporary id" << id; // Append the new photoset to the list. d->talker->m_photoSetsList->prepend(fps); d->talker->m_selectedPhotoSet = fps; // Re-populate the photo sets combo box. slotPopulatePhotoSetComboBox(); } else { - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "New Photoset creation aborted "; + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "New Photoset creation aborted"; } } void FlickrWindow::slotAuthCancel() { d->talker->cancel(); d->authProgressDlg->hide(); } void FlickrWindow::slotPopulatePhotoSetComboBox() { qCDebug(DIGIKAM_WEBSERVICES_LOG) << "slotPopulatePhotoSetComboBox invoked"; if (d->talker && d->talker->m_photoSetsList) { QLinkedList * const list = d->talker->m_photoSetsList; d->albumsListComboBox->clear(); d->albumsListComboBox->insertItem(0, i18n("Photostream Only")); d->albumsListComboBox->insertSeparator(1); QLinkedList::iterator it = list->begin(); int index = 2; int curr_index = 0; while (it != list->end()) { FPhotoSet photoSet = *it; QString name = photoSet.title; // Store the id as user data, because the title is not unique. QVariant id = QVariant(photoSet.id); if (id == d->talker->m_selectedPhotoSet.id) { curr_index = index; } d->albumsListComboBox->insertItem(index++, name, id); ++it; } d->albumsListComboBox->setCurrentIndex(curr_index); } } /** This slot is call when 'Start Uploading' button is pressed. */ void FlickrWindow::slotUser1() { qCDebug(DIGIKAM_WEBSERVICES_LOG) << "SlotUploadImages invoked"; //d->widget->d->tab->setCurrentIndex(FlickrWidget::FILELIST); if (d->imglst->imageUrls().isEmpty()) { return; } typedef QPair Pair; d->uploadQueue.clear(); for (int i = 0; i < d->imglst->listView()->topLevelItemCount(); ++i) { FlickrListViewItem* const lvItem = dynamic_cast(d->imglst->listView()->topLevelItem(i)); if (lvItem) { DItemInfo info(d->iface->itemInfo(lvItem->url())); - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Adding images"<< lvItem->url() << " to the list"; + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Adding images" << lvItem->url() << " to the list"; FPhotoInfo temp; temp.title = info.title(); temp.description = info.comment(); temp.size = info.fileSize(); temp.is_public = lvItem->isPublic() ? 1 : 0; temp.is_family = lvItem->isFamily() ? 1 : 0; temp.is_friend = lvItem->isFriends() ? 1 : 0; temp.safety_level = lvItem->safetyLevel(); temp.content_type = lvItem->contentType(); QStringList tagsFromDialog = d->tagsLineEdit->text().split(QLatin1Char(','), QString::SkipEmptyParts); QStringList tagsFromList = lvItem->extraTags(); QStringList allTags; QStringList::Iterator itTags; // Tags from the dialog itTags = tagsFromDialog.begin(); while (itTags != tagsFromDialog.end()) { allTags.append(*itTags); ++itTags; } // Tags from the database if (d->exportHostTagsCheckBox->isChecked()) { QStringList tagsFromDatabase; tagsFromDatabase = info.keywords(); itTags = tagsFromDatabase.begin(); while (itTags != tagsFromDatabase.end()) { allTags.append(*itTags); ++itTags; } } // Tags from the list view. itTags = tagsFromList.begin(); while (itTags != tagsFromList.end()) { allTags.append(*itTags); ++itTags; } // Remove spaces if the user doesn't like them. if (d->stripSpaceTagsCheckBox->isChecked()) { for (QStringList::iterator it = allTags.begin(); it != allTags.end(); ++it) { *it = (*it).trimmed().remove(QLatin1Char(' ')); } } // Debug the tag list. itTags = allTags.begin(); while (itTags != allTags.end()) { - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Tags list: " << (*itTags); + qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Tags list:" << (*itTags); ++itTags; } temp.tags = allTags; d->uploadQueue.append(Pair(lvItem->url(), temp)); } } d->uploadTotal = d->uploadQueue.count(); d->uploadCount = 0; d->widget->progressBar()->reset(); slotAddPhotoNext(); qCDebug(DIGIKAM_WEBSERVICES_LOG) << "SlotUploadImages done"; } void FlickrWindow::slotAddPhotoNext() { if (d->uploadQueue.isEmpty()) { d->widget->progressBar()->reset(); setUiInProgressState(false); return; } typedef QPair Pair; Pair pathComments = d->uploadQueue.first(); FPhotoInfo info = pathComments.second; QString selectedPhotoSetId = d->albumsListComboBox->itemData(d->albumsListComboBox->currentIndex()).toString(); if (selectedPhotoSetId.isEmpty()) { d->talker->m_selectedPhotoSet = FPhotoSet(); } else { QLinkedList::iterator it = d->talker->m_photoSetsList->begin(); while (it != d->talker->m_photoSetsList->end()) { if (it->id == selectedPhotoSetId) { d->talker->m_selectedPhotoSet = *it; break; } ++it; } } - qCDebug(DIGIKAM_WEBSERVICES_LOG) << "Max allowed file size is : "<<((d->talker->getMaxAllowedFileSize()).toLongLong())<<"File Size is "<talker->getMaxAllowedFileSize().toLongLong() + << " File Size is" << info.size; bool res = d->talker->addPhoto(pathComments.first.toLocalFile(), //the file path info, d->originalCheckBox->isChecked(), d->resizeCheckBox->isChecked(), d->dimensionSpinBox->value(), d->imageQualitySpinBox->value()); if (!res) { slotAddPhotoFailed(QString::fromLatin1("")); return; } if (d->widget->progressBar()->isHidden()) { setUiInProgressState(true); d->widget->progressBar()->progressScheduled(i18n("Flickr Export"), true, true); d->widget->progressBar()->progressThumbnailChanged(QIcon(QLatin1String("flickr")).pixmap(22, 22)); } } void FlickrWindow::slotAddPhotoSucceeded() { // Remove photo uploaded from the list d->imglst->removeItemByUrl(d->uploadQueue.first().first); d->uploadQueue.removeFirst(); d->uploadCount++; d->widget->progressBar()->setMaximum(d->uploadTotal); d->widget->progressBar()->setValue(d->uploadCount); slotAddPhotoNext(); } void FlickrWindow::slotListPhotoSetsFailed(const QString& msg) { - QMessageBox::critical(this, QString::fromLatin1("Error"), i18n("Failed to Fetch Photoset information from %1. %2\n", d->serviceName, msg)); + QMessageBox::critical(this, QString::fromLatin1("Error"), + i18n("Failed to Fetch Photoset information from %1. %2\n", + d->serviceName, msg)); } void FlickrWindow::slotAddPhotoFailed(const QString& msg) { QPointer warn = new QMessageBox(QMessageBox::Warning, i18n("Warning"), - i18n("Failed to upload photo into %1. %2\nDo you want to continue?", d->serviceName, msg), + i18n("Failed to upload photo into %1. %2\nDo you want to continue?", + d->serviceName, msg), QMessageBox::Yes | QMessageBox::No); (warn->button(QMessageBox::Yes))->setText(i18n("Continue")); (warn->button(QMessageBox::No))->setText(i18n("Cancel")); if (warn->exec() != QMessageBox::Yes) { d->uploadQueue.clear(); d->widget->progressBar()->reset(); setUiInProgressState(false); } else { d->uploadQueue.removeFirst(); d->uploadTotal--; d->widget->progressBar()->setMaximum(d->uploadTotal); d->widget->progressBar()->setValue(d->uploadCount); slotAddPhotoNext(); } delete warn; } /* Method called when a photo set has been successfully created on Flickr. * It functions to restart the normal flow after a photo set has been created * on Flickr. */ void FlickrWindow::slotAddPhotoSetSucceeded() { slotPopulatePhotoSetComboBox(); slotAddPhotoSucceeded(); } void FlickrWindow::slotImageListChanged() { startButton()->setEnabled(!(d->widget->d->imglst->imageUrls().isEmpty())); } void FlickrWindow::slotReloadPhotoSetRequest() { d->talker->listPhotoSets(); } } // namespace Digikam