comparison filestatuswidget.cpp @ 324:306ffd913071 filelist_right_button_menu

Introduce "activities" enum and functions
author Chris Cannam
date Thu, 10 Mar 2011 18:45:50 +0000
parents adb14d3f780f
children 5fa5c908ca00
comparison
equal deleted inserted replaced
323:adb14d3f780f 324:306ffd913071
261 261
262 QStringList FileStatusWidget::getSelectedCommittableFiles() const 262 QStringList FileStatusWidget::getSelectedCommittableFiles() const
263 { 263 {
264 QStringList files; 264 QStringList files;
265 foreach (QString f, m_selectedFiles) { 265 foreach (QString f, m_selectedFiles) {
266 switch (m_fileStates.getStateOfFile(f)) { 266 switch (m_fileStates.stateOf(f)) {
267 case FileStates::Added: 267 case FileStates::Added:
268 case FileStates::Modified: 268 case FileStates::Modified:
269 case FileStates::Removed: 269 case FileStates::Removed:
270 files.push_back(f); 270 files.push_back(f);
271 break; 271 break;
276 } 276 }
277 277
278 QStringList FileStatusWidget::getAllCommittableFiles() const 278 QStringList FileStatusWidget::getAllCommittableFiles() const
279 { 279 {
280 QStringList files; 280 QStringList files;
281 files << m_fileStates.getFilesInState(FileStates::Modified); 281 files << m_fileStates.filesInState(FileStates::Modified);
282 files << m_fileStates.getFilesInState(FileStates::Added); 282 files << m_fileStates.filesInState(FileStates::Added);
283 files << m_fileStates.getFilesInState(FileStates::Removed); 283 files << m_fileStates.filesInState(FileStates::Removed);
284 return files; 284 return files;
285 } 285 }
286 286
287 QStringList FileStatusWidget::getSelectedRevertableFiles() const 287 QStringList FileStatusWidget::getSelectedRevertableFiles() const
288 { 288 {
289 QStringList files; 289 QStringList files;
290 foreach (QString f, m_selectedFiles) { 290 foreach (QString f, m_selectedFiles) {
291 switch (m_fileStates.getStateOfFile(f)) { 291 switch (m_fileStates.stateOf(f)) {
292 case FileStates::Added: 292 case FileStates::Added:
293 case FileStates::Modified: 293 case FileStates::Modified:
294 case FileStates::Removed: 294 case FileStates::Removed:
295 case FileStates::Missing: 295 case FileStates::Missing:
296 case FileStates::InConflict: 296 case FileStates::InConflict:
303 } 303 }
304 304
305 QStringList FileStatusWidget::getAllRevertableFiles() const 305 QStringList FileStatusWidget::getAllRevertableFiles() const
306 { 306 {
307 QStringList files; 307 QStringList files;
308 files << m_fileStates.getFilesInState(FileStates::Modified); 308 files << m_fileStates.filesInState(FileStates::Modified);
309 files << m_fileStates.getFilesInState(FileStates::Added); 309 files << m_fileStates.filesInState(FileStates::Added);
310 files << m_fileStates.getFilesInState(FileStates::Removed); 310 files << m_fileStates.filesInState(FileStates::Removed);
311 files << m_fileStates.getFilesInState(FileStates::Missing); 311 files << m_fileStates.filesInState(FileStates::Missing);
312 files << m_fileStates.getFilesInState(FileStates::InConflict); 312 files << m_fileStates.filesInState(FileStates::InConflict);
313 return files; 313 return files;
314 } 314 }
315 315
316 QStringList FileStatusWidget::getSelectedUnresolvedFiles() const 316 QStringList FileStatusWidget::getSelectedUnresolvedFiles() const
317 { 317 {
318 QStringList files; 318 QStringList files;
319 foreach (QString f, m_selectedFiles) { 319 foreach (QString f, m_selectedFiles) {
320 switch (m_fileStates.getStateOfFile(f)) { 320 switch (m_fileStates.stateOf(f)) {
321 case FileStates::InConflict: 321 case FileStates::InConflict:
322 files.push_back(f); 322 files.push_back(f);
323 break; 323 break;
324 default: break; 324 default: break;
325 } 325 }
328 } 328 }
329 329
330 QStringList FileStatusWidget::getAllUnresolvedFiles() const 330 QStringList FileStatusWidget::getAllUnresolvedFiles() const
331 { 331 {
332 QStringList files; 332 QStringList files;
333 files << m_fileStates.getFilesInState(FileStates::InConflict); 333 files << m_fileStates.filesInState(FileStates::InConflict);
334 return files; 334 return files;
335 } 335 }
336 336
337 QStringList FileStatusWidget::getSelectedAddableFiles() const 337 QStringList FileStatusWidget::getSelectedAddableFiles() const
338 { 338 {
339 QStringList files; 339 QStringList files;
340 foreach (QString f, m_selectedFiles) { 340 foreach (QString f, m_selectedFiles) {
341 switch (m_fileStates.getStateOfFile(f)) { 341 switch (m_fileStates.stateOf(f)) {
342 case FileStates::Unknown: 342 case FileStates::Unknown:
343 case FileStates::Removed: 343 case FileStates::Removed:
344 files.push_back(f); 344 files.push_back(f);
345 break; 345 break;
346 default: break; 346 default: break;
350 } 350 }
351 351
352 QStringList FileStatusWidget::getAllAddableFiles() const 352 QStringList FileStatusWidget::getAllAddableFiles() const
353 { 353 {
354 QStringList files; 354 QStringList files;
355 files << m_fileStates.getFilesInState(FileStates::Removed); 355 files << m_fileStates.filesInState(FileStates::Removed);
356 files << m_fileStates.getFilesInState(FileStates::Unknown); 356 files << m_fileStates.filesInState(FileStates::Unknown);
357 return files; 357 return files;
358 } 358 }
359 359
360 QStringList FileStatusWidget::getSelectedRemovableFiles() const 360 QStringList FileStatusWidget::getSelectedRemovableFiles() const
361 { 361 {
362 QStringList files; 362 QStringList files;
363 foreach (QString f, m_selectedFiles) { 363 foreach (QString f, m_selectedFiles) {
364 switch (m_fileStates.getStateOfFile(f)) { 364 switch (m_fileStates.stateOf(f)) {
365 case FileStates::Clean: 365 case FileStates::Clean:
366 case FileStates::Added: 366 case FileStates::Added:
367 case FileStates::Modified: 367 case FileStates::Modified:
368 case FileStates::Missing: 368 case FileStates::Missing:
369 case FileStates::InConflict: 369 case FileStates::InConflict:
376 } 376 }
377 377
378 QStringList FileStatusWidget::getAllRemovableFiles() const 378 QStringList FileStatusWidget::getAllRemovableFiles() const
379 { 379 {
380 QStringList files; 380 QStringList files;
381 files << m_fileStates.getFilesInState(FileStates::Clean); 381 files << m_fileStates.filesInState(FileStates::Clean);
382 files << m_fileStates.getFilesInState(FileStates::Added); 382 files << m_fileStates.filesInState(FileStates::Added);
383 files << m_fileStates.getFilesInState(FileStates::Modified); 383 files << m_fileStates.filesInState(FileStates::Modified);
384 files << m_fileStates.getFilesInState(FileStates::Missing); 384 files << m_fileStates.filesInState(FileStates::Missing);
385 files << m_fileStates.getFilesInState(FileStates::InConflict); 385 files << m_fileStates.filesInState(FileStates::InConflict);
386 return files; 386 return files;
387 } 387 }
388 388
389 QString 389 QString
390 FileStatusWidget::localPath() const 390 FileStatusWidget::localPath() const
433 433
434 foreach (FileStates::State s, m_stateListMap.keys()) { 434 foreach (FileStates::State s, m_stateListMap.keys()) {
435 435
436 QListWidget *w = m_stateListMap[s]; 436 QListWidget *w = m_stateListMap[s];
437 w->clear(); 437 w->clear();
438 QStringList files = m_fileStates.getFilesInState(s); 438 QStringList files = m_fileStates.filesInState(s);
439 439
440 QStringList highPriority, lowPriority; 440 QStringList highPriority, lowPriority;
441 441
442 foreach (QString file, files) { 442 foreach (QString file, files) {
443 443