From 1ab3b6c608bb4099c5518a6c58feef23e0aa2aca Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 28 Feb 2014 15:06:14 +0200 Subject: [PATCH] Set default name for file if empty. --HG-- branch : develop --- src/tablewindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tablewindow.cpp b/src/tablewindow.cpp index 7215028ab..c59521075 100644 --- a/src/tablewindow.cpp +++ b/src/tablewindow.cpp @@ -122,7 +122,16 @@ void TableWindow::ModelChosen(QVector listDetails, const QString &fileNa { this->description = description; - QFileInfo fi( fileName ); + QString file; + if (fileName.isEmpty()) + { + file = tr("untitled"); + } + else + { + file = fileName; + } + QFileInfo fi( file ); this->fileName = fi.baseName(); this->listDetails = listDetails;