[Digikam-devel] [Bug 149983] show recursively sub-album images

Arnd Baecker arnd.baecker at web.de
Wed Sep 19 07:12:22 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=149983         




------- Additional Comments From arnd.baecker web de  2007-09-19 08:12 -------
Hi Sebastien,

as IRC client you may use the KDE programm `konversation`
(Gilles is usually around in the evenings).
Gilles is available via:  caulier dot gilles  at gmail dot com  ,
but for the moment we can keep the discussion here.

To get started:
- first get the current version from svn working
  (I.e. follow http://www.digikam.org/?q=download/svn
   under "Install digiKam in your Home Directory"
  Note that the current svn version of exiv2 already
  needs XMP support, so v0.15 should be good enough)
- subscribe to Digikam-users and Digikam-devel
  (unless you have already done so ;-)

Now concerning the problem itself, let me try to
give you a few pointers (note that I am a real beginner
in poking around in digikams code, so all the following
might not be correct and should be double-checked by you ...;):

- When an album is selected,
  void DigikamApp::slotAlbumSelected(bool val)
  in graphics/digikam/digikam/digikamapp.cpp
  is called.
  There are different types of albums:
  - PAlbum (physical)
  - TAlbum (tags)
  - SAlbum (search)
  - DAlbum (date)
  The last three are virtual and all are derived from
   Album, which is the parent class (see album.cpp)
  Palbum is the one of interest,
  while for TAlbum the recursive view already works.
  (For SAlbum it does not make sense and for DAlbum,
   well, watching a whole year does not work.
  )

- I *think* (please check!)
  that in the end
    void AlbumLister::openAlbum(Album *album)
  in albumlister.cpp  is called,
  which then transfers the real job of digging
  out the album to kio_digikamalbums:
       // Protocol = digikamalbums -> kio_digikamalbums
      d->job = new KIO::TransferJob(album->kurl(), KIO::CMD_SPECIAL,
                                    ba, QByteArray(), false);
 where album->kurl() is essentially the path of the selected album.
 To check you could just add a
   DWarning() << "Right album?: " << album->kurl() << endl;
 before that statement and see if it arrives there.

 If this is true, the next step is to start digging
 KIO::TransferJob and see how one can add recursive
 subfolder view.

- Well, I had a further look, and it seems
  that the relevant routine is
  void kio_digikamalbums::special(const QByteArray& data)
   in digikam/kioslave/digikamalbums.cpp
  where the calls
    QStringList values;
    m_sqlDB.execSql(QString("SELECT id FROM Albums WHERE url='%1';")
                    .arg(escapeString(url)), &values);
    int albumid = values.first().toInt();


    values.clear();
    m_sqlDB.execSql(QString("SELECT id, name, datetime FROM Images "
                                    "WHERE dirid = %1;")
                            .arg(albumid), &values);
  are done.
  If one modifies the query, as discussed in
    http://bugs.kde.org/show_bug.cgi?id=149983
  this might already do the job...

So, before you try to make it configurable, I would
recommend to try to just always activate it. Adding
the configuration stuff is the simpler bit.

All looks complicated at first glance, but you will
get used to that very quickly, I am sure!

Hope this helps a bit,

Arnd



More information about the Digikam-devel mailing list