src/primitives.cpp

changeset 966
a834e43a57da
parent 962
a4b463a7ee82
child 967
eb586d3e1a6a
equal deleted inserted replaced
965:d1b0aa40db91 966:a834e43a57da
129 129
130 // ============================================================================= 130 // =============================================================================
131 // 131 //
132 void PrimitiveScanner::work() 132 void PrimitiveScanner::work()
133 { 133 {
134 int j = Min (m_i + 100, m_files.size()); 134 int j = qMin (m_i + 100, m_files.size());
135 135
136 for (; m_i < j; ++m_i) 136 for (; m_i < j; ++m_i)
137 { 137 {
138 QString fname = m_files[m_i]; 138 QString fname = m_files[m_i];
139 QFile f (fname); 139 QFile f (fname);
580 QString numstr = (type == Ring or type == Cone) ? format ("%1", num) : ""; 580 QString numstr = (type == Ring or type == Cone) ? format ("%1", num) : "";
581 581
582 // Truncate the root if necessary (7-16rin4.dat for instance). 582 // Truncate the root if necessary (7-16rin4.dat for instance).
583 // However, always keep the root at least 2 characters. 583 // However, always keep the root at least 2 characters.
584 int extra = (frac.length() + numstr.length() + root.length()) - 8; 584 int extra = (frac.length() + numstr.length() + root.length()) - 8;
585 root.chop (Clamp (extra, 0, 2)); 585 root.chop (qBound (0, extra, 2));
586 586
587 // Stick them all together and return the result. 587 // Stick them all together and return the result.
588 return prefix + frac + root + numstr + ".dat"; 588 return prefix + frac + root + numstr + ".dat";
589 } 589 }
590 590

mercurial