mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 19:31:02 +01:00
Don't try to load translations from a directory that contains another directory called "clementine". Fixes issue #88
This commit is contained in:
parent
f8dd079cfd
commit
4ab755c831
10
src/main.cpp
10
src/main.cpp
@ -23,9 +23,17 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void LoadTranslation(const QString& prefix, const QString& path) {
|
void LoadTranslation(const QString& prefix, const QString& path) {
|
||||||
|
// QTranslator::load will try to open and read "clementine" if it exists,
|
||||||
|
// without checking if it's a file first.
|
||||||
|
QFileInfo maybe_clementine_directory(path + "/clementine");
|
||||||
|
if (maybe_clementine_directory.exists() && !maybe_clementine_directory.isFile())
|
||||||
|
return;
|
||||||
|
|
||||||
QTranslator* t = new QTranslator;
|
QTranslator* t = new QTranslator;
|
||||||
t->load(prefix + "_" + QLocale::system().name(), path);
|
if (t->load(prefix + "_" + QLocale::system().name(), path))
|
||||||
QCoreApplication::installTranslator(t);
|
QCoreApplication::installTranslator(t);
|
||||||
|
else
|
||||||
|
delete t;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user