MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / update

Method update

launcher/minecraft/WorldList.cpp:95–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95bool WorldList::update()
96{
97 if (!isValid())
98 return false;
99
100 QList<World> newWorlds;
101 m_dir.refresh();
102 auto folderContents = m_dir.entryInfoList();
103 // if there are any untracked files...
104 for (QFileInfo entry : folderContents)
105 {
106 if(!entry.isDir())
107 continue;
108
109 World w(entry);
110 if(w.isValid())
111 {
112 newWorlds.append(w);
113 }
114 }
115 beginResetModel();
116 worlds.swap(newWorlds);
117 endResetModel();
118 return true;
119}
120
121void WorldList::directoryChanged(QString path)
122{

Callers

nothing calls this directly

Calls 3

appendMethod · 0.80
refreshMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected