summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-09 11:25:55 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-10 14:31:24 (GMT)
commit94584dcdd02e2c08e05ca75f6f8b460c0c320947 (patch)
tree2c2149eb488db6a0d2487246e00994374ed69a9d /tools
parent0b78630df897864feb3e3ec5f1da0b21dd13f7b0 (diff)
downloadQt-94584dcdd02e2c08e05ca75f6f8b460c0c320947.zip
Qt-94584dcdd02e2c08e05ca75f6f8b460c0c320947.tar.gz
Qt-94584dcdd02e2c08e05ca75f6f8b460c0c320947.tar.bz2
don't try to show source when no locations are given
Task-number: QTBUG-13466
Diffstat (limited to 'tools')
-rw-r--r--tools/linguist/linguist/mainwindow.cpp6
-rw-r--r--tools/linguist/linguist/sourcecodeview.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 265df05..18baa24 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -1522,7 +1522,7 @@ void MainWindow::selectedMessageChanged(const QModelIndex &sortedIndex, const QM
}
m_phraseView->setSourceText(-1, QString());
}
- if (m) {
+ if (m && !m->fileName().isEmpty()) {
if (hasFormPreview(m->fileName())) {
m_sourceAndFormView->setCurrentWidget(m_formPreviewView);
m_formPreviewView->setSourceContext(model, m);
@@ -1577,7 +1577,7 @@ void MainWindow::updateTranslation(const QStringList &translations)
return;
m->setTranslations(translations);
- if (hasFormPreview(m->fileName()))
+ if (!m->fileName().isEmpty() && hasFormPreview(m->fileName()))
m_formPreviewView->setSourceContext(m_currentIndex.model(), m);
updateDanger(m_currentIndex, true);
@@ -1996,7 +1996,7 @@ void MainWindow::updateLatestModel(int model)
if (m_currentIndex.isValid()) {
if (MessageItem *item = m_dataModel->messageItem(m_currentIndex)) {
- if (hasFormPreview(item->fileName()))
+ if (!item->fileName().isEmpty() && hasFormPreview(item->fileName()))
m_formPreviewView->setSourceContext(model, item);
if (enableRw && !item->isObsolete())
m_phraseView->setSourceText(model, item->text());
diff --git a/tools/linguist/linguist/sourcecodeview.cpp b/tools/linguist/linguist/sourcecodeview.cpp
index b8dd9c0..d2eef56 100644
--- a/tools/linguist/linguist/sourcecodeview.cpp
+++ b/tools/linguist/linguist/sourcecodeview.cpp
@@ -64,7 +64,7 @@ void SourceCodeView::setSourceContext(const QString &fileName, const int lineNum
m_fileToLoad.clear();
setToolTip(fileName);
- if (fileName.isNull()) {
+ if (fileName.isEmpty()) {
clear();
m_currentFileName.clear();
appendHtml(tr("<i>Source code not available</i>"));