MCPcopy Create free account
hub / github.com/amule-project/amule / SaveSharedFolders

Method SaveSharedFolders

src/Preferences.cpp:1538–1560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1536
1537
1538void CPreferences::SaveSharedFolders()
1539{
1540 #ifndef CLIENT_GUI
1541 // Canonical sources of truth: shareddir-explicit.dat (user-added
1542 // non-recursive roots) and shareddir-recursive.dat (user-marked
1543 // recursive roots). Older versions of aMule know nothing about
1544 // these two files -- they only read shareddir.dat -- so we also
1545 // regenerate shareddir.dat as the runtime union for backwards
1546 // compatibility with both older binaries and external scripts
1547 // (e.g. Docker entrypoints) that read or write it directly.
1548 auto writeList = [](const wxString & filename, const PathList & list) {
1549 CTextFile f;
1550 if (f.Open(filename, CTextFile::write)) {
1551 for (size_t i = 0; i < list.size(); ++i) {
1552 f.WriteLine(list[i].GetRaw(), wxConvUTF8);
1553 }
1554 }
1555 };
1556 writeList(s_configDir + "shareddir-explicit.dat", shareddir_explicit_list);
1557 writeList(s_configDir + "shareddir-recursive.dat", shareddir_recursive_list);
1558 writeList(s_configDir + "shareddir.dat", shareddir_list);
1559 #endif
1560}
1561
1562
1563CPreferences::~CPreferences()

Callers 3

ColdDiscoverSubdirsMethod · 0.80

Calls 4

WriteLineMethod · 0.80
GetRawMethod · 0.80
OpenMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected