From 4922ce71739be6a0f36c0b4b8bea48ba8e63a645 Mon Sep 17 00:00:00 2001 From: Rafael Date: Mon, 28 Mar 2016 15:32:02 +0200 Subject: [PATCH] less memory allocation at delete picture --- SnapmaticPicture.cpp | 1 - SnapmaticWidget.cpp | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/SnapmaticPicture.cpp b/SnapmaticPicture.cpp index 6954d6d..26c7cd5 100755 --- a/SnapmaticPicture.cpp +++ b/SnapmaticPicture.cpp @@ -136,7 +136,6 @@ bool SnapmaticPicture::readingPicture() picFile->deleteLater(); delete picFile; return picOk; - } QString SnapmaticPicture::getSnapmaticPictureString(QByteArray snapmaticHeader) diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp index 460873e..75a760f 100755 --- a/SnapmaticWidget.cpp +++ b/SnapmaticWidget.cpp @@ -75,8 +75,7 @@ void SnapmaticWidget::on_cmdDelete_clicked() int uchoice = QMessageBox::question(this, tr("Delete picture"), tr("You're sure to delete %1 from your Snapmatic pictures?").arg(picStr), QMessageBox::No | QMessageBox::Yes, QMessageBox::No); if (uchoice == QMessageBox::Yes) { - QFile pictureFile(picPath); - if (!pictureFile.exists()) + if (!QFile::exists(picPath)) { emit pictureDeleted(); }