src: Removed backwards compatibility to Coati (.coatiproject, .coatidb)
This commit is contained in:
@@ -41,7 +41,6 @@
|
||||
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/TestResults
|
||||
|
||||
*.coatidb
|
||||
*.srctrldb
|
||||
*.srctrlbm
|
||||
*.suo
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
<Verb Id='open' Command='Open' Argument='"%1"' />
|
||||
<MIME Advertise='yes' ContentType='application/sourcetrailproject' Default='yes' />
|
||||
</Extension>
|
||||
<Extension Id='coatiproject'> <!-- ContentType='application/coatiproject' Advertise='no' -->
|
||||
<Verb Id='open' Command='Open' Argument='"%1"' />
|
||||
<MIME Advertise='yes' ContentType='application/coatiproject' Default='yes' />
|
||||
</Extension>
|
||||
</ProgId>
|
||||
</Component>
|
||||
|
||||
|
||||
@@ -5,12 +5,10 @@
|
||||
<icon name="project-sourcetrail"/>
|
||||
<glob-deleteall/>
|
||||
<glob pattern="*.srctrlprj"/>
|
||||
<glob pattern="*.coatiproject"/>
|
||||
</mime-type>
|
||||
<mime-type type="application/x-sourcetrail">
|
||||
<comment>Sourcetrail Database</comment>
|
||||
<glob-deleteall/>
|
||||
<glob pattern="*.srctrldb"/>
|
||||
<glob pattern="*.coatidb"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>srctrlprj</string>
|
||||
<string>coatiproject</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>project</string>
|
||||
|
||||
@@ -265,8 +265,6 @@ void Application::handleMessage(MessageLoadProject* message)
|
||||
{
|
||||
MessageStatus(L"Loading Project: " + projectSettingsFilePath.wstr(), false, true).dispatch();
|
||||
|
||||
projectSettingsFilePath = migrateProjectSettings(projectSettingsFilePath);
|
||||
|
||||
m_project.reset();
|
||||
|
||||
if (m_hasGUI)
|
||||
@@ -359,36 +357,6 @@ void Application::handleMessage(MessageWindowFocus* message)
|
||||
}
|
||||
}
|
||||
|
||||
FilePath Application::migrateProjectSettings(const FilePath& projectSettingsFilePath) const
|
||||
{
|
||||
if (projectSettingsFilePath.extension() == L".coatiproject")
|
||||
{
|
||||
MessageStatus(L"Migrating deprecated project file extension \".coatiproject\" to new file extension \".srctrlprj\"").dispatch();
|
||||
const FilePath newSettingsPath = projectSettingsFilePath.replaceExtension(ProjectSettings::PROJECT_FILE_EXTENSION);
|
||||
{
|
||||
FileSystem::rename(projectSettingsFilePath, newSettingsPath);
|
||||
const FilePath oldDbPath = projectSettingsFilePath.replaceExtension(L"coatidb");
|
||||
if (oldDbPath.exists())
|
||||
{
|
||||
FileSystem::rename(oldDbPath, oldDbPath.replaceExtension(L"srctrldb"));
|
||||
}
|
||||
}
|
||||
{
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
std::vector<FilePath> recentProjects = appSettings->getRecentProjects();
|
||||
std::vector<FilePath>::iterator it = std::find(recentProjects.begin(), recentProjects.end(), projectSettingsFilePath);
|
||||
if (it != recentProjects.end())
|
||||
{
|
||||
recentProjects.erase(it);
|
||||
}
|
||||
appSettings->setRecentProjects(recentProjects);
|
||||
appSettings->save(UserPaths::getAppSettingsPath());
|
||||
}
|
||||
return newSettingsPath;
|
||||
}
|
||||
return projectSettingsFilePath;
|
||||
}
|
||||
|
||||
void Application::startMessagingAndScheduling()
|
||||
{
|
||||
TaskManager::getScheduler(TabId::app())->startSchedulerLoopThreaded();
|
||||
|
||||
@@ -74,7 +74,6 @@ private:
|
||||
void handleMessage(MessageSwitchColorScheme* message) override;
|
||||
void handleMessage(MessageWindowFocus* message) override;
|
||||
|
||||
FilePath migrateProjectSettings(const FilePath& projectSettingsFilePath) const;
|
||||
void startMessagingAndScheduling();
|
||||
|
||||
void loadWindow(bool showStartWindow);
|
||||
|
||||
@@ -213,7 +213,7 @@ void CommandLineParser::processProjectfile()
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_projectFile.extension() != L".srctrlprj" && m_projectFile.extension() != L".coatiproject")
|
||||
if (m_projectFile.extension() != L".srctrlprj")
|
||||
{
|
||||
m_errorString = errorstring + L" has a wrong file ending";
|
||||
m_projectFile = FilePath();
|
||||
|
||||
@@ -47,21 +47,13 @@ void setupApp(int argc, char *argv[])
|
||||
AppPath::setAppPath(FilePath(QCoreApplication::applicationDirPath().toStdWString() + L"/").getAbsolute());
|
||||
|
||||
std::string userdir(std::getenv("HOME"));
|
||||
QDir coatiDir((userdir + "/.config/coati").c_str());
|
||||
userdir.append("/.config/sourcetrail/");
|
||||
|
||||
QString userDataPath(userdir.c_str());
|
||||
QDir dataDir(userdir.c_str());
|
||||
if (!dataDir.exists())
|
||||
{
|
||||
if (coatiDir.exists())
|
||||
{
|
||||
utility::copyNewFilesFromDirectory(coatiDir.absolutePath(), userDataPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
dataDir.mkpath(userDataPath);
|
||||
}
|
||||
dataDir.mkpath(userDataPath);
|
||||
}
|
||||
|
||||
utility::copyNewFilesFromDirectory(QString::fromStdWString(ResourcePaths::getFallbackPath().wstr()), userDataPath);
|
||||
|
||||
@@ -64,18 +64,6 @@ void setupPlatform(int argc, char *argv[])
|
||||
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(oldDataPath, dataPath);
|
||||
|
||||
@@ -28,7 +28,7 @@ bool QtApplication::event(QEvent *event)
|
||||
|
||||
FilePath path(fileEvent->file().toStdWString());
|
||||
|
||||
if (path.exists() && (path.extension() == L".srctrlprj" || path.extension() == L".coatiproject"))
|
||||
if (path.exists() && path.extension() == L".srctrlprj")
|
||||
{
|
||||
MessageLoadProject(path).dispatch();
|
||||
return true;
|
||||
|
||||
@@ -597,7 +597,7 @@ void QtMainWindow::newProjectFromCDB(const FilePath& filePath)
|
||||
void QtMainWindow::openProject()
|
||||
{
|
||||
QString fileName = QtFileDialog::getOpenFileName(
|
||||
this, tr("Open File"), FilePath(), "Sourcetrail Project Files (*.srctrlprj *.coatiproject)");
|
||||
this, tr("Open File"), FilePath(), "Sourcetrail Project Files (*.srctrlprj)");
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user