Replace QLatin1String with operator _L1

This commit is contained in:
Jonas Kvinge
2024-09-07 04:24:14 +02:00
parent e3e6a22172
commit 4270b12cd1
185 changed files with 2429 additions and 2139 deletions

View File

@@ -37,6 +37,8 @@
#include "fancytabwidget.h"
#include "fancytabdata.h"
using namespace Qt::StringLiterals;
namespace {
constexpr int TabSize_LargeSidebarMinWidth = 70;
} // namespace
@@ -50,7 +52,7 @@ FancyTabBar::FancyTabBar(QWidget *parent) :
}
QString FancyTabBar::TabText(const int index) const {
return tabText(index).isEmpty() ? QLatin1String("") : tabData(index).value<FancyTabData*>()->label();
return tabText(index).isEmpty() ? ""_L1 : tabData(index).value<FancyTabData*>()->label();
}
QSize FancyTabBar::sizeHint() const {

View File

@@ -49,6 +49,7 @@
#include "settings/appearancesettingspage.h"
using namespace std::chrono_literals;
using namespace Qt::StringLiterals;
namespace {
constexpr int IconSize_LargeSidebar = 40;
@@ -209,12 +210,12 @@ void FancyTabWidget::SetMode(const Mode mode) {
if (previous_mode == Mode::IconOnlyTabs && mode != Mode::IconOnlyTabs) {
for (int i = 0; i < count(); ++i) {
tabBar()->setTabText(i, tabBar()->tabData(i).value<FancyTabData*>()->label());
tabBar()->setTabToolTip(i, QLatin1String(""));
tabBar()->setTabToolTip(i, ""_L1);
}
}
else if (previous_mode != Mode::IconOnlyTabs && mode == Mode::IconOnlyTabs) {
for (int i = 0; i < count(); ++i) {
tabBar()->setTabText(i, QLatin1String(""));
tabBar()->setTabText(i, ""_L1);
tabBar()->setTabToolTip(i, tabBar()->tabData(i).value<FancyTabData*>()->label());
}
}

View File

@@ -95,7 +95,7 @@ FileView::FileView(QWidget *parent)
QObject::connect(ui_->list, &FileViewList::EditTags, this, &FileView::EditTags);
QString filter = QLatin1String(FileView::kFileFilter);
filter_list_ << filter.split(QLatin1Char(' '));
filter_list_ << filter.split(u' ');
ReloadSettings();

View File

@@ -34,6 +34,8 @@
#include "multiloadingindicator.h"
#include "widgets/busyindicator.h"
using namespace Qt::StringLiterals;
namespace {
constexpr int kVerticalPadding = 4;
constexpr int kHorizontalPadding = 6;
@@ -84,10 +86,10 @@ void MultiLoadingIndicator::UpdateText() {
strings << task_text;
}
text_ = strings.join(QLatin1String(", "));
text_ = strings.join(", "_L1);
if (!text_.isEmpty()) {
text_[0] = text_[0].toUpper();
text_ += QLatin1String("...");
text_ += "..."_L1;
}
Q_EMIT TaskCountChange(static_cast<int>(tasks.count()));

View File

@@ -45,6 +45,7 @@
#include "covermanager/albumcoverchoicecontroller.h"
#include "playingwidget.h"
using namespace Qt::StringLiterals;
using std::make_unique;
namespace {
@@ -407,16 +408,16 @@ void PlayingWidget::UpdateDetailsText() {
switch (mode_) {
case Mode::SmallSongDetails:
details_->setTextWidth(-1);
html += QLatin1String("<p>");
html += "<p>"_L1;
break;
case Mode::LargeSongDetails:
details_->setTextWidth(desired_height_);
html += QLatin1String("<p align=center>");
html += "<p align=center>"_L1;
break;
}
html += QStringLiteral("%1<br/>%2<br/>%3").arg(song_.PrettyTitle().toHtmlEscaped(), song_.artist().toHtmlEscaped(), song_.album().toHtmlEscaped());
html += QLatin1String("</p>");
html += "</p>"_L1;
details_->setHtml(html);

View File

@@ -37,6 +37,8 @@ THE SOFTWARE.
#include "searchfield.h"
#include "qocoa_mac.h"
using namespace Qt::Literals::StringLiterals;
class SearchFieldPrivate : public QObject {
public:
@@ -156,19 +158,19 @@ class SearchFieldPrivate : public QObject {
if ([event type] == NSEventTypeKeyDown && [event modifierFlags] & NSEventModifierFlagCommand) {
const QString keyString = toQString([event characters]);
if (keyString == QLatin1String("a")) { // Cmd+a
if (keyString == "a"_L1) { // Cmd+a
[self performSelector:@selector(selectText:)];
return YES;
}
else if (keyString == QLatin1String("c")) { // Cmd+c
else if (keyString == "c"_L1) { // Cmd+c
[[self currentEditor] copy: nil];
return YES;
}
else if (keyString == QLatin1String("v")) { // Cmd+v
else if (keyString == "v"_L1) { // Cmd+v
[[self currentEditor] paste: nil];
return YES;
}
else if (keyString == QLatin1String("x")) { // Cmd+x
else if (keyString == "x"_L1) { // Cmd+x
[[self currentEditor] cut: nil];
return YES;
}