2017-07-13 10:26:03 +02:00
|
|
|
/*
|
|
|
|
* launcherdirs.cpp, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
2013-08-22 17:22:49 +03:00
|
|
|
#include "StdInc.h"
|
|
|
|
#include "launcherdirs.h"
|
|
|
|
|
|
|
|
#include "../lib/VCMIDirs.h"
|
|
|
|
|
2024-02-06 00:33:47 +02:00
|
|
|
namespace CLauncherDirs
|
2013-08-22 17:22:49 +03:00
|
|
|
{
|
2024-02-06 00:33:47 +02:00
|
|
|
void prepare()
|
2013-08-22 17:22:49 +03:00
|
|
|
{
|
2024-02-06 00:33:47 +02:00
|
|
|
for(auto path : {downloadsPath(), modsPath(), mapsPath()})
|
|
|
|
QDir{}.mkdir(path);
|
2013-08-22 17:22:49 +03:00
|
|
|
}
|
|
|
|
|
2024-02-06 00:33:47 +02:00
|
|
|
QString downloadsPath()
|
2013-08-22 17:22:49 +03:00
|
|
|
{
|
2014-08-21 23:26:28 +03:00
|
|
|
return pathToQString(VCMIDirs::get().userCachePath() / "downloads");
|
2013-08-22 17:22:49 +03:00
|
|
|
}
|
|
|
|
|
2024-02-06 00:33:47 +02:00
|
|
|
QString modsPath()
|
2013-08-22 17:22:49 +03:00
|
|
|
{
|
2014-08-21 23:26:28 +03:00
|
|
|
return pathToQString(VCMIDirs::get().userDataPath() / "Mods");
|
2013-08-22 17:22:49 +03:00
|
|
|
}
|
2023-12-25 19:53:02 +02:00
|
|
|
|
2024-02-06 00:33:47 +02:00
|
|
|
QString mapsPath()
|
2023-12-25 19:53:02 +02:00
|
|
|
{
|
|
|
|
return pathToQString(VCMIDirs::get().userDataPath() / "Maps");
|
|
|
|
}
|
2024-02-06 00:33:47 +02:00
|
|
|
}
|