Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace QString() with QStringLiteral() for better performance #7422

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/gui/wizard/owncloudsetuppage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
const auto serverObject = serverJson.toObject();
const auto serverName = serverObject.value("name").toString();
const auto serverUrl = serverObject.value("url").toString();
const auto serverDisplayString = QStringLiteral("%1 (%2)").arg(serverName, serverUrl);
_ui.comboBox->addItem(serverDisplayString, serverUrl);
_ui.comboBox->addItem(serverName, serverUrl);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious - why this change?

Copy link
Author

@Integral-Tech Integral-Tech Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QStringLiteral() constructs the QString object during compilation, which avoids the runtime overhead of constructing QString objects.

}
} else if (theme->forceOverrideServerUrl()) {
_ui.comboBox->hide();
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.