From d2e6e3b49b311f6eb48b4192f6539078418bd066 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Thu, 8 Jul 2010 20:06:03 +0300 Subject: [PATCH] GUI: Don't write empty elements to project file. --- gui/projectfiledialog.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index 92403e40a..49f3fe484 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -114,9 +114,27 @@ void ProjectFileDialog::DialogAccepted() void ProjectFileDialog::UpdateProjectFileData() { - QStringList includes = mUI.mEditIncludePaths->text().split(";"); + QString include = mUI.mEditIncludePaths->text(); + QStringList includes; + if (!include.isEmpty()) + { + include = include.trimmed(); + if (include.indexOf(';') != -1) + includes = include.split(";"); + else + includes.append(include); + } mPFile->SetIncludes(includes); - QStringList defines = mUI.mEditDefines->text().split(";"); + QString define = mUI.mEditDefines->text(); + QStringList defines; + if (!define.isEmpty()) + { + define = define.trimmed(); + if (define.indexOf(';') != -1) + defines = define.split(";"); + else + defines.append(define); + } mPFile->SetDefines(defines); }