2
0

launcherdirs.cpp 730 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * launcherdirs.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "launcherdirs.h"
  12. #include "../lib/VCMIDirs.h"
  13. static CLauncherDirs launcherDirsGlobal;
  14. CLauncherDirs::CLauncherDirs()
  15. {
  16. QDir().mkdir(downloadsPath());
  17. QDir().mkdir(modsPath());
  18. }
  19. CLauncherDirs & CLauncherDirs::get()
  20. {
  21. return launcherDirsGlobal;
  22. }
  23. QString CLauncherDirs::downloadsPath()
  24. {
  25. return pathToQString(VCMIDirs::get().userCachePath() / "downloads");
  26. }
  27. QString CLauncherDirs::modsPath()
  28. {
  29. return pathToQString(VCMIDirs::get().userDataPath() / "Mods");
  30. }