Commit 157fb7b3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

USe QVector

parent 832a2767
Pipeline #22908 passed with stage
in 4 minutes and 50 seconds
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.14.40") set(PIM_VERSION "5.14.41")
project(KIdentityManagement VERSION ${PIM_VERSION}) project(KIdentityManagement VERSION ${PIM_VERSION})
......
...@@ -42,29 +42,26 @@ class Q_DECL_HIDDEN KIdentityManagement::SignaturePrivate ...@@ -42,29 +42,26 @@ class Q_DECL_HIDDEN KIdentityManagement::SignaturePrivate
{ {
public: public:
SignaturePrivate(Signature *qq) SignaturePrivate(Signature *qq)
: type(Signature::Disabled) : q(qq)
, enabled(false)
, inlinedHtml(false)
, q(qq)
{ {
} }
void assignFrom(const KIdentityManagement::Signature &that); void assignFrom(const KIdentityManagement::Signature &that);
void cleanupImages(); void cleanupImages();
void saveImages() const; void saveImages() const;
QString textFromFile(bool *ok) const; Q_REQUIRED_RESULT QString textFromFile(bool *ok) const;
QString textFromCommand(bool *ok) const; Q_REQUIRED_RESULT QString textFromCommand(bool *ok) const;
void insertSignatureText(Signature::Placement placement, Signature::AddedText addedText, KPIMTextEdit::RichTextComposer *textEdit, bool forceDisplay) const; void insertSignatureText(Signature::Placement placement, Signature::AddedText addedText, KPIMTextEdit::RichTextComposer *textEdit, bool forceDisplay) const;
/// List of images that belong to this signature. Either added by addImage() or /// List of images that belong to this signature. Either added by addImage() or
/// by readConfig(). /// by readConfig().
QList<Signature::EmbeddedImagePtr> embeddedImages; QVector<Signature::EmbeddedImagePtr> embeddedImages;
/// The directory where the images will be saved to. /// The directory where the images will be saved to.
QString saveLocation; QString saveLocation;
QString path; QString path;
QString text; QString text;
Signature::Type type; Signature::Type type = Signature::Disabled;
bool enabled = false; bool enabled = false;
bool inlinedHtml = false; bool inlinedHtml = false;
Signature *q = nullptr; Signature *q = nullptr;
...@@ -516,12 +513,12 @@ void Signature::insertIntoTextEdit(Placement placement, AddedText addedText, KPI ...@@ -516,12 +513,12 @@ void Signature::insertIntoTextEdit(Placement placement, AddedText addedText, KPI
d->insertSignatureText(placement, addedText, textEdit, forceDisplay); d->insertSignatureText(placement, addedText, textEdit, forceDisplay);
} }
QList<Signature::EmbeddedImagePtr> Signature::embeddedImages() const QVector<Signature::EmbeddedImagePtr> Signature::embeddedImages() const
{ {
return d->embeddedImages; return d->embeddedImages;
} }
void Signature::setEmbeddedImages(const QList<Signature::EmbeddedImagePtr> &embedded) void Signature::setEmbeddedImages(const QVector<Signature::EmbeddedImagePtr> &embedded)
{ {
d->embeddedImages = embedded; d->embeddedImages = embedded;
} }
...@@ -542,7 +539,7 @@ QDataStream &KIdentityManagement::operator>> ...@@ -542,7 +539,7 @@ QDataStream &KIdentityManagement::operator>>
QString path; QString path;
QString text; QString text;
QString saveLocation; QString saveLocation;
QList<Signature::EmbeddedImagePtr> lst; QVector<Signature::EmbeddedImagePtr> lst;
bool enabled; bool enabled;
stream >> s >> path >> text >> saveLocation >> lst >> enabled; stream >> s >> path >> text >> saveLocation >> lst >> enabled;
sig.setText(text); sig.setText(text);
......
...@@ -242,8 +242,8 @@ public: ...@@ -242,8 +242,8 @@ public:
// with the deprecated method // with the deprecated method
void insertIntoTextEdit(Placement placement, AddedText addedText, KPIMTextEdit::RichTextComposer *textEdit, bool forceDisplay = false) const; void insertIntoTextEdit(Placement placement, AddedText addedText, KPIMTextEdit::RichTextComposer *textEdit, bool forceDisplay = false) const;
Q_REQUIRED_RESULT QList<Signature::EmbeddedImagePtr> embeddedImages() const; Q_REQUIRED_RESULT QVector<Signature::EmbeddedImagePtr> embeddedImages() const;
void setEmbeddedImages(const QList<Signature::EmbeddedImagePtr> &embedded); void setEmbeddedImages(const QVector<EmbeddedImagePtr> &embedded);
protected: protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment