| 83 | } |
| 84 | |
| 85 | bool WorldList::update() |
| 86 | { |
| 87 | if (!isValid()) |
| 88 | return false; |
| 89 | |
| 90 | QList<World> newWorlds; |
| 91 | m_dir.refresh(); |
| 92 | auto folderContents = m_dir.entryInfoList(); |
| 93 | // if there are any untracked files... |
| 94 | for (QFileInfo entry : folderContents) { |
| 95 | if (!entry.isDir()) |
| 96 | continue; |
| 97 | |
| 98 | World w(entry); |
| 99 | if (w.isValid()) { |
| 100 | newWorlds.append(w); |
| 101 | } |
| 102 | } |
| 103 | beginResetModel(); |
| 104 | worlds.swap(newWorlds); |
| 105 | endResetModel(); |
| 106 | return true; |
| 107 | } |
| 108 | |
| 109 | void WorldList::directoryChanged(QString path) |
| 110 | { |
no test coverage detected