src/primitives.cpp

changeset 1064
4c7a353cf583
parent 1063
1f15c52c11f6
child 1065
c8ecddbd99e9
--- a/src/primitives.cpp	Sat Jan 28 14:01:19 2017 +0200
+++ b/src/primitives.cpp	Sat Jan 28 14:13:01 2017 +0200
@@ -189,7 +189,7 @@
 	{
 		QString line = QString::fromUtf8(categoriesFile.readLine()).trimmed();
 
-		if (line.length() == 0 or line[0] == '#')
+		if (line.isEmpty() or line[0] == '#')
 			continue;
 
 		int colon = line.indexOf (":");
@@ -436,7 +436,7 @@
 
 	// Truncate the root if necessary (7-16rin4.dat for instance).
 	// However, always keep the root at least 2 characters.
-	int extra = (frac.length() + numberString.length() + root.length()) - 8;
+	int extra = (length(frac) + length(numberString) + length(root)) - 8;
 	root.chop(qBound(0, extra, 2));
 
 	// Stick them all together and return the result.
@@ -581,7 +581,7 @@
 	m_manager(parent),
 	m_iterator(LDPaths::primitivesDir(), QDirIterator::Subdirectories)
 {
-	m_basePathLength = LDPaths::primitivesDir().absolutePath().length();
+	m_basePathLength = length(LDPaths::primitivesDir().absolutePath());
 	print("Scanning primitives...");
 }
 

mercurial