| 488 | } |
| 489 | |
| 490 | void |
| 491 | FileSystemModel::initialize(SortableViewI* view) |
| 492 | { |
| 493 | assert(view); |
| 494 | assert( _imp->headers.isEmpty() ); |
| 495 | _imp->headers << tr("Name") << tr("Size") << tr("Type") << tr("Date Modified"); |
| 496 | |
| 497 | _imp->ordering = view->sortIndicatorOrder(); |
| 498 | _imp->sortSection = view->sortIndicatorSection(); |
| 499 | |
| 500 | |
| 501 | initGatherer(); |
| 502 | |
| 503 | |
| 504 | // scoped_ptr |
| 505 | _imp->watcher.reset(new QFileSystemWatcher); |
| 506 | assert(_imp->watcher); |
| 507 | QObject::connect( _imp->watcher.get(), SIGNAL(directoryChanged(QString)), this, SLOT(onWatchedDirectoryChanged(QString)) ); |
| 508 | QObject::connect( _imp->watcher.get(), SIGNAL(fileChanged(QString)), this, SLOT(onWatchedFileChanged(QString)) ); |
| 509 | _imp->watcher->addPath( QDir::rootPath() ); |
| 510 | |
| 511 | resetCompletly(true); |
| 512 | } |
| 513 | |
| 514 | //////////////////////////////////////Overridden from QAbstractItemModel/////////////////////////////////////// |
| 515 |
nothing calls this directly
no test coverage detected