MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / UpdateFilesystemData

Method UpdateFilesystemData

src/gui/browserpanel.cc:227–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225 }
226
227 void UpdateFilesystemData()
228 {
229 QueueJob(
230 [this]()
231 {
232 auto metadata = _filesystem->getMetadata();
233 _filesystemNeedsFlushing = _filesystem->needsFlushing();
234
235 runOnUiThread(
236 [&]()
237 {
238 try
239 {
240 uint32_t blockSize =
241 std::stoul(metadata.at(Filesystem::BLOCK_SIZE));
242 uint32_t totalBlocks = std::stoul(
243 metadata.at(Filesystem::TOTAL_BLOCKS));
244 uint32_t usedBlocks = std::stoul(
245 metadata.at(Filesystem::USED_BLOCKS));
246
247 if (!totalBlocks)
248 throw std::out_of_range("no disk usage data");
249
250 diskSpaceGauge->Enable();
251 diskSpaceGauge->SetRange(totalBlocks);
252 diskSpaceGauge->SetValue(usedBlocks);
253 }
254 catch (const std::out_of_range& e)
255 {
256 diskSpaceGauge->Disable();
257 }
258 });
259 });
260 }
261
262 void OnBrowserDirectoryExpanding(wxDataViewEvent& event) override
263 {

Callers

nothing calls this directly

Calls 4

SetValueMethod · 0.80
runOnUiThreadFunction · 0.70
getMetadataMethod · 0.45
needsFlushingMethod · 0.45

Tested by

no test coverage detected