summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-05-02 21:01:37 +0200
committerMontel Laurent <[email protected]>2016-05-02 21:01:37 +0200
commit877641c2c0090c4fb0a26504310ad969f5b77ee7 (patch)
tree54f6e487b2013492d3d4b735d03a1a11e0891457
parent90e28533bc16a1f295ca5624dee519844c9e6200 (diff)
Move variable in private class
-rw-r--r--messageviewer/src/header/grantleeheaderstyle.cpp27
-rw-r--r--messageviewer/src/header/grantleeheaderstyle.h4
2 files changed, 21 insertions, 10 deletions
diff --git a/messageviewer/src/header/grantleeheaderstyle.cpp b/messageviewer/src/header/grantleeheaderstyle.cpp
index db58ee8..ae4e89f 100644
--- a/messageviewer/src/header/grantleeheaderstyle.cpp
+++ b/messageviewer/src/header/grantleeheaderstyle.cpp
@@ -18,23 +18,36 @@
#include "grantleeheaderstyle.h"
#include "header/grantleeheaderformatter.h"
#include "header/headerstrategy.h"
+#include "grantleetheme/grantleetheme.h"
#include <kmime/kmime_message.h>
using namespace MessageViewer;
-
-namespace MessageViewer
+class MessageViewer::GrantleeHeaderStylePrivate
{
+public:
+ GrantleeHeaderStylePrivate()
+ : mGrantleeFormatter(Q_NULLPTR)
+ {
+ mGrantleeFormatter = new GrantleeHeaderFormatter;
+ }
+ ~GrantleeHeaderStylePrivate()
+ {
+ delete mGrantleeFormatter;
+ }
+
+ GrantleeHeaderFormatter *mGrantleeFormatter;
+};
GrantleeHeaderStyle::GrantleeHeaderStyle()
- : HeaderStyle()
+ : HeaderStyle(),
+ d(new MessageViewer::GrantleeHeaderStylePrivate)
{
- mGrantleeFormatter = new GrantleeHeaderFormatter;
}
GrantleeHeaderStyle::~GrantleeHeaderStyle()
{
- delete mGrantleeFormatter;
+ delete d;
}
const char *GrantleeHeaderStyle::name() const
@@ -47,12 +60,10 @@ QString GrantleeHeaderStyle::format(KMime::Message *message) const
if (!message) {
return QString();
}
- return mGrantleeFormatter->toHtml(theme(), isPrinting(), this, message);
+ return d->mGrantleeFormatter->toHtml(theme(), isPrinting(), this, message);
}
bool GrantleeHeaderStyle::hasAttachmentQuickList() const
{
return true;
}
-
-}
diff --git a/messageviewer/src/header/grantleeheaderstyle.h b/messageviewer/src/header/grantleeheaderstyle.h
index af44243..4ab2545 100644
--- a/messageviewer/src/header/grantleeheaderstyle.h
+++ b/messageviewer/src/header/grantleeheaderstyle.h
@@ -23,7 +23,7 @@
namespace MessageViewer
{
class GrantleeHeaderFormatter;
-//Temporary.
+class GrantleeHeaderStylePrivate;
class MESSAGEVIEWER_EXPORT GrantleeHeaderStyle : public HeaderStyle
{
public:
@@ -38,7 +38,7 @@ public:
bool hasAttachmentQuickList() const Q_DECL_OVERRIDE;
private:
- GrantleeHeaderFormatter *mGrantleeFormatter;
+ GrantleeHeaderStylePrivate *const d;
};
}
#endif // GRANTLEEHEADERSTYLE_H