build: renaming to sourcetrail

This commit is contained in:
Andreas Stallinger
2017-04-07 13:19:09 +02:00
parent 8391a6da57
commit 045a259b2e
224 changed files with 885 additions and 4271 deletions
+10 -2
View File
@@ -21,7 +21,8 @@ void setupApp(int argc, char *argv[])
}
std::string userdir(std::getenv("HOME"));
userdir.append("/.config/coati/");
QDir coatiDir((userdir + "/.config/coati").c_str());
userdir.append("/.config/sourcetrail/");
UserPaths::setUserDataPath(userdir);
@@ -29,7 +30,14 @@ void setupApp(int argc, char *argv[])
QDir dataDir(userdir.c_str());
if (!dataDir.exists())
{
dataDir.mkpath(userDataPath);
if (coatiDir.exists())
{
utility::copyNewFilesFromDirectory(coatiDir.absolutePath(), userDataPath);
}
else
{
dataDir.mkpath(userDataPath);
}
}
utility::copyNewFilesFromDirectory(QString::fromStdString(AppPath::getAppPath() + "/user/" ), userDataPath);
+14 -1
View File
@@ -55,14 +55,27 @@ void setupPlatform(int argc, char *argv[])
// ----------------------------------------------------------------------------
// Makes the mac bundle copy the user files to the Application Support folder
QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
QString oldDataPath = QString::fromStdString(UserPaths::getUserDataPath() + "user/");
QDir dataDir(dataPath);
if (!dataDir.exists())
{
dataDir.mkpath(dataPath);
if (dataPath.endsWith("Sourcetrail"))
{
QString coatiDataPath = dataPath;
coatiDataPath.append("/../Coati");
QDir coatiDataDir(coatiDataPath);
if (coatiDataDir.exists())
{
oldDataPath = coatiDataPath;
}
}
}
utility::copyNewFilesFromDirectory(QString::fromStdString(UserPaths::getUserDataPath() + "user/"), dataPath);
utility::copyNewFilesFromDirectory(oldDataPath, dataPath);
UserPaths::setUserDataPath(dataPath.toStdString() + "/");
// ----------------------------------------------------------------------------
@@ -23,11 +23,11 @@ void setupApp(int argc, char *argv[])
path += "/../local/Coati Software/";
if (utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_64)
{
path += "Coati 64-bit/";
path += "Sourcetrail 64-bit/";
}
else
{
path += "Coati/";
path += "Sourcetrail/";
}
UserPaths::setUserDataPath(path);
#else
@@ -36,7 +36,28 @@ void setupApp(int argc, char *argv[])
UserPaths::setUserDataPath(path);
#endif
// These method does nothing if the copy destination already exist
// This "copyFile" method does nothing if the copy destination already exist
#ifdef DEPLOY
// try to find files in Coati installation to migrate to Sourcetrail
FilePath coatiUserDataPath = UserPaths::getUserDataPath() + "../";
if (utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_64)
{
coatiUserDataPath.concat("Coati 64-bit");
}
else
{
coatiUserDataPath = coatiUserDataPath.concat("Coati");
}
if (coatiUserDataPath.exists())
{
FileSystem::copyFile(coatiUserDataPath.concat("ApplicationSettings.xml"), UserPaths::getAppSettingsPath());
FileSystem::copyFile(coatiUserDataPath.concat("window_settings.ini"), UserPaths::getWindowSettingsPath());
}
#endif
// use files in fallback folder if Coati has not been installed and used before
FileSystem::copyFile("data/fallback/ApplicationSettings.xml", UserPaths::getAppSettingsPath());
FileSystem::copyFile("data/fallback/window_settings.ini", UserPaths::getWindowSettingsPath());
}