comparison widgets/TransformFinder.cpp @ 807:e4773943c9c1 warnfix_no_size_t

More unsigned/long and warning fixes
author Chris Cannam
date Tue, 17 Jun 2014 15:55:27 +0100
parents 1a0dfcbffaf1
children 4a578a360011
comparison
equal deleted inserted replaced
806:4c8ca536b54f 807:e4773943c9c1
199 m_sortedResults.clear(); 199 m_sortedResults.clear();
200 for (std::set<TextMatcher::Match>::const_iterator j = sorted.end(); 200 for (std::set<TextMatcher::Match>::const_iterator j = sorted.end();
201 j != sorted.begin(); ) { 201 j != sorted.begin(); ) {
202 --j; 202 --j;
203 m_sortedResults.push_back(*j); 203 m_sortedResults.push_back(*j);
204 if (m_sortedResults.size() == maxResults) break; 204 if ((int)m_sortedResults.size() == maxResults) break;
205 } 205 }
206 206
207 if (m_sortedResults.empty()) m_selectedTransform = ""; 207 if (m_sortedResults.empty()) m_selectedTransform = "";
208 else m_selectedTransform = m_sortedResults.begin()->key; 208 else m_selectedTransform = m_sortedResults.begin()->key;
209 209
210 m_upToDateCount = 0; 210 m_upToDateCount = 0;
211 211
212 for (int j = m_labels.size(); j > m_sortedResults.size(); ) { 212 for (int j = (int)m_labels.size(); j > (int)m_sortedResults.size(); ) {
213 m_labels[--j]->hide(); 213 m_labels[--j]->hide();
214 } 214 }
215 215
216 m_beforeSearchLabel->hide(); 216 m_beforeSearchLabel->hide();
217 217
233 } 233 }
234 234
235 return; 235 return;
236 } 236 }
237 237
238 if (m_upToDateCount >= m_sortedResults.size()) return; 238 if (m_upToDateCount >= (int)m_sortedResults.size()) return;
239 239
240 while (m_upToDateCount < m_sortedResults.size()) { 240 while (m_upToDateCount < (int)m_sortedResults.size()) {
241 241
242 int i = m_upToDateCount; 242 int i = m_upToDateCount;
243 243
244 // cerr << "sorted size = " << m_sortedResults.size() << endl; 244 // cerr << "sorted size = " << m_sortedResults.size() << endl;
245 245
300 selectedText += tr("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; More information: <a href=\"%1\">%1</a>") 300 selectedText += tr("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; More information: <a href=\"%1\">%1</a>")
301 .arg(desc.infoUrl); 301 .arg(desc.infoUrl);
302 } 302 }
303 selectedText += tr("</small>"); 303 selectedText += tr("</small>");
304 304
305 if (i >= m_labels.size()) { 305 if (i >= (int)m_labels.size()) {
306 SelectableLabel *label = new SelectableLabel(m_resultsFrame); 306 SelectableLabel *label = new SelectableLabel(m_resultsFrame);
307 m_resultsLayout->addWidget(label); 307 m_resultsLayout->addWidget(label);
308 connect(label, SIGNAL(selectionChanged()), this, 308 connect(label, SIGNAL(selectionChanged()), this,
309 SLOT(selectedLabelChanged())); 309 SLOT(selectedLabelChanged()));
310 connect(label, SIGNAL(doubleClicked()), this, 310 connect(label, SIGNAL(doubleClicked()), this,
336 void 336 void
337 TransformFinder::selectedLabelChanged() 337 TransformFinder::selectedLabelChanged()
338 { 338 {
339 QObject *s = sender(); 339 QObject *s = sender();
340 m_selectedTransform = ""; 340 m_selectedTransform = "";
341 for (int i = 0; i < m_labels.size(); ++i) { 341 for (int i = 0; i < (int)m_labels.size(); ++i) {
342 if (!m_labels[i]->isVisible()) continue; 342 if (!m_labels[i]->isVisible()) continue;
343 if (m_labels[i] == s) { 343 if (m_labels[i] == s) {
344 if (m_labels[i]->isSelected()) { 344 if (m_labels[i]->isSelected()) {
345 m_selectedTransform = m_labels[i]->objectName(); 345 m_selectedTransform = m_labels[i]->objectName();
346 } 346 }
372 } 372 }
373 373
374 void 374 void
375 TransformFinder::up() 375 TransformFinder::up()
376 { 376 {
377 for (int i = 0; i < m_labels.size(); ++i) { 377 for (int i = 0; i < (int)m_labels.size(); ++i) {
378 if (!m_labels[i]->isVisible()) continue; 378 if (!m_labels[i]->isVisible()) continue;
379 if (m_labels[i]->objectName() == m_selectedTransform) { 379 if (m_labels[i]->objectName() == m_selectedTransform) {
380 if (i > 0) { 380 if (i > 0) {
381 m_labels[i]->setSelected(false); 381 m_labels[i]->setSelected(false);
382 m_labels[i-1]->setSelected(true); 382 m_labels[i-1]->setSelected(true);
388 } 388 }
389 389
390 void 390 void
391 TransformFinder::down() 391 TransformFinder::down()
392 { 392 {
393 for (int i = 0; i < m_labels.size(); ++i) { 393 for (int i = 0; i < (int)m_labels.size(); ++i) {
394 if (!m_labels[i]->isVisible()) continue; 394 if (!m_labels[i]->isVisible()) continue;
395 if (m_labels[i]->objectName() == m_selectedTransform) { 395 if (m_labels[i]->objectName() == m_selectedTransform) {
396 if (i+1 < m_labels.size() && 396 if (i+1 < (int)m_labels.size() &&
397 m_labels[i+1]->isVisible()) { 397 m_labels[i+1]->isVisible()) {
398 m_labels[i]->setSelected(false); 398 m_labels[i]->setSelected(false);
399 m_labels[i+1]->setSelected(true); 399 m_labels[i+1]->setSelected(true);
400 m_selectedTransform = m_labels[i+1]->objectName(); 400 m_selectedTransform = m_labels[i+1]->objectName();
401 } 401 }