[Digikam-devel] [Bug 131407] use camera GUI also for import of images from different locations

Gilles Caulier caulier.gilles at gmail.com
Thu Aug 30 10:11:29 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=131407         
caulier.gilles gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From caulier.gilles gmail com  2007-08-30 11:11 -------
SVN commit 706398 by cgilles:

digiKam from KDE3 branch : Use camera gui to import new images in digiKam album library.
The current menu option which use it is "Album/Import/Add Images".
BUG: 131407


 M  +15 -2     digikamapp.cpp  
 M  +1 -0      digikamapp.h  
 M  +0 -49     digikamview.cpp  
 M  +0 -7      digikamview.h  


--- branches/extragear/kde3/graphics/digikam/digikam/digikamapp.cpp #706397:706398
 @ -48,6 +48,8  @
 #include <kdeversion.h>
 #include <kapplication.h>
 #include <kmenubar.h>
+#include <kglobalsettings.h>
+#include <kfiledialog.h>
 #include <kmessagebox.h>
 #include <kwin.h>
 #include <dcopref.h>
 @ -541,7 +543,7  @
     d->addImagesAction = new KAction( i18n("Add Images..."),
                                     "albumfolder-importimages",
                                     CTRL+Key_I,
-                                    d->view,
+                                    this,
                                     SLOT(slotAlbumAddImages()),
                                     actionCollection(),
                                     "album_addImages");
 @ -1886,5 +1888,16  @
     d->zoomFitToWindowAction->setEnabled(t);
 }
 
+void DigikamApp::slotAlbumAddImages()
+{
+    QString path = KFileDialog::getExistingDirectory(KGlobalSettings::documentPath(), this,
+                                i18n("Select folder to parse"));
+
+    if(path.isEmpty())
+        return;
+
+    // The folder contents will be parsed by Camera interface in "Directory Browse" mode.
+    downloadFrom(path);
+}
+
 }  // namespace Digikam
-
--- branches/extragear/kde3/graphics/digikam/digikam/digikamapp.h #706397:706398
 @ -111,6 +111,7  @
 
 private slots:
 
+    void slotAlbumAddImages();
     void slotAlbumSelected(bool val);
     void slotTagSelected(bool val);
     void slotImageSelected(const QPtrList<ImageInfo>&, bool, bool);
--- branches/extragear/kde3/graphics/digikam/digikam/digikamview.cpp #706397:706398
 @ -38,7 +38,6  @
 // KDE includes.
 
 #include <kurl.h>
-#include <kfiledialog.h>
 #include <kpushbutton.h>
 #include <klocale.h>
 #include <kapplication.h>
 @ -46,7 +45,6  @
 #include <krun.h>
 #include <kiconloader.h>
 #include <kstandarddirs.h>
-#include <kimageio.h>
 
 // LibKDcraw includes.
 
 @ -889,53 +887,6  @
     applySettings(AlbumSettings::instance());
 }
 
-void DigikamView::slotAlbumAddImages()
-{
-    Album *album = d->albumManager->currentAlbum();
-    if (!album || album->type() != Album::PHYSICAL)
-        return;
-
-    PAlbum* palbum = dynamic_cast<PAlbum*>(album);
-
-    QString fileformats;
-    
-    QStringList patternList = QStringList::split('\n', KImageIO::pattern(KImageIO::Reading));
-    
-    // All Pictures from list must been always the first entry given by KDE API
-    QString allPictures = patternList[0];
-    
-    // Add other files format witch are missing to All Pictures" type mime provided by KDE and remplace current.
-    allPictures.insert(allPictures.find("|"), QString(raw_file_extentions) + QString(" *.JPE *.TIF"));
-    patternList.remove(patternList[0]);
-    patternList.prepend(allPictures);
-    
-    // Added RAW file formats supported by dcraw program like a type mime. 
-    // Nota: we cannot use here "image/x-raw" type mime from KDE because it uncomplete 
-    // or unavailable(dcraw_0)(see file #121242 in B.K.O).
-    patternList.append(QString("\n%1|Camera RAW files").arg(QString(raw_file_extentions)));
-    
-    fileformats = patternList.join("\n");
-
-    DDebug () << "fileformats=" << fileformats << endl;   
-
-    KURL::List urls = KFileDialog::getOpenURLs(AlbumManager::instance()->getLibraryPath(), 
-                                               fileformats, this, i18n("Select Image to Add"));
-
-    if (!urls.isEmpty())
-    {
-        KIO::Job* job = DIO::copy(urls, palbum->kurl());
-
-        connect(job, SIGNAL(result(KIO::Job *) ),
-                this, SLOT(slotImageCopyResult(KIO::Job *)));
-    }
-}
-
-void DigikamView::slotImageCopyResult(KIO::Job* job)
-{
-    if (job->error())
-        job->showErrorDialog(this);
-}
-
 void DigikamView::slotAlbumImportFolder()
 {
     d->folderView->albumImportFolder();
--- branches/extragear/kde3/graphics/digikam/digikam/digikamview.h #706397:706398
 @ -37,11 +37,6  @
 
 class KURL;
 
-namespace KIO
-{
-class Job;
-}
-
 namespace Digikam
 {
 class AlbumIconItem;
 @ -95,7 +90,6  @
     void slotDeleteAlbum();
     void slotSelectAlbum(const KURL &url);
     void slotAlbumPropsEdit();
-    void slotAlbumAddImages();
     void slotAlbumOpenInKonqui();
     void slotAlbumRefresh();
     void slotAlbumImportFolder();
 @ -163,7 +157,6  @
     void slotImageSelected();
     void slotTogglePreviewMode(AlbumIconItem *iconItem=0);
     void slotDispatchImageSelected();
-    void slotImageCopyResult(KIO::Job* job);
     void slotItemsInfoFromAlbums(const ImageInfoList&);
 
     void slotLeftSidebarChangedTab(QWidget* w);



More information about the Digikam-devel mailing list