summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2017-12-25 19:03:47 +0100
committerLaurent Montel <[email protected]>2017-12-25 19:03:47 +0100
commit73ca483d8f1aae88de160002dcd2df7a37801d64 (patch)
tree63e80a947947d192287050b5bdc692428e160ee8
parentb52c2bb56d3e79077519fdba4e815f70d19e045f (diff)
const'ify
-rw-r--r--src/composer-ng/richtextcomposerimages.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/composer-ng/richtextcomposerimages.cpp b/src/composer-ng/richtextcomposerimages.cpp
index 60a1b56..7f46f8c 100644
--- a/src/composer-ng/richtextcomposerimages.cpp
+++ b/src/composer-ng/richtextcomposerimages.cpp
@@ -76,8 +76,8 @@ void RichTextComposerImages::addImageHelper(const QUrl &url, int width, int heig
url.path()));
return;
}
- QFileInfo fi(url.path());
- QString imageName
+ const QFileInfo fi(url.path());
+ const QString imageName
= fi.baseName().isEmpty()
? QStringLiteral("image.png")
: QString(fi.baseName() + QLatin1String(".png"));
@@ -210,8 +210,7 @@ QList<QTextImageFormat> RichTextComposerImages::embeddedImageFormats() const
QTextBlock currentBlock = doc->begin();
while (currentBlock.isValid()) {
- QTextBlock::iterator it;
- for (it = currentBlock.begin(); !it.atEnd(); ++it) {
+ for (QTextBlock::iterator it = currentBlock.begin(); !it.atEnd(); ++it) {
QTextFragment fragment = it.fragment();
if (fragment.isValid()) {
QTextImageFormat imageFormat = fragment.charFormat().toImageFormat();
@@ -231,7 +230,7 @@ QList<QTextImageFormat> RichTextComposerImages::embeddedImageFormats() const
void RichTextComposerImages::insertImage(const QImage &image, const QFileInfo &fileInfo)
{
- QString imageName = fileInfo.baseName().isEmpty()
+ const QString imageName = fileInfo.baseName().isEmpty()
? i18nc("Start of the filename for an image", "image")
: fileInfo.baseName();
addImageHelper(imageName, image);