Bug 119075 - wish list new folder date option
Summary: wish list new folder date option
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Import-Albums (show other bugs)
Version: 0.8.0
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-27 20:16 UTC by Ted Hansen
Modified: 2017-08-16 09:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ted Hansen 2005-12-27 20:16:11 UTC
Version:           0.8.0 (using KDE 3.5.0, Debian Package 4:3.5.0-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.13-kanotix-9

Automatically created sub-folders dialog (created in response to bug 92312--now resolved) works well but would it be possible to add an optional setting to use the current date (ie the download date) instead of the date the photo was taken for the subfolder name? 

Thanks.

PS: It was this feature and the automatically orient photo according to EXIF data that finally got my main user away from switching to windows to download her camera pictures. Thanks.
Comment 1 Tom Albers 2005-12-29 18:43:21 UTC
I think this will be a feature not used by many people. Most people who want to download to a folder based on exif-data or create a folder with a custom name, which you can do as well of course. imho wontfix.
Comment 2 Ted Hansen 2005-12-29 19:29:34 UTC
O.K. 
It would be nice especially if you have photos to download taken over many days but with only one or two photos per day but it's not a big deal. Using the default date & not using the 'automatically create subfolders' achieves the same result except that the date is then in long format & will be out of sequence with the automatically created subfolders when sorted alphabetically. 
Perhaps there could be a format option for this the default date which would achieve the same thing?
Comment 3 caulier.gilles 2006-08-24 17:28:53 UTC
SVN commit 576672 by cgilles:

digikam from trunk : camera gui improvements : new option to set configurable date format for auto album creation.

BUG: 119075, 128817

 M  +68 -13    cameraui.cpp  


--- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #576671:576672
@@ -110,6 +110,13 @@
 {
 public:
 
+    enum DateFormatOptions
+    {
+        IsoDateFormat=0,
+        TextDateFormat,
+        LocalDateFormat
+    };
+
     CameraUIPriv()
     {
         busy              = false;
@@ -137,6 +144,8 @@
         losslessFormat    = 0;
         convertJpegCheck  = 0;
         formatLabel       = 0;
+        folderDateLabel   = 0;
+        folderDateFormat  = 0;
     }
 
     bool                          busy;
@@ -162,8 +171,10 @@
     QCheckBox                    *convertJpegCheck;
 
     QLabel                       *formatLabel;
+    QLabel                       *folderDateLabel;
 
     QComboBox                    *losslessFormat;
+    QComboBox                    *folderDateFormat;
 
     QSplitter                    *splitter;
 
@@ -233,9 +244,19 @@
     d->renameCustomizer  = new RenameCustomizer(d->advBox);
     d->view->setRenameCustomizer(d->renameCustomizer);
         
+    // -- Albums Auto-creation options -----------------------------------------
+
     QVGroupBox* albumBox = new QVGroupBox(i18n("Auto-creation of Albums"), d->advBox);
     d->autoAlbumCheck    = new QCheckBox(i18n("Date-based sub-albums"), albumBox);
+    QHBox *hbox1         = new QHBox(albumBox);
+    d->folderDateLabel   = new QLabel(i18n("Date format:"), hbox1);
+    d->folderDateFormat  = new QComboBox(hbox1);
+    d->folderDateFormat->insertItem(i18n("ISO"),             CameraUIPriv::IsoDateFormat);
+    d->folderDateFormat->insertItem(i18n("Full Text"),       CameraUIPriv::TextDateFormat);
+    d->folderDateFormat->insertItem(i18n("Local Settings"),  CameraUIPriv::LocalDateFormat);
 
+    // -- On the Fly options ---------------------------------------------------
+
     QVGroupBox* onFlyBox = new QVGroupBox(i18n("On the Fly Operations (JPEG only)"), d->advBox);
     d->setPhotographerId = new QCheckBox(i18n("Set default photographer identity"), onFlyBox);
     d->setCredits        = new QCheckBox(i18n("Set default credit and copyright"), onFlyBox);
@@ -243,9 +264,9 @@
     d->dateTimeEdit      = new KDateTimeEdit(onFlyBox, "datepicker");
     d->autoRotateCheck   = new QCheckBox(i18n("Auto-rotate/flip image"), onFlyBox);
     d->convertJpegCheck  = new QCheckBox(i18n("Convert to lossless file format"), onFlyBox);
-    QHBox *hbox          = new QHBox(onFlyBox);
-    d->formatLabel       = new QLabel(i18n("New image format:"), hbox);
-    d->losslessFormat    = new QComboBox(hbox);
+    QHBox *hbox2         = new QHBox(onFlyBox);
+    d->formatLabel       = new QLabel(i18n("New image format:"), hbox2);
+    d->losslessFormat    = new QComboBox(hbox2);
     d->losslessFormat->insertItem("PNG", 0);
     
     QWhatsThis::add( d->autoRotateCheck, i18n("<p>Toogle on this option if you want automatically "
@@ -362,6 +383,12 @@
 
     // -------------------------------------------------------------------------
     
+    connect(d->autoAlbumCheck, SIGNAL(toggled(bool)),
+            d->folderDateFormat, SLOT(setEnabled(bool)));
+
+    connect(d->autoAlbumCheck, SIGNAL(toggled(bool)),
+            d->folderDateLabel, SLOT(setEnabled(bool)));
+
     connect(d->convertJpegCheck, SIGNAL(toggled(bool)),
             d->losslessFormat, SLOT(setEnabled(bool)));
 
@@ -492,6 +519,7 @@
     d->setCredits->setChecked(config->readBoolEntry("SetCredits", false));
     d->convertJpegCheck->setChecked(config->readBoolEntry("ConvertJpeg", false));
     d->losslessFormat->setCurrentItem(config->readNumEntry("LossLessFormat", 0));   // PNG by default
+    d->folderDateFormat->setCurrentItem(config->readNumEntry("FolderDateFormat", CameraUIPriv::IsoDateFormat));
 
     d->view->setThumbnailSize(ThumbnailSize((ThumbnailSize::Size)config->readNumEntry("ThumbnailSize", 
                               ThumbnailSize::Large)));
@@ -502,6 +530,9 @@
     d->dateTimeEdit->setEnabled(d->fixDateTimeCheck->isChecked());
     d->losslessFormat->setEnabled(convertLosslessJpegFiles());
     d->formatLabel->setEnabled(convertLosslessJpegFiles());
+    d->folderDateFormat->setEnabled(d->autoAlbumCheck->isChecked());
+    d->folderDateLabel->setEnabled(d->autoAlbumCheck->isChecked());
+
     resize(configDialogSize("Camera Settings"));
 }
 
@@ -520,6 +551,7 @@
     config->writeEntry("LossLessFormat", d->losslessFormat->currentItem());
     config->writeEntry("ThumbnailSize", d->view->thumbnailSize().size());
     config->writeEntry("Splitter Sizes", d->splitter->sizes());
+    config->writeEntry("FolderDateFormat", d->folderDateFormat->currentItem());
     config->sync();
 }
 
@@ -964,12 +996,21 @@
     {
         CameraIconViewItem* iconItem = static_cast<CameraIconViewItem*>(firstItem);
         
-        QDateTime date;
-        date.setTime_t(iconItem->itemInfo()->mtime);
-        newDirName = QString("%1, %2, %3")
-                     .arg(KGlobal::locale()->calendar()->year(date.date()))
-                     .arg(KGlobal::locale()->calendar()->monthName(date.date()))
-                     .arg(KGlobal::locale()->calendar()->day(date.date()));
+        QDateTime dateTime;
+        dateTime.setTime_t(iconItem->itemInfo()->mtime);
+
+        switch(d->folderDateFormat->currentItem())
+        {
+            case CameraUIPriv::TextDateFormat:
+                newDirName = dateTime.date().toString(Qt::TextDate);
+                break;
+            case CameraUIPriv::LocalDateFormat:
+                newDirName = dateTime.date().toString(Qt::LocalDate);
+                break;
+            default:        // IsoDateFormat
+                newDirName = dateTime.date().toString(Qt::ISODate);
+                break;
+        }
     }
 
     album = AlbumSelectDialog::selectAlbum(this, (PAlbum*)album, header, newDirName,
@@ -1026,11 +1067,25 @@
         
         if (d->autoAlbumCheck->isChecked())
         {
-            QDateTime date;
-            date.setTime_t(mtime);
-            QString dirName(date.toString("yyyy-MM-dd"));
+            QDateTime dateTime;
+            dateTime.setTime_t(mtime);
+            QString dirName;;
+
+            switch(d->folderDateFormat->currentItem())
+            {
+                case CameraUIPriv::TextDateFormat:
+                    dirName = dateTime.date().toString(Qt::TextDate);
+                    break;
+                case CameraUIPriv::LocalDateFormat:
+                    dirName = dateTime.date().toString(Qt::LocalDate);
+                    break;
+                default:        // IsoDateFormat
+                    dirName = dateTime.date().toString(Qt::ISODate);
+                    break;
+            }
+
             QString errMsg;
-            if (!createAutoAlbum(url, dirName, date.date(), errMsg))
+            if (!createAutoAlbum(url, dirName, dateTime.date(), errMsg))
             {
                 KMessageBox::error(this, errMsg);
                 return;