From 0074768854f60105591c2f83fc83e2eace510484 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Mon, 12 Nov 2018 22:17:03 -0800 Subject: [PATCH] Supress address book not existing warnings --- src/addressbook.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/addressbook.cpp b/src/addressbook.cpp index 245fa6a..3ea68dd 100644 --- a/src/addressbook.cpp +++ b/src/addressbook.cpp @@ -181,6 +181,10 @@ QList> AddressBook::readFromStorage() { QList> labels; + if (!file.exists()) { + return labels; + } + file.open(QIODevice::ReadOnly); QDataStream in(&file); // read the data serialized from the file QString version; @@ -212,4 +216,4 @@ QString AddressBook::writeableFile() { } else { return dir.filePath(filename); } -} \ No newline at end of file +}