Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 6fc5a7ea authored by Laurent Montel's avatar Laurent Montel 😁

Optimization don't use toPlaintext().isEmpty() => using

document()->isEmpty()
parent 8b9fc201
......@@ -557,8 +557,9 @@ void RenderWidget::slotSaveProfile()
profileElement.setAttribute(QStringLiteral("defaultaudioquality"), QString::number(ui.default_abitrate->value()));
profileElement.setAttribute(QStringLiteral("audioqualities"), ui.abitrates_list->text());
}
if (!ui.speeds_list->toPlainText().isEmpty()) {
profileElement.setAttribute(QStringLiteral("speeds"), ui.speeds_list->toPlainText().replace('\n', ';').simplified());
QString speeds_list_str = ui.speeds_list->toPlainText();
if (!speeds_list_str.isEmpty()) {
profileElement.setAttribute(QStringLiteral("speeds"), speeds_list_str.replace('\n', ';').simplified());
}
doc.appendChild(profileElement);
......@@ -827,9 +828,10 @@ void RenderWidget::slotEditProfile()
profileElement.setAttribute(QStringLiteral("audioqualities"), ui.abitrates_list->text());
}
if (!ui.speeds_list->toPlainText().isEmpty()) {
QString speeds_list_str = ui.speeds_list->toPlainText();
if (!speeds_list_str.isEmpty()) {
// profile has a variable speed
profileElement.setAttribute(QStringLiteral("speeds"), ui.speeds_list->toPlainText().replace('\n', ';').simplified());
profileElement.setAttribute(QStringLiteral("speeds"), speeds_list_str.replace('\n', ';').simplified());
}
profiles.appendChild(profileElement);
......
......@@ -1565,7 +1565,7 @@ void TitleWidget::textChanged(MyTextItem *i)
updateDimension(i);
if (origin_x_left->isChecked() || origin_y_top->isChecked()) {
if (!i->toPlainText().isEmpty()) {
if (!i->document()->isEmpty()) {
updatePosition(i);
} else {
/*
......@@ -2604,7 +2604,7 @@ void TitleWidget::prepareTools(QGraphicsItem *referenceItem)
if (referenceItem->type() == TEXTITEM) {
showToolbars(TITLE_TEXT);
MyTextItem *i = static_cast <MyTextItem *>(referenceItem);
if (!i->toPlainText().isEmpty()) {
if (!i->document()->isEmpty()) {
// We have an existing text item selected
if (!i->data(100).isNull()) {
// Item has an effect
......
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