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

Modernize code

parent 80b676d3
Pipeline #39455 passed with stage
in 9 minutes and 33 seconds
......@@ -132,7 +132,7 @@ DndFactory::~DndFactory()
QMimeData *DndFactory::createMimeData()
{
QMimeData *mimeData = new QMimeData;
auto *mimeData = new QMimeData;
ICalDrag::populateMimeData(mimeData, d->mCalendar);
......@@ -141,7 +141,7 @@ QMimeData *DndFactory::createMimeData()
QDrag *DndFactory::createDrag(QWidget *owner)
{
QDrag *drag = new QDrag(owner);
auto *drag = new QDrag(owner);
drag->setMimeData(createMimeData());
return drag;
......@@ -155,7 +155,7 @@ QMimeData *DndFactory::createMimeData(const Incidence::Ptr &incidence)
i->setRecurrenceId({});
cal->addIncidence(i);
QMimeData *mimeData = new QMimeData;
auto *mimeData = new QMimeData;
ICalDrag::populateMimeData(mimeData, cal);
......@@ -172,7 +172,7 @@ QMimeData *DndFactory::createMimeData(const Incidence::Ptr &incidence)
QDrag *DndFactory::createDrag(const Incidence::Ptr &incidence, QWidget *owner)
{
QDrag *drag = new QDrag(owner);
auto *drag = new QDrag(owner);
drag->setMimeData(createMimeData(incidence));
drag->setPixmap(QIcon::fromTheme(incidence->iconName()).pixmap(KIconLoader::SizeSmallMedium));
......@@ -291,7 +291,7 @@ bool DndFactory::copyIncidences(const Incidence::List &incidences)
}
}
QMimeData *mimeData = new QMimeData;
auto *mimeData = new QMimeData;
ICalDrag::populateMimeData(mimeData, calendar);
......
......@@ -17,7 +17,7 @@ class Engine;
class FileSystemTemplateLoader;
class TemplateImpl;
class Context;
typedef QSharedPointer<TemplateImpl> Template;
using Template = QSharedPointer<TemplateImpl>;
}
class QString;
......
......@@ -93,7 +93,7 @@ bool HtmlExport::save(QTextStream *ts)
*ts << "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << returnEndLine();
*ts << "<html><head>" << returnEndLine();
*ts << " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=";
*ts << R"( <meta http-equiv="Content-Type" content="text/html; charset=)";
*ts << "UTF-8\" />" << returnEndLine();
if (!d->mSettings->pageTitle().isEmpty()) {
*ts << " <title>" << d->mSettings->pageTitle() << "</title>" << returnEndLine();
......@@ -195,7 +195,7 @@ void HtmlExport::createMonthView(QTextStream *ts)
while (start <= end) {
*ts << " <tr>" << returnEndLine();
for (int i = 0; i < 7; ++i) {
*ts << " <td valign=\"top\"><table border=\"0\">";
*ts << R"( <td valign="top"><table border="0">)";
*ts << "<tr><td ";
if (d->mHolidayMap.contains(start) || start.dayOfWeek() == 7) {
......@@ -250,7 +250,7 @@ void HtmlExport::createMonthView(QTextStream *ts)
void HtmlExport::createEventList(QTextStream *ts)
{
int columns = 3;
*ts << "<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\">" << returnEndLine();
*ts << R"(<table border="0" cellpadding="3" cellspacing="3">)" << returnEndLine();
*ts << " <tr>" << returnEndLine();
*ts << " <th class=\"sum\">" << i18nc("@title:column event start time",
"Start Time") << "</th>" << returnEndLine();
......@@ -283,7 +283,7 @@ void HtmlExport::createEventList(QTextStream *ts)
SortDirectionAscending);
if (!events.isEmpty()) {
*ts << " <tr><td colspan=\"" << QString::number(columns)
<< "\" class=\"datehead\"><i>"
<< R"(" class="datehead"><i>)"
<< QLocale().toString(dt)
<< "</i></td></tr>" << returnEndLine();
......@@ -393,7 +393,7 @@ void HtmlExport::createTodoList(QTextStream *ts)
}
int columns = 3;
*ts << "<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\">" << returnEndLine();
*ts << R"(<table border="0" cellpadding="3" cellspacing="3">)" << returnEndLine();
*ts << " <tr>" << returnEndLine();
*ts << " <th class=\"sum\">" << i18nc("@title:column", "To-do") << "</th>" << returnEndLine();
*ts << " <th>" << i18nc("@title:column to-do priority", "Priority") << "</th>" << returnEndLine();
......@@ -491,7 +491,7 @@ void HtmlExport::createTodo(QTextStream *ts, const Todo::Ptr &todo)
*ts << " <p>" << breakString(cleanChars(todo->description())) << "</p>" << returnEndLine();
}
if (!relations.isEmpty()) {
*ts << " <div align=\"right\"><a href=\"#sub" << todo->uid()
*ts << R"( <div align="right"><a href="#sub)" << todo->uid()
<< "\">" << i18nc("@title:column sub-to-dos of the parent to-do",
"Sub-To-dos") << "</a></div>" << returnEndLine();
}
......
......@@ -2604,7 +2604,7 @@ static QString tooltipPerson(const QString &email, const QString &name, Attendee
// Make the return string.
QString personString;
if (!iconPath.isEmpty()) {
personString += QLatin1String("<img valign=\"top\" src=\"") + iconPath + QLatin1String("\">") + QLatin1String("&nbsp;");
personString += QLatin1String(R"(<img valign="top" src=")") + iconPath + QLatin1String("\">") + QLatin1String("&nbsp;");
}
if (status != Attendee::None) {
personString += i18nc("attendee name (attendee status)", "%1 (%2)",
......@@ -2629,7 +2629,7 @@ static QString tooltipFormatOrganizer(const QString &email, const QString &name)
// Make the return string.
QString personString;
if (!iconPath.isEmpty()) {
personString += QLatin1String("<img valign=\"top\" src=\"") + iconPath + QLatin1String("\">") + QLatin1String("&nbsp;");
personString += QLatin1String(R"(<img valign="top" src=")") + iconPath + QLatin1String("\">") + QLatin1String("&nbsp;");
}
personString += (printName.isEmpty() ? email : printName);
return personString;
......
......@@ -141,7 +141,7 @@ static QDialog *createDialog(QDialogButtonBox::StandardButtons buttons, const QS
{
QPointer<QDialog> dialog = new QDialog(parent);
dialog->setWindowTitle(caption);
QVBoxLayout *mainLayout = new QVBoxLayout();
auto *mainLayout = new QVBoxLayout();
dialog->setLayout(mainLayout);
*buttonBox = new QDialogButtonBox(buttons, parent);
......@@ -164,7 +164,7 @@ static QDialog *createDialog(QDialogButtonBox::StandardButtons buttons, const QS
int RecurrenceActions::questionMultipleChoice(const QDateTime &selectedOccurrence, const QString &message, const QString &caption, const KGuiItem &action, int availableChoices, int preselectedChoices, QWidget *parent)
{
QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok | QDialogButtonBox::Cancel;
ScopeWidget *widget = new ScopeWidget(availableChoices, selectedOccurrence, nullptr);
auto *widget = new ScopeWidget(availableChoices, selectedOccurrence, nullptr);
QDialogButtonBox *buttonBox = nullptr;
auto dialog = createDialog(buttons, caption, widget, &buttonBox, parent);
......
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