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 <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2015-07-31 22:25:43 +02:00 committed by Dirk Hohndel
parent faa1c28100
commit 260ea879e5
2 changed files with 3 additions and 1 deletions

View file

@ -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;

View file

@ -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();