Changeset e249438 in confclerk_git for src/gui/eventdialog.cpp


Ignore:
Timestamp:
09/10/13 23:41:58 (9 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
d942dc3
Parents:
0584e12
Message:

Escaped the strings that are shown in the dialog and preserve some layout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/eventdialog.cpp

    r0584e12 re249438  
    3939    QString info;
    4040    // title
    41     info.append(QString("<h1>%1</h1>\n").arg(event.title()));
     41    info.append(QString("<h1>%1</h1>\n").arg(Qt::escape(event.title())));
    4242
    4343    // persons
    4444    info += QString("<h2>%1</h2>\n").arg(tr("Persons"));
    45     info += QString("<p>%1</p>\n").arg(event.persons().join(", "));
     45    QStringList persons = event.persons();
     46    for (int i = 0; i != persons.size(); ++i) persons[i] = Qt::escape(persons[i]);
     47    info += QString("<p>%1</p>\n").arg(persons.join(", "));
    4648
    4749    // abstract
    4850    info += QString("<h2>%1</h2>\n").arg(tr("Abstract"));
    49     info += QString("<p>%1</p>\n").arg(event.abstract());
     51    info += Qt::convertFromPlainText(event.abstract(), Qt::WhiteSpaceNormal);
    5052
    5153    // description
    5254    info += QString("<h2>%1</h2>\n").arg(tr("Description"));
    53     info += QString("<p>%1</p>\n").arg(event.description());
     55    info += Qt::convertFromPlainText(event.description(), Qt::WhiteSpaceNormal);
    5456
    5557    // links
     
    6264        if (url.isEmpty() || url == "http://") continue;
    6365        if (name.isEmpty()) name = url;
    64         info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(url, name);
     66        info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(Qt::escape(url), Qt::escape(name));
    6567    }
    6668    info += QString("</ul>\n");
Note: See TracChangeset for help on using the changeset viewer.