diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-12-11 23:00:09 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-12-11 23:00:09 (GMT) |
commit | d5d35896457d580f834c5954c3c387b76efd27e1 (patch) | |
tree | 37cc3a02fe43d0e76006deb112f2a42b56e8073a | |
parent | a6548afb4a481fb5e116dd319ac8eda754a9169e (diff) | |
parent | 2aa21ab606a14ba63acb8f42fe4eb9f99ddad277 (diff) | |
download | Qt-d5d35896457d580f834c5954c3c387b76efd27e1.zip Qt-d5d35896457d580f834c5954c3c387b76efd27e1.tar.gz Qt-d5d35896457d580f834c5954c3c387b76efd27e1.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-water
-rw-r--r-- | tools/linguist/linguist/messagemodel.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/linguist/linguist/messagemodel.cpp b/tools/linguist/linguist/messagemodel.cpp index 39ba9fd..c2edc75 100644 --- a/tools/linguist/linguist/messagemodel.cpp +++ b/tools/linguist/linguist/messagemodel.cpp @@ -209,6 +209,13 @@ bool DataModel::load(const QString &fileName, bool *langGuessed, QWidget *parent return false; } + if (!tor.messageCount()) { + QMessageBox::warning(parent, QObject::tr("Qt Linguist"), + tr("The translation file '%1' will not be loaded because it is empty.") + .arg(Qt::escape(fileName))); + return false; + } + Translator::Duplicates dupes = tor.resolveDuplicates(); if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) { QString err = tr("<qt>Duplicate messages found in '%1':").arg(Qt::escape(fileName)); |