Add cpp files for classes with only header files

This commit is contained in:
Jonas Kvinge
2024-08-12 00:48:16 +02:00
parent 1ebcd61a75
commit f624b7a331
19 changed files with 317 additions and 47 deletions

View File

@@ -2,6 +2,7 @@
* Strawberry Music Player
* This file was part of Clementine.
* Copyright 2010, David Sansome <me@davidsansome.com>
* Copyright 2018-2024, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,6 +23,7 @@
#define POTRANSLATOR_H
#include <QTranslator>
#include <QString>
// We convert from .po files to .qm files, which loses context information.
// This translator tries loading strings with an empty context if it can't find any others.
@@ -30,12 +32,8 @@ class PoTranslator : public QTranslator {
Q_OBJECT
public:
PoTranslator(QObject *parent = nullptr) : QTranslator(parent) {}
QString translate(const char *context, const char *source_text, const char *disambiguation = nullptr, int n = -1) const override {
QString ret = QTranslator::translate(context, source_text, disambiguation, n);
if (!ret.isEmpty()) return ret;
return QTranslator::translate(nullptr, source_text, disambiguation, n);
}
explicit PoTranslator(QObject *parent = nullptr);
QString translate(const char *context, const char *source_text, const char *disambiguation = nullptr, int n = -1) const override;
};
#endif // POTRANSLATOR_H