Replace QStringLiteral with QLatin1String
This commit is contained in:
@@ -231,12 +231,12 @@ QUrl AlbumCoverChoiceController::LoadCoverFromFile(Song *song) {
|
||||
|
||||
void AlbumCoverChoiceController::SaveCoverToFileManual(const Song &song, const AlbumCoverImageResult &result) {
|
||||
|
||||
QString initial_file_name = QStringLiteral("/");
|
||||
QString initial_file_name = QLatin1String("/");
|
||||
|
||||
if (!song.effective_albumartist().isEmpty()) {
|
||||
initial_file_name = initial_file_name + song.effective_albumartist();
|
||||
}
|
||||
initial_file_name = initial_file_name + QLatin1Char('-') + (song.effective_album().isEmpty() ? tr("unknown") : song.effective_album()) + QStringLiteral(".jpg");
|
||||
initial_file_name = initial_file_name + QLatin1Char('-') + (song.effective_album().isEmpty() ? tr("unknown") : song.effective_album()) + QLatin1String(".jpg");
|
||||
initial_file_name = initial_file_name.toLower();
|
||||
initial_file_name.replace(QRegularExpression(QStringLiteral("\\s")), QStringLiteral("-"));
|
||||
initial_file_name.remove(QRegularExpression(QLatin1String(kInvalidFatCharactersRegex), QRegularExpression::CaseInsensitiveOption));
|
||||
@@ -247,12 +247,12 @@ void AlbumCoverChoiceController::SaveCoverToFileManual(const Song &song, const A
|
||||
|
||||
QFileInfo fileinfo(save_filename);
|
||||
if (fileinfo.suffix().isEmpty()) {
|
||||
save_filename.append(QStringLiteral(".jpg"));
|
||||
save_filename.append(QLatin1String(".jpg"));
|
||||
fileinfo.setFile(save_filename);
|
||||
}
|
||||
|
||||
if (!QImageWriter::supportedImageFormats().contains(fileinfo.completeSuffix().toUtf8().toLower())) {
|
||||
save_filename = Utilities::PathWithoutFilenameExtension(save_filename) + QStringLiteral(".jpg");
|
||||
save_filename = Utilities::PathWithoutFilenameExtension(save_filename) + QLatin1String(".jpg");
|
||||
fileinfo.setFile(save_filename);
|
||||
}
|
||||
|
||||
@@ -473,13 +473,13 @@ void AlbumCoverChoiceController::ShowCover(const Song &song, const QPixmap &pixm
|
||||
|
||||
// Use Artist - Album as the window title
|
||||
QString title_text(song.effective_albumartist());
|
||||
if (!song.effective_album().isEmpty()) title_text += QStringLiteral(" - ") + song.effective_album();
|
||||
if (!song.effective_album().isEmpty()) title_text += QLatin1String(" - ") + song.effective_album();
|
||||
|
||||
QLabel *label = new QLabel(dialog);
|
||||
label->setPixmap(pixmap);
|
||||
|
||||
// Add (WxHpx) to the title before possibly resizing
|
||||
title_text += QStringLiteral(" (") + QString::number(pixmap.width()) + QLatin1Char('x') + QString::number(pixmap.height()) + QStringLiteral("px)");
|
||||
title_text += QLatin1String(" (") + QString::number(pixmap.width()) + QLatin1Char('x') + QString::number(pixmap.height()) + QLatin1String("px)");
|
||||
|
||||
// If the cover is larger than the screen, resize the window 85% seems to be enough to account for title bar and taskbar etc.
|
||||
QScreen *screen = Utilities::GetScreen(this);
|
||||
@@ -656,7 +656,7 @@ QUrl AlbumCoverChoiceController::SaveCoverToFileAutomatic(const Song::Source sou
|
||||
const AlbumCoverImageResult &result,
|
||||
const bool force_overwrite) {
|
||||
|
||||
QString filepath = CoverUtils::CoverFilePath(cover_options_, source, artist, album, album_id, album_dir, result.cover_url, QStringLiteral("jpg"));
|
||||
QString filepath = CoverUtils::CoverFilePath(cover_options_, source, artist, album, album_id, album_dir, result.cover_url, QLatin1String("jpg"));
|
||||
if (filepath.isEmpty()) return QUrl();
|
||||
|
||||
QFile file(filepath);
|
||||
@@ -664,7 +664,7 @@ QUrl AlbumCoverChoiceController::SaveCoverToFileAutomatic(const Song::Source sou
|
||||
if (source == Song::Source::Collection && !cover_options_.cover_overwrite && !force_overwrite && get_save_album_cover_type() == CoverOptions::CoverType::Album && cover_options_.cover_filename == CoverOptions::CoverFilename::Pattern && file.exists()) {
|
||||
while (file.exists()) {
|
||||
QFileInfo fileinfo(file.fileName());
|
||||
file.setFileName(fileinfo.path() + QStringLiteral("/0") + fileinfo.fileName());
|
||||
file.setFileName(fileinfo.path() + QLatin1String("/0") + fileinfo.fileName());
|
||||
}
|
||||
filepath = file.fileName();
|
||||
}
|
||||
|
||||
@@ -39,16 +39,16 @@ AlbumCoverLoaderOptions::Types AlbumCoverLoaderOptions::LoadTypes() {
|
||||
const QStringList all_cover_types = QStringList() << QStringLiteral("art_unset") << QStringLiteral("art_embedded") << QStringLiteral("art_manual") << QStringLiteral("art_automatic");
|
||||
const QStringList cover_types_strlist = s.value(CoversSettingsPage::kTypes, all_cover_types).toStringList();
|
||||
for (const QString &cover_type_str : cover_types_strlist) {
|
||||
if (cover_type_str == QStringLiteral("art_unset")) {
|
||||
if (cover_type_str == QLatin1String("art_unset")) {
|
||||
cover_types << AlbumCoverLoaderOptions::Type::Unset;
|
||||
}
|
||||
else if (cover_type_str == QStringLiteral("art_embedded")) {
|
||||
else if (cover_type_str == QLatin1String("art_embedded")) {
|
||||
cover_types << AlbumCoverLoaderOptions::Type::Embedded;
|
||||
}
|
||||
else if (cover_type_str == QStringLiteral("art_manual")) {
|
||||
else if (cover_type_str == QLatin1String("art_manual")) {
|
||||
cover_types << AlbumCoverLoaderOptions::Type::Manual;
|
||||
}
|
||||
else if (cover_type_str == QStringLiteral("art_automatic")) {
|
||||
else if (cover_type_str == QLatin1String("art_automatic")) {
|
||||
cover_types << AlbumCoverLoaderOptions::Type::Automatic;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,10 +281,10 @@ void AlbumCoverManager::LoadGeometry() {
|
||||
|
||||
Settings s;
|
||||
s.beginGroup(kSettingsGroup);
|
||||
if (s.contains(QStringLiteral("geometry"))) {
|
||||
if (s.contains(QLatin1String("geometry"))) {
|
||||
restoreGeometry(s.value("geometry").toByteArray());
|
||||
}
|
||||
if (s.contains(QStringLiteral("splitter_state"))) {
|
||||
if (s.contains(QLatin1String("splitter_state"))) {
|
||||
ui_->splitter->restoreState(s.value("splitter_state").toByteArray());
|
||||
}
|
||||
else {
|
||||
@@ -397,7 +397,7 @@ void AlbumCoverManager::ArtistChanged(QListWidgetItem *current) {
|
||||
display_text = album_info.album;
|
||||
}
|
||||
else {
|
||||
display_text = album_info.album_artist + QStringLiteral(" - ") + album_info.album;
|
||||
display_text = album_info.album_artist + QLatin1String(" - ") + album_info.album;
|
||||
}
|
||||
|
||||
AlbumItem *album_item = new AlbumItem(icon_nocover_item_, display_text, ui_->albums);
|
||||
@@ -413,7 +413,7 @@ void AlbumCoverManager::ArtistChanged(QListWidgetItem *current) {
|
||||
album_item->setToolTip(album_info.album);
|
||||
}
|
||||
else {
|
||||
album_item->setToolTip(album_info.album_artist + QStringLiteral(" - ") + album_info.album);
|
||||
album_item->setToolTip(album_info.album_artist + QLatin1String(" - ") + album_info.album);
|
||||
}
|
||||
|
||||
album_item->setData(Role_ArtEmbedded, album_info.art_embedded);
|
||||
@@ -558,7 +558,7 @@ void AlbumCoverManager::UpdateStatusText() {
|
||||
.arg(fetch_statistics_.missing_images_);
|
||||
|
||||
if (fetch_statistics_.bytes_transferred_ > 0) {
|
||||
message += QStringLiteral(", ") + tr("%1 transferred").arg(Utilities::PrettySize(fetch_statistics_.bytes_transferred_));
|
||||
message += QLatin1String(", ") + tr("%1 transferred").arg(Utilities::PrettySize(fetch_statistics_.bytes_transferred_));
|
||||
}
|
||||
|
||||
statusBar()->showMessage(message);
|
||||
@@ -632,7 +632,7 @@ Song AlbumCoverManager::AlbumItemAsSong(AlbumItem *album_item) {
|
||||
QString title = album_item->data(Role_Album).toString();
|
||||
QString artist_name = album_item->data(Role_AlbumArtist).toString();
|
||||
if (!artist_name.isEmpty()) {
|
||||
result.set_title(artist_name + QStringLiteral(" - ") + title);
|
||||
result.set_title(artist_name + QLatin1String(" - ") + title);
|
||||
}
|
||||
else {
|
||||
result.set_title(title);
|
||||
|
||||
@@ -78,7 +78,7 @@ void CoverExportRunnable::ProcessAndExportCover() {
|
||||
if (song_.art_embedded() && dialog_result_.export_embedded_) {
|
||||
image = TagReaderClient::Instance()->LoadEmbeddedArtAsImageBlocking(song_.url().toLocalFile());
|
||||
if (!image.isNull()) {
|
||||
extension = QStringLiteral("jpg");
|
||||
extension = QLatin1String("jpg");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -113,7 +113,7 @@ void CoverExportRunnable::ProcessAndExportCover() {
|
||||
}
|
||||
|
||||
QString cover_dir = song_.url().toLocalFile().section(QLatin1Char('/'), 0, -2);
|
||||
QString new_file = cover_dir + QLatin1Char('/') + dialog_result_.filename_ + QLatin1Char('.') + (song_.art_embedded() ? QStringLiteral("jpg") : extension);
|
||||
QString new_file = cover_dir + QLatin1Char('/') + dialog_result_.filename_ + QLatin1Char('.') + (song_.art_embedded() ? QLatin1String("jpg") : extension);
|
||||
|
||||
// If the file exists, do not override!
|
||||
if (dialog_result_.overwrite_ == AlbumCoverExport::OverwriteMode::None && QFile::exists(new_file)) {
|
||||
@@ -171,7 +171,7 @@ void CoverExportRunnable::ExportCover() {
|
||||
image = TagReaderClient::Instance()->LoadEmbeddedArtAsImageBlocking(song_.url().toLocalFile());
|
||||
if (!image.isNull()) {
|
||||
embedded_cover = true;
|
||||
extension = QStringLiteral("jpg");
|
||||
extension = QLatin1String("jpg");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user