mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 11:19:18 +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
12
src/main.cpp
12
src/main.cpp
@ -23,9 +23,17 @@
|
||||
#endif
|
||||
|
||||
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;
|
||||
t->load(prefix + "_" + QLocale::system().name(), path);
|
||||
QCoreApplication::installTranslator(t);
|
||||
if (t->load(prefix + "_" + QLocale::system().name(), path))
|
||||
QCoreApplication::installTranslator(t);
|
||||
else
|
||||
delete t;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
Loading…
Reference in New Issue
Block a user