src: applied clang-format

This commit is contained in:
mlangkabel
2019-11-18 17:07:20 +01:00
parent 52058d9947
commit 078feca004
1100 changed files with 21382 additions and 20822 deletions
+39 -23
View File
@@ -1,13 +1,12 @@
#include "Application.h"
#include "ApplicationSettings.h"
#include "AppPath.h"
#include "ApplicationSettings.h"
#include "ColorScheme.h"
#include "DialogView.h"
#include "FileSystem.h"
#include "GraphViewStyle.h"
#include "IDECommunicationController.h"
#include "logging.h"
#include "LogManager.h"
#include "MainView.h"
#include "MessageFilterErrorCountUpdate.h"
@@ -23,20 +22,21 @@
#include "TabId.h"
#include "TaskManager.h"
#include "TaskScheduler.h"
#include "tracing.h"
#include "UpdateChecker.h"
#include "UserPaths.h"
#include "utilityString.h"
#include "utilityUuid.h"
#include "Version.h"
#include "ViewFactory.h"
#include "logging.h"
#include "tracing.h"
#include "utilityString.h"
#include "utilityUuid.h"
std::shared_ptr<Application> Application::s_instance;
std::string Application::s_uuid;
void Application::createInstance(
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory
){
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory)
{
bool hasGui = (viewFactory != nullptr);
Version::setApplicationVersion(version);
@@ -70,8 +70,8 @@ void Application::createInstance(
if (networkFactory != nullptr)
{
s_instance->m_ideCommunicationController =
networkFactory->createIDECommunicationController(s_instance->m_storageCache.get());
s_instance->m_ideCommunicationController = networkFactory->createIDECommunicationController(
s_instance->m_storageCache.get());
s_instance->m_ideCommunicationController->startListening();
s_instance->m_updateChecker = networkFactory->createUpdateChecker();
@@ -122,10 +122,7 @@ void Application::loadStyle(const FilePath& colorSchemePath)
GraphViewStyle::loadStyleSettings();
}
Application::Application(bool withGUI)
: m_hasGUI(withGUI)
{
}
Application::Application(bool withGUI): m_hasGUI(withGUI) {}
Application::~Application()
{
@@ -277,10 +274,14 @@ void Application::handleMessage(MessageLoadProject* message)
updateRecentProjects(projectSettingsFilePath);
m_storageCache->clear();
m_storageCache->setSubject(std::weak_ptr<StorageAccess>()); // TODO: check if this is really required.
m_storageCache->setSubject(
std::weak_ptr<StorageAccess>()); // TODO: check if this is really required.
m_project = std::make_shared<Project>(
std::make_shared<ProjectSettings>(projectSettingsFilePath), m_storageCache.get(), getUUID(), hasGUI());
std::make_shared<ProjectSettings>(projectSettingsFilePath),
m_storageCache.get(),
getUUID(),
hasGUI());
if (m_project)
{
@@ -289,7 +290,8 @@ void Application::handleMessage(MessageLoadProject* message)
else
{
LOG_ERROR_STREAM(<< "Failed to load project.");
MessageStatus(L"Failed to load project: " + projectSettingsFilePath.wstr(), true).dispatch();
MessageStatus(L"Failed to load project: " + projectSettingsFilePath.wstr(), true)
.dispatch();
}
updateTitle();
@@ -297,12 +299,19 @@ void Application::handleMessage(MessageLoadProject* message)
catch (std::exception& e)
{
LOG_ERROR_STREAM(<< "Failed to load project, exception thrown: " << e.what());
MessageStatus(L"Failed to load project, exception was thrown: " + projectSettingsFilePath.wstr(), true).dispatch();
MessageStatus(
L"Failed to load project, exception was thrown: " + projectSettingsFilePath.wstr(),
true)
.dispatch();
}
catch (...)
{
LOG_ERROR_STREAM(<< "Failed to load project, unknown exception thrown.");
MessageStatus(L"Failed to load project, unknown exception was thrown: " + projectSettingsFilePath.wstr(), true).dispatch();
MessageStatus(
L"Failed to load project, unknown exception was thrown: " +
projectSettingsFilePath.wstr(),
true)
.dispatch();
}
if (message->refreshMode != REFRESH_NONE)
@@ -421,7 +430,8 @@ void Application::updateRecentProjects(const FilePath& projectSettingsFilePath)
std::vector<FilePath> recentProjects = appSettings->getRecentProjects();
if (recentProjects.size())
{
std::vector<FilePath>::iterator it = std::find(recentProjects.begin(), recentProjects.end(), projectSettingsFilePath);
std::vector<FilePath>::iterator it = std::find(
recentProjects.begin(), recentProjects.end(), projectSettingsFilePath);
if (it != recentProjects.end())
{
recentProjects.erase(it);
@@ -494,11 +504,17 @@ bool Application::checkSharedMemory()
std::wstring error = utility::decodeFromUtf8(SharedMemory::checkSharedMemory(getUUID()));
if (error.size())
{
MessageStatus(L"Error on accessing shared memory. Indexing not possible. "
"Please restart computer or run as admin: " + error, true).dispatch();
MessageStatus(
L"Error on accessing shared memory. Indexing not possible. "
"Please restart computer or run as admin: " +
error,
true)
.dispatch();
handleDialog(
L"There was an error accessing shared memory on your computer: " + error + L"\n\n"
"Project indexing is not possible. Please restart your computer or try running Sourcetrail as admin. If the "
L"There was an error accessing shared memory on your computer: " + error +
L"\n\n"
"Project indexing is not possible. Please restart your computer or try running "
"Sourcetrail as admin. If the "
"issue persists contact mail@sourcetrail.com");
return false;
}
+5 -4
View File
@@ -4,10 +4,10 @@
#include <memory>
#include "DialogView.h"
#include "MessageListener.h"
#include "MessageIndexingFinished.h"
#include "MessageActivateWindow.h"
#include "MessageCloseProject.h"
#include "MessageIndexingFinished.h"
#include "MessageListener.h"
#include "MessageLoadProject.h"
#include "MessageRefresh.h"
#include "MessageRefreshUI.h"
@@ -35,7 +35,8 @@ class Application
, public MessageListener<MessageWindowFocus>
{
public:
static void createInstance(const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory);
static void createInstance(
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory);
static std::shared_ptr<Application> getInstance();
static void destroyInstance();
@@ -99,4 +100,4 @@ private:
std::shared_ptr<UpdateChecker> m_updateChecker;
};
#endif // APPLICATION_H
#endif // APPLICATION_H
+1 -1
View File
@@ -13,4 +13,4 @@ public:
virtual std::vector<std::shared_ptr<IndexerBase>> instantiateSupportedIndexers() const = 0;
};
#endif // LANGUAGE_PACKAGE_H
#endif // LANGUAGE_PACKAGE_H
+2 -2
View File
@@ -25,9 +25,9 @@ void LanguagePackageManager::addPackage(std::shared_ptr<LanguagePackage> package
std::shared_ptr<IndexerComposite> LanguagePackageManager::instantiateSupportedIndexers()
{
std::shared_ptr<IndexerComposite> composite = std::make_shared<IndexerComposite>();
for (std::shared_ptr<LanguagePackage> package : m_packages)
for (std::shared_ptr<LanguagePackage> package: m_packages)
{
for (std::shared_ptr<IndexerBase> indexer : package->instantiateSupportedIndexers())
for (std::shared_ptr<IndexerBase> indexer: package->instantiateSupportedIndexers())
{
composite->addIndexer(indexer);
}
+1 -1
View File
@@ -23,4 +23,4 @@ private:
std::vector<std::shared_ptr<LanguagePackage>> m_packages;
};
#endif // LANGUAGE_PACKAGE_MANAGER_H
#endif // LANGUAGE_PACKAGE_MANAGER_H
+1 -1
View File
@@ -8,4 +8,4 @@ public:
virtual void checkUpdate() = 0;
};
#endif // UPDATE_CHECKER_H
#endif // UPDATE_CHECKER_H
+1 -1
View File
@@ -9,7 +9,7 @@ FilePath AppPath::getAppPath()
bool AppPath::setAppPath(const FilePath& path)
{
if(!path.empty())
if (!path.empty())
{
m_appPath = path;
return true;
+1 -1
View File
@@ -13,4 +13,4 @@ private:
static FilePath m_appPath;
};
#endif // APP_PATH_H
#endif // APP_PATH_H
+1 -1
View File
@@ -19,4 +19,4 @@ public:
static FilePath getCxxCompilerHeaderPath();
};
#endif // RESOURCE_PATHS_H
#endif // RESOURCE_PATHS_H
+1 -1
View File
@@ -19,4 +19,4 @@ private:
static FilePath s_userDataPath;
};
#endif // USER_PATHS_H
#endif // USER_PATHS_H