1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 03:09:57 +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:
David Sansome 2010-03-23 18:00:55 +00:00
parent f8dd079cfd
commit 4ab755c831

View File

@ -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[]) {