aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Shaforostoff <[email protected]>2015-12-08 03:13:51 +0200
committerNick Shaforostoff <[email protected]>2015-12-08 03:13:51 +0200
commit2c7614772b8c8a9d427131c2925392e9b1fbdb7f (patch)
tree5cfcff70c710e0c257c3d35ab3b802c0bce22294
parent4bfa92d3248eb655e3b0fc45378a56c342f98d81 (diff)
add sanity checks, fix build on osx
-rw-r--r--src/completionstorage.cpp1
-rw-r--r--src/main.cpp2
-rw-r--r--src/xlifftextedit.cpp1
3 files changed, 3 insertions, 1 deletions
diff --git a/src/completionstorage.cpp b/src/completionstorage.cpp
index afa61b8..df5e8af 100644
--- a/src/completionstorage.cpp
+++ b/src/completionstorage.cpp
@@ -47,6 +47,7 @@ CompletionStorage* CompletionStorage::instance()
void CompletionStorage::scanCatalog(Catalog* catalog)
{
+ if (!catalog->numberOfEntries()) return;
QTime a;a.start();
int wordCompletionLength=Settings::self()->wordCompletionLength();
diff --git a/src/main.cpp b/src/main.cpp
index 24452b7..1b0d691 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
QCommandLineParser parser;
- KAboutData about(QStringLiteral("lokalize"), i18nc("@title", "Lokalize"), QStringLiteral(LOKALIZE_VERSION), i18n("Computer-aided translation system.\nDo not translate what had already been translated."),
+ KAboutData about(QStringLiteral("lokalize"), i18nc("@title", "Lokalize"), LOKALIZE_VERSION, i18n("Computer-aided translation system.\nDo not translate what had already been translated."),
KAboutLicense::GPL, i18nc("@info:credit", "(c) 2007-2015 Nick Shaforostoff\n(c) 1999-2006 The KBabel developers") /*, KLocalizedString(), 0, "[email protected]"*/);
about.addAuthor( i18n("Nick Shaforostoff"), QString(), QStringLiteral("[email protected]") );
about.addCredit (i18n("Google Inc."), i18n("sponsored development as part of Google Summer Of Code program"), QString(), QStringLiteral("http://google.com"));
diff --git a/src/xlifftextedit.cpp b/src/xlifftextedit.cpp
index 52189f5..0c3fecd 100644
--- a/src/xlifftextedit.cpp
+++ b/src/xlifftextedit.cpp
@@ -966,6 +966,7 @@ void TranslationUnitTextEdit::insertTag(InlineTag tag)
int TranslationUnitTextEdit::strForMicePosIfUnderTag(QPoint mice, CatalogString& str, bool tryHarder)
{
+ if (m_currentPos.entry==-1) return -1;
QTextCursor cursor=cursorForPosition(mice);
int pos=cursor.position();
str=m_catalog->catalogString(m_currentPos);