Commit ed9fc630 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 90c593fb
......@@ -40,7 +40,7 @@ bool ICalDrag::populateMimeData(QMimeData *me, const MemoryCalendar::Ptr &cal)
ICalFormat icf;
QString scal = icf.toString(cal, QString(), false);
if (me && scal.length() > 0) {
if (me && !scal.isEmpty()) {
me->setData(mimeType(), scal.toUtf8());
}
return canDecode(me);
......@@ -63,7 +63,7 @@ bool ICalDrag::fromMimeData(const QMimeData *de, const MemoryCalendar::Ptr &cal)
bool success = false;
QByteArray payload = de->data(mimeType());
if (payload.size()) {
if (!payload.isEmpty()) {
QString txt = QString::fromUtf8(payload.data());
ICalFormat icf;
......
......@@ -182,7 +182,7 @@ int RecurrenceActions::questionMultipleChoice(const KDateTime &selectedOccurrenc
{
QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Ok | QDialogButtonBox::Cancel;
ScopeWidget *widget = new ScopeWidget(availableChoices, selectedOccurrence, 0);
QDialogButtonBox *buttonBox = 0;
QDialogButtonBox *buttonBox = nullptr;
auto dialog = createDialog(buttons, caption, widget, &buttonBox, parent);
KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), action);
......
......@@ -64,8 +64,8 @@ bool VCalDrag::fromMimeData(const QMimeData *de,
bool success = false;
QByteArray payload = de->data(mimeType());
if (payload.size()) {
QString txt = QString::fromUtf8(payload.data());
if (!payload.isEmpty()) {
const QString txt = QString::fromUtf8(payload.data());
VCalFormat format;
success = format.fromString(cal, txt);
......
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