~mrp/aerodramus

81f69d76cb60e4937a0a8a553ab656ba6388ab0d — Mark Penner 5 months ago 4395629
use _s operator rather than QStringLiteral macro
3 files changed, 18 insertions(+), 19 deletions(-)

M src/CalculatorPage.cpp
M src/MainWindow.cpp
M src/main.cpp
M src/CalculatorPage.cpp => src/CalculatorPage.cpp +5 -4
@@ 7,6 7,7 @@
#include <QFormLayout>
#include <QPushButton>
#include <QStatusBar>
using namespace Qt::Literals::StringLiterals;

CalculatorPage::CalculatorPage(QWidget *parent, KXmlGuiWindow *mainWindow)
    : QWidget(parent)


@@ 20,20 21,20 @@ CalculatorPage::CalculatorPage(QWidget *parent, KXmlGuiWindow *mainWindow)

    m_sensitivitySpinBox->setRange(0.0, 200.0);
    m_sensitivitySpinBox->setSingleStep(0.1);
    m_sensitivitySpinBox->setSuffix(QStringLiteral("dB"));
    m_sensitivitySpinBox->setSuffix(u"dB"_s);
    formLayout->addRow(i18n("Sensitivity (1W @ 1m)"), m_sensitivitySpinBox);

    m_powerSpinBox->setRange(0.0, 10000.0);
    m_powerSpinBox->setSingleStep(10.0);
    m_powerSpinBox->setSuffix(QStringLiteral("W"));
    m_powerSpinBox->setSuffix(u"W"_s);
    formLayout->addRow(i18n("Power"), m_powerSpinBox);

    m_distanceSpinBox->setRange(0.0, 10000.0);
    m_distanceSpinBox->setSuffix(QStringLiteral("m"));
    m_distanceSpinBox->setSuffix(u"m"_s);
    formLayout->addRow(i18n("Distance"), m_distanceSpinBox);

    m_dBSpinBox->setRange(0.0, 200.0);
    m_dBSpinBox->setSuffix(QStringLiteral("dB"));
    m_dBSpinBox->setSuffix(u"dB"_s);
    formLayout->addRow(i18n("dB @ distance"), m_dBSpinBox);

    QPushButton *calculateButton{new QPushButton(i18n("Calculate"), this)};

M src/MainWindow.cpp => src/MainWindow.cpp +7 -6
@@ 13,6 13,7 @@
#include <QDockWidget>
#include <QFileDialog>
#include <QStandardPaths>
using namespace Qt::Literals::StringLiterals;

MainWindow::MainWindow(QWidget *parent)
    : KXmlGuiWindow(parent)


@@ 28,7 29,7 @@ MainWindow::MainWindow(QWidget *parent)
    connect(m_pageList, &QListWidget::currentRowChanged, m_pageStack, &QStackedWidget::setCurrentIndex);

    setupActions();
    setupGUI(Default, QStringLiteral("aerodramusui.rc"));
    setupGUI(Default, u"aerodramusui.rc"_s);
}

void MainWindow::setupActions()


@@ 38,14 39,14 @@ void MainWindow::setupActions()

    QAction *addCalcPageAction = new QAction(this);
    addCalcPageAction->setText(i18n("&Add Calculator"));
    addCalcPageAction->setIcon(QIcon::fromTheme(QStringLiteral("accessories-calculator")));
    actionCollection()->addAction(QStringLiteral("addCalcPage"), addCalcPageAction);
    addCalcPageAction->setIcon(QIcon::fromTheme(u"accessories-calculator"_s));
    actionCollection()->addAction(u"addCalcPage"_s, addCalcPageAction);
    connect(addCalcPageAction, &QAction::triggered, this, &MainWindow::addCalcPage);

    QAction *closeCurrentPageAction = new QAction(this);
    closeCurrentPageAction->setText(i18n("&Close Page"));
    closeCurrentPageAction->setIcon(QIcon::fromTheme(QStringLiteral("window-close")));
    actionCollection()->addAction(QStringLiteral("closeCurrentPage"), closeCurrentPageAction);
    closeCurrentPageAction->setIcon(QIcon::fromTheme(u"window-close"_s));
    actionCollection()->addAction(u"closeCurrentPage"_s, closeCurrentPageAction);
    connect(closeCurrentPageAction, &QAction::triggered, this, &MainWindow::closeCurrentPage);
}



@@ 61,7 62,7 @@ void MainWindow::openFile()
void MainWindow::addCalcPage()
{
    CalculatorPage *page = new CalculatorPage(nullptr, this);
    addPage(QStringLiteral("Calculator"), page);
    addPage(i18n("Calculator"), page);
}

void MainWindow::addPage(const QString &title, QWidget *widget)

M src/main.cpp => src/main.cpp +6 -9
@@ 8,26 8,23 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QUrl>
using namespace Qt::Literals::StringLiterals;

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    KLocalizedString::setApplicationDomain("aerodramus");

    KAboutData aboutData(QStringLiteral("aerodramus"),
    KAboutData aboutData(u"aerodramus"_s,
                         i18n("Aerodramus 0.0.1"),
                         QStringLiteral("0.0.1"),
                         u"0.0.1"_s,
                         i18n("Acoustics analysis tools"),
                         KAboutLicense::GPL_V3,
                         i18n("(c) 2023"),
                         i18n("A collection of tools for analyzing room acoustics"),
                         QStringLiteral("https://codeberg.org/mrp/aerodramus"),
                         QStringLiteral("mrpenner@mailbox.org"));
    aboutData.addAuthor(i18n("Mark Penner"),
                        i18n("Developer"),
                        QStringLiteral("mrpenner@mailbox.org"),
                        QStringLiteral("https://markpenner.space"),
                        QStringLiteral(""));
                         u"https://codeberg.org/mrp/aerodramus"_s,
                         u"mrpenner@mailbox.org"_s);
    aboutData.addAuthor(i18n("Mark Penner"), i18n("Developer"), u"mrpenner@mailbox.org"_s, u"https://markpenner.space"_s, u""_s);
    KAboutData::setApplicationData(aboutData);

    QCommandLineParser parser;