From 0e5f7fe5670a5328680c8cae128d2fab97bda79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 6 Sep 2015 08:48:13 +0200 Subject: [PATCH] GUI: fixes to save cfg files properly in the library editor --- cfg/std.cfg | 90 ++++++++++++++++++------------------- gui/cppchecklibrarydata.cpp | 6 +-- 2 files changed, 46 insertions(+), 50 deletions(-) diff --git a/cfg/std.cfg b/cfg/std.cfg index b16f7d960..2df372fdc 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -2321,9 +2321,9 @@ + 0: - @@ -2340,9 +2340,9 @@ + 0: - @@ -2359,9 +2359,9 @@ + 0: - @@ -2378,9 +2378,9 @@ + 0: - @@ -2395,9 +2395,9 @@ + 0: - @@ -2412,9 +2412,9 @@ + 0: - @@ -2754,24 +2754,24 @@ - + false - - - - + + + + @@ -2779,15 +2779,15 @@ false - - - - + + + + @@ -2797,9 +2797,9 @@ - + @@ -2850,16 +2850,6 @@ - - free - malloc - calloc - - - fclose - fopen - tmpfile - false @@ -3392,9 +3382,8 @@ - - false + false @@ -3591,13 +3580,13 @@ false - + - + @@ -3783,17 +3772,39 @@ + false - - + + + + false + + + + + + + + + + + malloc + calloc + free + + + fopen + tmpfile + fclose + @@ -3867,8 +3878,7 @@ - - + @@ -3919,16 +3929,4 @@ - - - false - - - - - - - - - diff --git a/gui/cppchecklibrarydata.cpp b/gui/cppchecklibrarydata.cpp index 68c8f327e..7a2977747 100644 --- a/gui/cppchecklibrarydata.cpp +++ b/gui/cppchecklibrarydata.cpp @@ -243,7 +243,7 @@ static void writeContainer(QXmlStreamWriter &xmlWriter, const CppcheckLibraryDat xmlWriter.writeAttribute("id", container.id); if (!container.startPattern.isEmpty()) xmlWriter.writeAttribute("startPattern", container.startPattern); - if (!container.endPattern.isEmpty()) + if (!container.endPattern.isNull()) xmlWriter.writeAttribute("endPattern", container.endPattern); if (!container.inherits.isEmpty()) xmlWriter.writeAttribute("inherits", container.inherits); @@ -329,8 +329,7 @@ static void writeMemoryResource(QXmlStreamWriter &xmlWriter, const CppcheckLibra xmlWriter.writeStartElement(mr.type); foreach(const CppcheckLibraryData::MemoryResource::Alloc &alloc, mr.alloc) { xmlWriter.writeStartElement("alloc"); - if (alloc.init) - xmlWriter.writeAttribute("init", "true"); + xmlWriter.writeAttribute("init", alloc.init ? "true" : "false"); xmlWriter.writeCharacters(alloc.name); xmlWriter.writeEndElement(); } @@ -343,7 +342,6 @@ static void writeMemoryResource(QXmlStreamWriter &xmlWriter, const CppcheckLibra xmlWriter.writeEndElement(); } - QString CppcheckLibraryData::toString() const { QString outputString;