src/documentmanager.cpp

changeset 1065
c8ecddbd99e9
parent 1063
1f15c52c11f6
child 1072
9ce9496427f2
equal deleted inserted replaced
1064:4c7a353cf583 1065:c8ecddbd99e9
367 int idx = recentFiles.indexOf (path); 367 int idx = recentFiles.indexOf (path);
368 368
369 // If this file already is in the list, pop it out. 369 // If this file already is in the list, pop it out.
370 if (idx != -1) 370 if (idx != -1)
371 { 371 {
372 if (idx == length(recentFiles) - 1) 372 if (idx == countof(recentFiles) - 1)
373 return; // first recent file - abort and do nothing 373 return; // first recent file - abort and do nothing
374 374
375 recentFiles.removeAt (idx); 375 recentFiles.removeAt (idx);
376 } 376 }
377 377
378 // If there's too many recent files, drop one out. 378 // If there's too many recent files, drop one out.
379 while (length(recentFiles) > (MaxRecentFiles - 1)) 379 while (countof(recentFiles) > (MaxRecentFiles - 1))
380 recentFiles.removeAt (0); 380 recentFiles.removeAt (0);
381 381
382 // Add the file 382 // Add the file
383 recentFiles << path; 383 recentFiles << path;
384 m_config->setRecentFiles (recentFiles); 384 m_config->setRecentFiles (recentFiles);

mercurial