From 5243999c3cce91cb67ae11b7de445d5e955731b1 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Tue, 4 Sep 2012 20:13:22 +0200 Subject: example: minor fix to gettingStarted - part5 Do not compare a QString to "". Instead use the .isEmpty() method. Change-Id: Ifda1361b2c288dd590f0294daacdf5e2d9241522 Reviewed-by: Qt Doc Bot Reviewed-by: Geir Vattekar --- examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/widgets/tutorials/gettingStarted') diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp b/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp index 25ee5d0fbb..5a45edf852 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp @@ -89,7 +89,7 @@ void Notepad::open() QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", tr("Text Files (*.txt);;C++ Files (*.cpp *.h)")); - if (fileName != "") { + if (!fileName.isEmpty()) { QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Error"), tr("Could not open file")); @@ -107,7 +107,7 @@ void Notepad::save() QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "", tr("Text Files (*.txt);;C++ Files (*.cpp *.h)")); - if (fileName != "") { + if (!fileName.isEmpty()) { QFile file(fileName); if (!file.open(QIODevice::WriteOnly)) { // error message -- cgit v1.2.3