Commit 94f37e4d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify

parent d106575d
......@@ -63,8 +63,8 @@ bool NestedListHelper::canIndent() const
if ((textEdit->textCursor().block().isValid())
// && ( textEdit->textCursor().block().previous().isValid() )
) {
QTextBlock block = textEdit->textCursor().block();
QTextBlock prevBlock = textEdit->textCursor().block().previous();
const QTextBlock block = textEdit->textCursor().block();
const QTextBlock prevBlock = textEdit->textCursor().block().previous();
if (block.textList()) {
if (prevBlock.textList()) {
return block.textList()->format().indent() <= prevBlock.textList()->format().indent();
......@@ -133,9 +133,9 @@ bool NestedListHelper::handleAfterDropEvent(QDropEvent *dropEvent)
QTextCursor cursor = topOfSelection();
QTextBlock droppedBlock = cursor.block();
int firstDroppedItemIndent = droppedBlock.textList()->format().indent();
const int firstDroppedItemIndent = droppedBlock.textList()->format().indent();
int minimumIndent = droppedBlock.previous().textList()->format().indent();
const int minimumIndent = droppedBlock.previous().textList()->format().indent();
if (firstDroppedItemIndent < minimumIndent) {
cursor = QTextCursor(droppedBlock);
......@@ -160,7 +160,7 @@ bool NestedListHelper::handleAfterDropEvent(QDropEvent *dropEvent)
void NestedListHelper::processList(QTextList *list)
{
QTextBlock block = list->item(0);
int thisListIndent = list->format().indent();
const int thisListIndent = list->format().indent();
QTextCursor cursor = QTextCursor(block);
list = cursor.createList(list->format());
......
......@@ -222,7 +222,7 @@ QList<QTextImageFormat> RichTextComposerImages::embeddedImageFormats() const
QTextImageFormat imageFormat = fragment.charFormat().toImageFormat();
if (imageFormat.isValid()) {
//TODO: Replace with a way to see if an image is an embedded image or a remote
QUrl url(imageFormat.name());
const QUrl url(imageFormat.name());
if (!url.isValid() || !url.scheme().startsWith(QLatin1String("http"))) {
retList.append(imageFormat);
}
......
......@@ -147,7 +147,7 @@ void RichTextExternalComposer::slotEditorFinished(int codeError, QProcess::ExitS
// with the given filename, so we need to reopen the file after the editor exited
QFile localFile(d->extEditorTempFile->fileName());
if (localFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
QByteArray f = localFile.readAll();
const QByteArray f = localFile.readAll();
d->richTextComposer->setTextOrHtml(QString::fromUtf8(f.data(), f.size()));
d->richTextComposer->document()->setModified(true);
localFile.close();
......@@ -168,7 +168,7 @@ bool RichTextExternalComposer::checkExternalEditorFinished()
return true;
}
int ret = KMessageBox::warningYesNoCancel(
const int ret = KMessageBox::warningYesNoCancel(
d->richTextComposer,
xi18nc("@info",
"The external editor is still running.<nl/>"
......
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