aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <[email protected]>2017-08-04 11:25:39 +0200
committerDaniel Vrátil <[email protected]>2017-08-04 11:25:39 +0200
commit265a9d104d978e902e3d95e3fa3aa0c8d815cf34 (patch)
tree104d39b120671451b8aef34fad95f3056119ba70
parent232642f26d464085ac342227afead2bc0cd1384a (diff)
Introduce KMime::Content::headers()
A simple getter to get a vector of all headers in a part. Differential Revision: https://phabricator.kde.org/D7075
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/kmime_content.cpp5
-rw-r--r--src/kmime_content.h6
3 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 60d00fa..e123515 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
-set(PIM_VERSION "5.6.40")
+set(PIM_VERSION "5.6.41")
project(KMime VERSION ${PIM_VERSION})
diff --git a/src/kmime_content.cpp b/src/kmime_content.cpp
index a4f8591..ca1176d 100644
--- a/src/kmime_content.cpp
+++ b/src/kmime_content.cpp
@@ -615,6 +615,11 @@ void Content::changeEncoding(Headers::contentEncoding e)
}
}
+QVector<Headers::Base*> Content::headers() const
+{
+ return d_ptr->headers;
+}
+
Headers::Base *Content::headerByType(const char *type) const
{
Q_ASSERT(type && *type);
diff --git a/src/kmime_content.h b/src/kmime_content.h
index 5ca8bbc..20134a1 100644
--- a/src/kmime_content.h
+++ b/src/kmime_content.h
@@ -248,6 +248,12 @@ public:
void setHead(const QByteArray &head);
/**
+ * Returns all headers.
+ * @since 5.7
+ */
+ QVector<Headers::Base*> headers() const;
+
+ /**
Returns the first header of type @p type, if it exists. Otherwise returns 0.
Note that the returned header may be empty.
@param type the header type to find