Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8cd73487 authored by Laurent Montel's avatar Laurent Montel 😁

Fix warnings

parent 37eecf08
......@@ -292,7 +292,7 @@ void NestedListHelper::handleOnBulletType(int styleIndex)
{
QTextCursor cursor = textEdit->textCursor();
if (styleIndex != 0) {
QTextListFormat::Style style = (QTextListFormat::Style)styleIndex;
QTextListFormat::Style style = static_cast<QTextListFormat::Style>(styleIndex);
QTextList *currentList = cursor.currentList();
QTextListFormat listFmt;
......
......@@ -44,8 +44,8 @@ class Q_DECL_HIDDEN RichTextComposer::RichTextComposerPrivate
public:
RichTextComposerPrivate(RichTextComposer *qq)
: q(qq)
, forcePlainTextMarkup(false)
, mode(RichTextComposer::Plain)
, forcePlainTextMarkup(false)
{
composerControler = new RichTextComposerControler(q, q);
richTextComposerActions = new RichTextComposerActions(composerControler, q);
......@@ -60,8 +60,8 @@ public:
RichTextComposerActions *richTextComposerActions = nullptr;
KPIMTextEdit::RichTextExternalComposer *externalComposer = nullptr;
RichTextComposer *q = nullptr;
bool forcePlainTextMarkup = false;
RichTextComposer::Mode mode;
bool forcePlainTextMarkup = false;
};
RichTextComposer::RichTextComposer(QWidget *parent)
......
......@@ -46,9 +46,9 @@ class Q_DECL_HIDDEN RichTextComposerControler::RichTextComposerControlerPrivate
{
public:
RichTextComposerControlerPrivate(RichTextComposer *composer, RichTextComposerControler *qq)
: painterActive(false)
, richtextComposer(composer)
: richtextComposer(composer)
, q(qq)
, painterActive(false)
{
nestedListHelper = new NestedListHelper(composer);
richTextImages = new RichTextComposerImages(richtextComposer, q);
......@@ -76,11 +76,11 @@ public:
QFont saveFont;
QColor mLinkColor;
QTextCharFormat painterFormat;
bool painterActive;
NestedListHelper *nestedListHelper = nullptr;
RichTextComposer *richtextComposer = nullptr;
RichTextComposerImages *richTextImages = nullptr;
RichTextComposerControler *q = nullptr;
bool painterActive;
};
void RichTextComposerControler::RichTextComposerControlerPrivate::selectLinkText(QTextCursor *cursor) const
......
......@@ -105,7 +105,7 @@ void RichTextComposerImages::loadImage(const QImage &image, const QString &match
QUrl(resourceName), QVariant(image));
QTextImageFormat format;
format.setName(resourceName);
if ((imageFormat.width() != 0) && (imageFormat.height() != 0)) {
if ((imageFormat.width() != 0.0) && (imageFormat.height() != 0.0)) {
format.setWidth(imageFormat.width());
format.setHeight(imageFormat.height());
}
......
......@@ -102,7 +102,7 @@ void RichTextExternalComposer::startExternalEditor()
// construct command line...
QHash<QChar, QString> map;
map.insert(QLatin1Char('l'), QString::number(d->richTextComposer->textCursor().blockNumber() + 1));
map.insert(QLatin1Char('w'), QString::number((qulonglong)d->richTextComposer->winId()));
map.insert(QLatin1Char('w'), QString::number(static_cast<qulonglong>(d->richTextComposer->winId())));
map.insert(QLatin1Char('f'), d->extEditorTempFile->fileName());
const QString cmd = KMacroExpander::expandMacrosShellQuote(commandLine, map);
const QStringList arg = KShell::splitArgs(cmd);
......
......@@ -114,8 +114,8 @@ void InsertTableWidget::slotTypeOfLengthChanged(int index)
QTextLength::Type InsertTableWidget::typeOfLength() const
{
return
(QTextLength::Type)d->mTypeOfLength->itemData(
d->mTypeOfLength->currentIndex()).toInt();
static_cast<QTextLength::Type>(d->mTypeOfLength->itemData(
d->mTypeOfLength->currentIndex()).toInt());
}
void InsertTableWidget::setTypeOfLength(QTextLength::Type type)
......
......@@ -109,8 +109,8 @@ void TableCellFormatDialog::setTableCellBackgroundColor(const QColor &col)
QTextCharFormat::VerticalAlignment TableCellFormatDialog::verticalAlignment() const
{
return
(QTextCharFormat::VerticalAlignment)d->verticalAlignment->itemData(
d->verticalAlignment->currentIndex()).toInt();
static_cast<QTextCharFormat::VerticalAlignment>(d->verticalAlignment->itemData(
d->verticalAlignment->currentIndex()).toInt());
}
void TableCellFormatDialog::setVerticalAlignment(QTextCharFormat::VerticalAlignment vertical)
......
......@@ -190,7 +190,7 @@ void TableFormatDialog::setAlignment(Qt::Alignment alignment)
Qt::Alignment TableFormatDialog::alignment() const
{
return (Qt::Alignment)d->alignment->itemData(d->alignment->currentIndex()).toInt();
return static_cast<Qt::Alignment>(d->alignment->itemData(d->alignment->currentIndex()).toInt());
}
QTextLength::Type TableFormatDialog::typeOfLength() const
......
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