- added debug/release build configuration. Debug builds are really useful things!

Fri, 18 Oct 2013 17:47:05 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Fri, 18 Oct 2013 17:47:05 +0300
changeset 509
dcacfd2cd81b
parent 508
7ace3537a560
child 510
ee90c55dfeef

- added debug/release build configuration. Debug builds are really useful things!
- fixed an assertion failure with use of QString::operator[]

ldforge.pro file | annotate | diff | comparison | revisions
src/file.cpp file | annotate | diff | comparison | revisions
--- a/ldforge.pro	Wed Oct 16 23:20:35 2013 +0300
+++ b/ldforge.pro	Fri Oct 18 17:47:05 2013 +0300
@@ -21,7 +21,14 @@
 FORMS           = ui/*.ui
 QT             += opengl network
 QMAKE_CXXFLAGS += -std=c++0x
+CONFIG         += debug_and_release
+
+CONFIG (debug, debug|release) {
+	TARGET = ldforge_debug
+} else {
+	TARGET = ldforge
+}
 
 unix {
 	LIBS += -lGLU
-}
\ No newline at end of file
+}
--- a/src/file.cpp	Wed Oct 16 23:20:35 2013 +0300
+++ b/src/file.cpp	Fri Oct 18 17:47:05 2013 +0300
@@ -281,7 +281,7 @@
 void FileLoader::work (int i)
 {	// User wishes to abort, so stop here now.
 	if (aborted())
-{	for (LDObject * obj : m_objs)
+	{	for (LDObject* obj : m_objs)
 			delete obj;
 
 		m_objs.clear();
@@ -298,7 +298,7 @@
 		// Trim the trailing newline
 		qchar c;
 
-		while ( (c = line[line.length() - 1]) == '\n' || c == '\r')
+		while (!line.isEmpty() && (c = line[line.length() - 1]) == '\n' || c == '\r')
 			line.chop (1);
 
 		LDObject* obj = parseLine (line);

mercurial