Skip to content

Commit

Permalink
Apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
johanmalm committed Jun 21, 2024
1 parent 67cf47f commit 8684b0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
#include <QLibraryInfo>
#include <QTranslator>

static void initLocale(QTranslator* qtTranslator, QTranslator* translator)
static void initLocale(QTranslator *qtTranslator, QTranslator *translator)
{
QApplication* app = qApp;
QApplication *app = qApp;
#if PROJECT_TRANSLATION_TEST_ENABLED
QLocale locale(QLocale(PROJECT_TRANSLATION_TEST_LANGUAGE));
QLocale::setDefault(locale);
#else
QLocale locale = QLocale::system();
#endif
// Qt translations (buttons text and the like)
QString translationsPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
QString translationsPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
QString translationsFileName = QStringLiteral("qt_") + locale.name();

if (qtTranslator->load(translationsFileName, translationsPath))
Expand All @@ -30,7 +30,8 @@ static void initLocale(QTranslator* qtTranslator, QTranslator* translator)
if (!isLoaded) {
// "/usr/share/<appname>/translations
isLoaded = translator->load(translationsFileName,
QStringLiteral(PROJECT_DATA_DIR) + QStringLiteral("/translations"));
QStringLiteral(PROJECT_DATA_DIR)
+ QStringLiteral("/translations"));
}
app->installTranslator(translator);
}
Expand All @@ -47,9 +48,9 @@ int main(int argc, char *argv[])
w.show();

// Make work the window icon also when the application is not (yet) installed
QString iconSuffix = QString("%1%2%3").arg("/", PROJECT_APPSTREAM_ID, QStringLiteral(".svg"));
QString iconSuffix = QString("%1%2%3").arg("/", PROJECT_APPSTREAM_ID, QStringLiteral(".svg"));
QString icoLocalPath = QCoreApplication::applicationDirPath() + iconSuffix;
QString icoSysPath = QStringLiteral(PROJECT_ICON_SYSTEM_PATH) + iconSuffix;
QString icoSysPath = QStringLiteral(PROJECT_ICON_SYSTEM_PATH) + iconSuffix;

QIcon appIcon = QIcon(icoLocalPath);
if (appIcon.isNull())
Expand Down
2 changes: 1 addition & 1 deletion src/maindialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MainDialog::MainDialog(QWidget *parent) : QDialog(parent), ui(new Ui::MainDialog
std::string config_file = config_dir + "/rc.xml";
initConfig(config_file);

QObject::connect(ui->buttonBox, &QDialogButtonBox::clicked, [&] (QAbstractButton *button) {
QObject::connect(ui->buttonBox, &QDialogButtonBox::clicked, [&](QAbstractButton *button) {
if (ui->buttonBox->standardButton(button) == QDialogButtonBox::Apply) {
onApply();
}
Expand Down

0 comments on commit 8684b0e

Please sign in to comment.