Hi,

this patch prevents two warring, one from trying to connect to the marble when 
compiling without it and one form trying to open an inexistent image file.

Best
Robert

From 6d6307a2329a16992be57257f44675870eede8f2 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Fri, 31 Jul 2015 22:25:43 +0200
Subject: [PATCH] Make debugging cleaner

Don't try to connect the globe when NOMARBLE is active.

Check exisistance before trying to open an image file.

Signed-off-by: Robert C. Helling <[email protected]>
---
 qt-ui/maintab.cpp | 2 ++
 qthelper.cpp      | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 369a754..443837a 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -463,7 +463,9 @@ void MainTab::updateDiveInfo(bool clear)
        // I don't like this code here - but globe() wasn't initialized on the 
constructor.
        {
                QListView *completerListview = 
qobject_cast<QListView*>(ui.location->completer()->popup());
+#ifndef NO_MARBLE
                connect(completerListview, SIGNAL(entered(QModelIndex)), 
GlobeGPS::instance(), SLOT(centerOnIndex(QModelIndex)), Qt::UniqueConnection);
+#endif
        }
 
        EditMode rememberEM = editMode;
diff --git a/qthelper.cpp b/qthelper.cpp
index c6c7b9e..14a48c1 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -841,7 +841,7 @@ QByteArray hashFile(const QString filename)
 {
        QCryptographicHash hash(QCryptographicHash::Sha1);
        QFile imagefile(filename);
-       if (imagefile.open(QIODevice::ReadOnly)) {
+       if (imagefile.exists() && imagefile.open(QIODevice::ReadOnly)) {
                hash.addData(&imagefile);
                add_hash(filename, hash.result());
                return hash.result();
-- 
1.9.5 (Apple Git-50.3)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to