Bug 97069 - e-mail contains comments file even if there are no comments
Summary: e-mail contains comments file even if there are no comments
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-SendByMail (show other bugs)
Version: 5.6.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-15 14:40 UTC by David Anderson
Modified: 2022-01-15 18:04 UTC (History)
0 users

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 David Anderson 2005-01-15 14:40:13 UTC
Version:           0.7.1 (using KDE 3.3.2-1.4.2.kde, Fedora Core release 2 (Tettnang))
Compiler:          gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
OS:                Linux (i686) release 2.6.7-1.494.2.2

Steps to reproduce:

1. Select some images (which have no comments) to e-mail.

Expected Results:

- No useless "comments.txt" file attached to e-mail which just contains a load of lines saying "no comments"

Results:

- comments.txt file with useless information attached to e-mail

Further info: kipi-plugins-0.1-0.fdr.0.3.beta1.2 (kde-redhat)
Comment 1 Renchi Raju 2005-01-22 01:03:32 UTC
CVS commit by pahlibar: 


don't add the comments file if there are no comments
BUG: 97069


  M +34 -27    sendimages.cpp   1.20


--- kdeextragear-libs-1/kipi-plugins/sendimages/sendimages.cpp  #1.19:1.20
@@ -247,4 +247,6 @@ void SendImages::makeCommentsFile(void)
        KURL::List::Iterator it = m_imagesPackage.begin();
 
+        bool anyCommentsPresent = false;
+       
        while( it != m_imagesPackage.end() )
           {
@@ -257,4 +259,6 @@ void SendImages::makeCommentsFile(void)
           if ( commentItem.isEmpty() )
               commentItem = i18n("no comment");
+            else
+                anyCommentsPresent = true;
 
           ImageCommentsText = ImageCommentsText +
@@ -265,4 +269,6 @@ void SendImages::makeCommentsFile(void)
           }
 
+        if ( anyCommentsPresent )
+        {
        QFile commentsFile( m_tmp + i18n("comments.txt") );
        QTextStream stream( &commentsFile );
@@ -273,4 +279,5 @@ void SendImages::makeCommentsFile(void)
        m_filesSendList.append( m_tmp + i18n("comments.txt") );
        }
+    }
 }