aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--src/fileAttachment.cpp12
-rw-r--r--vmime/fileAttachment.hpp5
3 files changed, 21 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c251dd09..3aa31a92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@
VERSION 0.8.2cvs
================
+2008-01-28 Vincent Richard <[email protected]>
+
+ * fileAttachment: fixed constructor ambiguity due to implicit conversions.
+ Removed default values and reordered parameters (API breaking change).
+ Many thanks to Philipp Frenkel. More information here:
+ http://sourceforge.net/forum/message.php?msg_id=4739926
+
2007-11-20 Vincent Richard <[email protected]>
* text, word: fixed incorrect white-space between words.
diff --git a/src/fileAttachment.cpp b/src/fileAttachment.cpp
index fe62edc6..da4d9c4c 100644
--- a/src/fileAttachment.cpp
+++ b/src/fileAttachment.cpp
@@ -36,6 +36,16 @@ namespace vmime
{
+fileAttachment::fileAttachment(const string& filename, const mediaType& type)
+{
+ m_type = type;
+
+ setData(filename);
+
+ m_encoding = encoding::decide(m_data);
+}
+
+
fileAttachment::fileAttachment(const string& filename, const mediaType& type, const text& desc)
{
m_type = type;
@@ -48,7 +58,7 @@ fileAttachment::fileAttachment(const string& filename, const mediaType& type, co
fileAttachment::fileAttachment(const string& filename, const mediaType& type,
- const encoding& enc, const text& desc)
+ const text& desc, const encoding& enc)
{
m_type = type;
m_desc = desc;
diff --git a/vmime/fileAttachment.hpp b/vmime/fileAttachment.hpp
index f2275e97..6e80b5ae 100644
--- a/vmime/fileAttachment.hpp
+++ b/vmime/fileAttachment.hpp
@@ -41,8 +41,9 @@ class fileAttachment : public defaultAttachment
{
public:
- fileAttachment(const string& filename, const mediaType& type, const text& desc = NULL_TEXT);
- fileAttachment(const string& filename, const mediaType& type, const encoding& enc, const text& desc = NULL_TEXT);
+ fileAttachment(const string& filename, const mediaType& type);
+ fileAttachment(const string& filename, const mediaType& type, const text& desc);
+ fileAttachment(const string& filename, const mediaType& type, const text& desc, const encoding& enc);
/** Stores information about a file attachment.
*/