Commit 67fbc22b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QVector

parent 1835cc14
Pipeline #23176 passed with stage
in 12 minutes and 29 seconds
......@@ -170,7 +170,7 @@ ImageWithNameList RichTextComposerImages::imagesWithName() const
{
ImageWithNameList retImages;
QStringList seenImageNames;
const QList<QTextImageFormat> imageFormats = embeddedImageFormats();
const QVector<QTextImageFormat> imageFormats = embeddedImageFormats();
for (const QTextImageFormat &imageFormat : imageFormats) {
const QString name = imageFormat.name();
if (!seenImageNames.contains(name)) {
......@@ -212,10 +212,10 @@ QSharedPointer<EmbeddedImage> RichTextComposerImages::createEmbeddedImage(const
return embeddedImage;
}
QList<QTextImageFormat> RichTextComposerImages::embeddedImageFormats() const
QVector<QTextImageFormat> RichTextComposerImages::embeddedImageFormats() const
{
QTextDocument *doc = d->composer->document();
QList<QTextImageFormat> retList;
QVector<QTextImageFormat> retList;
QTextBlock currentBlock = doc->begin();
while (currentBlock.isValid()) {
......
......@@ -88,7 +88,7 @@ public:
void addImageHelper(const QString &imageName, const QImage &image, int width = -1, int height = -1);
Q_REQUIRED_RESULT ImageWithNameList imagesWithName() const;
Q_REQUIRED_RESULT QVector<QSharedPointer<EmbeddedImage> > embeddedImages() const;
Q_REQUIRED_RESULT QList<QTextImageFormat> embeddedImageFormats() const;
Q_REQUIRED_RESULT QVector<QTextImageFormat> embeddedImageFormats() const;
void addImageHelper(const QUrl &url, int width = -1, int height = -1);
void insertImage(const QImage &image, const QFileInfo &fileInfo);
......
......@@ -82,6 +82,7 @@ void EmoticonUnicodeTab::createPlainTextEmoticonTab(const QString &str, const QV
EmoticonListWidgetSelector *selector = new EmoticonListWidgetSelector(this);
connect(selector, &KPIMTextEdit::EmoticonListWidgetSelector::itemSelected, this, &EmoticonUnicodeTab::itemSelected);
QStringList lst;
lst.reserve(emoticons.count());
for (const EmoticonUnicodeUtils::EmoticonStruct &emoji : emoticons) {
lst.append(emoji.emoticonCode);
}
......
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