Commit 4d5c9a9b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix warning found by cppcheck

parent d0a0848d
......@@ -2019,6 +2019,13 @@ void Agenda::resizeEvent(QResizeEvent *ev)
void Agenda::resizeAllContents()
{
double subCellWidth;
foreach (const AgendaItem::QPtr &item, d->mItems) {
if (item) {
subCellWidth = calcSubCellWidth(item);
placeAgendaItem(item, subCellWidth);
}
}
/*
if (d->mAllDayMode) {
foreach (const AgendaItem::QPtr &item, d->mItems) {
if (item) {
......@@ -2034,6 +2041,7 @@ void Agenda::resizeAllContents()
}
}
}
*/
checkScrollBoundaries();
marcus_bains();
update();
......
......@@ -60,12 +60,10 @@ void TodoCompleteDelegate::paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QStyle *style = nullptr;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
style = opt.widget ? opt.widget->style() : QApplication::style();
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter);
if (index.data(Qt::EditRole).toInt() > 0) {
......@@ -371,7 +369,7 @@ void TodoRichTextDelegate::paint(QPainter *painter,
style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget);
// draw the text (rich text)
QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ?
QPalette::ColorGroup cg = (opt.state & QStyle::State_Enabled) ?
QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(opt.state & QStyle::State_Active)) {
cg = QPalette::Inactive;
......
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