Bug 88883 - Calls ImageCollectionShared::category and ImageCollectionShared::date without correct features
Summary: Calls ImageCollectionShared::category and ImageCollectionShared::date without...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-Plugins (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-05 13:43 UTC by Jesper Pedersen
Modified: 2022-02-06 05:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Pedersen 2004-09-05 13:43:58 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

The cdarchiving plugin calls
KIPI::ImageCollectionShared::category and KIPI::ImageCollectionShared::date even though the
KIPI::Features AlbumsHaveCategory and AlbumsHaveCreationDate are not present.

This is the case for KimDaBa, so you may use that as test case to check if it is fixed.
Comment 1 Renchi Raju 2004-12-22 06:16:08 UTC
CVS commit by pahlibar: 


respect host app settings and check for features before actually accessing them
BUG: 88883


  M +37 -15    cdarchiving.cpp   1.38


--- kdeextragear-libs-1/kipi-plugins/cdarchiving/cdarchiving.cpp  #1.37:1.38
@@ -312,7 +312,19 @@ bool CDArchiving::prepare(void)
          albumIt != albumsList.end() ; ++albumIt )
         {
-        AlbumData data((*albumIt).name(),    (*albumIt).category(),
-                       (*albumIt).comment(), (*albumIt).date(), 
-                       (*albumIt).path(),    (*albumIt).images());
+        AlbumData data((*albumIt).name(),
+
+                       m_interface->hasFeature(KIPI::AlbumsHaveCategory) ?
+                       (*albumIt).category() : QString(),
+
+                       m_interface->hasFeature(KIPI::AlbumsHaveComments) ?
+                       (*albumIt).comment()  : QString(),
+
+                       m_interface->hasFeature(KIPI::AlbumsHaveCreationDate) ?
+                       (*albumIt).date() : QDate(),
+
+                       (*albumIt).isDirectory() ?
+                       (*albumIt).path() : QString(),
+
+                       (*albumIt).images());
         
         m_albumsMap->insert( (*albumIt).path().prettyURL(), data );
@@ -583,7 +595,10 @@ bool CDArchiving::buildHTMLInterface (vo
 
         m_AlbumTitle      = data.albumName();
-        m_AlbumComments   = data.albumComments();
-        m_AlbumCollection = data.albumCategory();
-        m_AlbumDate       = data.albumDate().toString();
+        m_AlbumComments   = m_interface->hasFeature(KIPI::AlbumsHaveComments) ?
+                            data.albumComments() : QString();
+        m_AlbumCollection = m_interface->hasFeature(KIPI::AlbumsHaveCategory) ?
+                            data.albumCategory() : QString();
+        m_AlbumDate       = m_interface->hasFeature(KIPI::AlbumsHaveCreationDate) ?
+                            data.albumDate().toString() : QString();
         Path              = data.albumUrl().path();
         
@@ -807,8 +822,11 @@ void CDArchiving::createBody(QTextStream
     stream << "<tr valign=top><td align=left>\n" << endl;
 
+    if (m_interface->hasFeature(KIPI::AlbumsHaveComments))
     stream << i18n("<i>Comment:</i>") << "<br>\n" << endl;
 
+    if (m_interface->hasFeature(KIPI::AlbumsHaveCategory))        
     stream << i18n("<i>Collection:</i>") << "<br>\n" << endl;
 
+    if (m_interface->hasFeature(KIPI::AlbumsHaveCreationDate))
     stream << i18n("<i>Date:</i>") << "<br>\n" << endl;
 
@@ -817,9 +835,13 @@ void CDArchiving::createBody(QTextStream
     stream << "</td><td align=left>\n" << endl;
 
-    stream << EscapeSgmlText(QTextCodec::codecForLocale(), m_AlbumComments, true, true)
+    if (m_interface->hasFeature(KIPI::AlbumsHaveComments))
+        stream << EscapeSgmlText(QTextCodec::codecForLocale(),
+                                 m_AlbumComments, true, true)
            << "<br>\n" << endl;
 
+    if (m_interface->hasFeature(KIPI::AlbumsHaveCategory))        
     stream << m_AlbumCollection << "<br>\n" << endl;
 
+    if (m_interface->hasFeature(KIPI::AlbumsHaveCreationDate))
     stream << m_AlbumDate << "<br>\n" << endl;