diff --git a/app/common/timecodefunctions.cpp b/app/common/timecodefunctions.cpp index b9961f6d0..f50b47a12 100644 --- a/app/common/timecodefunctions.cpp +++ b/app/common/timecodefunctions.cpp @@ -25,7 +25,7 @@ #include "config/config.h" QString padded(int64_t arg, int padding) { - return QString("%1").arg(arg, padding, 10, QChar('0')); + return QStringLiteral("%1").arg(arg, padding, 10, QChar('0')); } QString olive::timestamp_to_timecode(const int64_t ×tamp, @@ -62,11 +62,11 @@ QString olive::timestamp_to_timecode(const int64_t ×tamp, int64_t secs = total_seconds - mins * 60; int64_t fraction = qRound64((timestamp_dbl - static_cast(total_seconds)) * 1000); - return QString("%1%2:%3:%4.%5").arg(prefix, - padded(hours, 2), - padded(mins, 2), - padded(secs, 2), - padded(fraction, 3)); + return QStringLiteral("%1%2:%3:%4.%5").arg(prefix, + padded(hours, 2), + padded(mins, 2), + padded(secs, 2), + padded(fraction, 3)); } else { // Determine what symbol to separate frames (";" is used for drop frame, ":" is non-drop frame) QString frame_token; @@ -112,12 +112,12 @@ QString olive::timestamp_to_timecode(const int64_t ×tamp, secs = f / rounded_frame_rate % 60; frames = f % rounded_frame_rate; - return QString("%1%2:%3:%4%5%6").arg(prefix, - padded(hours, 2), - padded(mins, 2), - padded(secs, 2), - frame_token, - padded(frames, 2)); + return QStringLiteral("%1%2:%3:%4%5%6").arg(prefix, + padded(hours, 2), + padded(mins, 2), + padded(secs, 2), + frame_token, + padded(frames, 2)); } } case kFrames: diff --git a/app/dialog/about/about.cpp b/app/dialog/about/about.cpp index 76c6fd941..e34abecec 100644 --- a/app/dialog/about/about.cpp +++ b/app/dialog/about/about.cpp @@ -35,20 +35,20 @@ AboutDialog::AboutDialog(QWidget *parent) : // Construct About text QLabel* label = - new QLabel(QString("" - "

" - "

" - "" - "https://www.olivevideoeditor.org/" - "

" - "

%1

" // AppName (version identifier) - "

%2

" // First statement - "

%3

" // Second statement - "").arg(QApplication::applicationName(), - tr("Olive is a non-linear video editor. This software is free and " - "protected by the GNU GPL."), - tr("Olive Team is obliged to inform users that Olive source code is " - "available for download from its website.")),this); + new QLabel(QStringLiteral("" + "

" + "

" + "" + "https://www.olivevideoeditor.org/" + "

" + "

%1

" // AppName (version identifier) + "

%2

" // First statement + "

%3

" // Second statement + "").arg(QApplication::applicationName(), + tr("Olive is a non-linear video editor. This software is free and " + "protected by the GNU GPL."), + tr("Olive Team is obliged to inform users that Olive source code is " + "available for download from its website.")),this); // Set text formatting label->setAlignment(Qt::AlignCenter); diff --git a/app/dialog/actionsearch/actionsearch.cpp b/app/dialog/actionsearch/actionsearch.cpp index b5227655a..0c20cb44b 100644 --- a/app/dialog/actionsearch/actionsearch.cpp +++ b/app/dialog/actionsearch/actionsearch.cpp @@ -157,7 +157,7 @@ void ActionSearch::search_update(const QString &s, const QString &p, QMenu *pare if (comp.contains(s, Qt::CaseInsensitive)) { // If so, we add it to the list widget. - QListWidgetItem* item = new QListWidgetItem(QString("%1\n(%2)").arg(comp, menu_text), list_widget); + QListWidgetItem* item = new QListWidgetItem(QStringLiteral("%1\n(%2)").arg(comp, menu_text), list_widget); // Add a pointer to the original QAction in the item's data item->setData(Qt::UserRole+1, reinterpret_cast(a)); diff --git a/app/ui/icons/icons.cpp b/app/ui/icons/icons.cpp index 080fec62d..90ef7dc40 100644 --- a/app/ui/icons/icons.cpp +++ b/app/ui/icons/icons.cpp @@ -123,7 +123,7 @@ QIcon olive::icon::Create(const QString& theme, const QString &name) QIcon icon; for (int i=0;isetPalette(ParsePalette(palette_file)); } else { @@ -151,7 +151,7 @@ void StyleManager::SetStyle(const QString &style_path) } // Set CSS style for this - QFile css_file(QString("%1/style.css").arg(style_path)); + QFile css_file(QStringLiteral("%1/style.css").arg(style_path)); if (css_file.exists() && css_file.open(QFile::ReadOnly | QFile::Text)) { // Read in entire CSS from file and set as the application stylesheet diff --git a/app/widget/audiomonitor/audiomonitor.cpp b/app/widget/audiomonitor/audiomonitor.cpp index ef381432c..a6c73404f 100644 --- a/app/widget/audiomonitor/audiomonitor.cpp +++ b/app/widget/audiomonitor/audiomonitor.cpp @@ -72,7 +72,7 @@ void AudioMonitor::paintEvent(QPaintEvent *) if (i <= kDecibelMinimum) { db_label = "-∞"; } else { - db_label = QString("%1").arg(i); + db_label = QStringLiteral("%1").arg(i); } qreal log_val = QAudio::convertVolume(i, QAudio::DecibelVolumeScale, QAudio::LogarithmicVolumeScale); diff --git a/app/widget/taskview/taskviewitem.cpp b/app/widget/taskview/taskviewitem.cpp index dd525302f..2f7debc3e 100644 --- a/app/widget/taskview/taskviewitem.cpp +++ b/app/widget/taskview/taskviewitem.cpp @@ -70,7 +70,7 @@ void TaskViewItem::SetTask(Task *t) task_ = t; // Set name label to the name (bolded) - task_name_lbl_->setText(QString("%1").arg(task_->text())); + task_name_lbl_->setText(QStringLiteral("%1").arg(task_->text())); // Connect to the task connect(task_, SIGNAL(StatusChanged(Task::Status)), this, SLOT(TaskStatusChange(Task::Status))); diff --git a/app/widget/timelinewidget/view/timelineviewblockitem.cpp b/app/widget/timelinewidget/view/timelineviewblockitem.cpp index d227e0c12..d9ab38550 100644 --- a/app/widget/timelinewidget/view/timelineviewblockitem.cpp +++ b/app/widget/timelinewidget/view/timelineviewblockitem.cpp @@ -21,6 +21,7 @@ #include "timelineviewblockitem.h" #include +#include #include #include #include @@ -62,11 +63,11 @@ void TimelineViewBlockItem::UpdateRect() setRect(0, y_, item_width - 1, height_ - 1); setPos(item_left, 0.0); - // FIXME: Untranslated - setToolTip(QString("%1\n\nIn: %2\nOut: %3\nMedia In: %4").arg(block_->Name(), - QString::number(block_->in().toDouble()), - QString::number(block_->out().toDouble()), - QString::number(block_->media_in().toDouble()))); + setToolTip(QCoreApplication::translate("TimelineViewBlockItem", + "%1\n\nIn: %2\nOut: %3\nMedia In: %4").arg(block_->Name(), + QString::number(block_->in().toDouble()), + QString::number(block_->out().toDouble()), + QString::number(block_->media_in().toDouble()))); } void TimelineViewBlockItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)