Ignore:
Timestamp:
08/30/17 20:38:27 (5 years ago)
Author:
gregor herrmann <gregor@…>
Branches:
master, qt5
Children:
79a7671
Parents:
ebe26af (diff), e27a3f5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into qt5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/eventdialog.cpp

    rebe26af r809b5e5  
    11/*
    22 * Copyright (C) 2010 Ixonos Plc.
    3  * Copyright (C) 2011-2015 Philipp Spitzer, gregor herrmann, Stefan Stahl
     3 * Copyright (C) 2011-2017 Philipp Spitzer, gregor herrmann, Stefan Stahl
    44 *
    55 * This file is part of ConfClerk.
     
    4949    // abstract
    5050    info += QString("<h2>%1</h2>\n").arg(tr("Abstract"));
    51     info += Qt::convertFromPlainText(event.abstract(), Qt::WhiteSpaceNormal);
     51    if (Qt::mightBeRichText(event.abstract())) {
     52        info += event.abstract();
     53    } else {
     54        info += Qt::convertFromPlainText(event.abstract(), Qt::WhiteSpaceNormal);
     55    }
    5256
    5357    // description
    5458    info += QString("<h2>%1</h2>\n").arg(tr("Description"));
    55     info += Qt::convertFromPlainText(event.description(), Qt::WhiteSpaceNormal);
     59    if (Qt::mightBeRichText(event.description())) {
     60        info += event.description();
     61    } else {
     62        info += Qt::convertFromPlainText(event.description(), Qt::WhiteSpaceNormal);
     63    }
    5664
    5765    // links
     
    8189    connect(alarmButton, SIGNAL(clicked()), SLOT(alarmClicked()));
    8290
    83     if(event.isFavourite())
    84     {
    85         favouriteButton->setIcon(QIcon(":/icons/favourite-on.png"));
    86     }
     91    updateFavouriteButton(event);
    8792
    8893    if(event.hasAlarm())
     
    95100{
    96101    Event event = Event::getById(mEventId, mConferenceId);
     102    event.cycleFavourite();
     103    event.update("favourite");
     104    updateFavouriteButton(event);
    97105
     106    // 'conflicts' list may have changed
    98107    QList<Event> conflicts = Event::conflictEvents(event.id(), mConferenceId);
    99     if(event.isFavourite())
    100     {
    101         event.setFavourite(false);
    102         favouriteButton->setIcon(QIcon(":/icons/favourite-off.png"));
    103     }
    104     else
    105     {
    106         event.setFavourite(true);
    107         favouriteButton->setIcon(QIcon(":/icons/favourite-on.png"));
    108     }
    109     event.update("favourite");
    110 
    111     if(event.isFavourite())
    112     {
    113         // event has became 'favourite' and so 'conflicts' list may have changed
    114         conflicts = Event::conflictEvents(event.id(), mConferenceId);
    115     }
    116108
    117109    // have to emit 'eventChanged' signal on all events in conflict
     
    155147}
    156148
     149
     150void EventDialog::updateFavouriteButton(const Event& event) {
     151    switch (event.favourite()) {
     152        case Favourite_no: favouriteButton->setIcon(QIcon(":/icons/favourite-no.png")); break;
     153        case Favourite_weak: favouriteButton->setIcon(QIcon(":/icons/favourite-weak.png")); break;
     154        case Favourite_strong: favouriteButton->setIcon(QIcon(":/icons/favourite-strong.png")); break;
     155    }
     156}
     157
Note: See TracChangeset for help on using the changeset viewer.