logic: used wstring in FilePath constructor
* used wstring in FilePath constructor where easily possible * added FilePath concatenate method that accepts string parameter * implemented using only wstring in MessageStatus * used wstring in config
This commit is contained in:
+1
-1
@@ -10,9 +10,9 @@
|
||||
/bin/app/*.log
|
||||
|
||||
/bin/test/data/log/
|
||||
/bin/test/data/temp.xml
|
||||
/bin/test/data/TestSettings.xml
|
||||
/bin/test/data/CommandlineTestSuite/settings.xml
|
||||
/bin/test/data/ConfigManagerTestSuite/temp.xml
|
||||
|
||||
/java_indexer/target/
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<config>
|
||||
<path>
|
||||
<to>
|
||||
<special_character>ü</special_character>
|
||||
</to>
|
||||
</path>
|
||||
</config>
|
||||
@@ -4,6 +4,7 @@
|
||||
<Int>42</Int>
|
||||
<Float>3.1416</Float>
|
||||
<String>Hello World!</String>
|
||||
<WString>Hello World!</WString>
|
||||
|
||||
<source_groups>
|
||||
<source_group_77438437-02db-4207-8bbf-75c627d53b89>
|
||||
|
||||
+13
-12
@@ -66,14 +66,14 @@ void prefillJavaRuntimePath()
|
||||
std::vector<FilePath> paths = javaPathDetector->getPaths();
|
||||
if (!paths.empty())
|
||||
{
|
||||
MessageStatus("Ran Java runtime path detection, found: " + paths.front().str()).dispatch();
|
||||
MessageStatus(L"Ran Java runtime path detection, found: " + paths.front().wstr()).dispatch();
|
||||
|
||||
settings->setJavaPath(paths.front());
|
||||
settings->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageStatus("Ran Java runtime path detection, no path found.").dispatch();
|
||||
MessageStatus(L"Ran Java runtime path detection, no path found.").dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,14 +87,14 @@ void prefillJreSystemLibraryPaths()
|
||||
std::vector<FilePath> paths = jreSystemLibraryPathsDetector->getPaths();
|
||||
if (!paths.empty())
|
||||
{
|
||||
MessageStatus("Ran JRE system library path detection, found: " + paths.front().str()).dispatch();
|
||||
MessageStatus(L"Ran JRE system library path detection, found: " + paths.front().wstr()).dispatch();
|
||||
|
||||
settings->setJreSystemLibraryPaths(paths);
|
||||
settings->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageStatus("Ran JRE system library path detection, no path found.").dispatch();
|
||||
MessageStatus(L"Ran JRE system library path detection, no path found.").dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,14 +108,14 @@ void prefillMavenExecutablePath()
|
||||
std::vector<FilePath> paths = mavenPathDetector->getPaths();
|
||||
if (!paths.empty())
|
||||
{
|
||||
MessageStatus("Ran Maven executable path detection, found: " + paths.front().str()).dispatch();
|
||||
MessageStatus(L"Ran Maven executable path detection, found: " + paths.front().wstr()).dispatch();
|
||||
|
||||
settings->setMavenPath(paths.front());
|
||||
settings->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageStatus("Ran Maven executable path detection, no path found.").dispatch();
|
||||
MessageStatus(L"Ran Maven executable path detection, no path found.").dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ void prefillCxxHeaderPaths()
|
||||
std::vector<FilePath> paths = cxxHeaderDetector->getPaths();
|
||||
if (!paths.empty())
|
||||
{
|
||||
MessageStatus("Ran C/C++ header path detection, found " + std::to_string(paths.size()) + " paths").dispatch();
|
||||
MessageStatus(L"Ran C/C++ header path detection, found " + std::to_wstring(paths.size()) + L" path" + (paths.size() == 1 ? L"" : L"s")).dispatch();
|
||||
|
||||
settings->setHeaderSearchPaths(paths);
|
||||
settings->save();
|
||||
@@ -146,7 +146,7 @@ void prefillCxxFrameworkPaths()
|
||||
std::vector<FilePath> paths = cxxFrameworkDetector->getPaths();
|
||||
if (!paths.empty())
|
||||
{
|
||||
MessageStatus("Ran C/C++ framework path detection, found " + std::to_string(paths.size()) + " paths").dispatch();
|
||||
MessageStatus(L"Ran C/C++ framework path detection, found " + std::to_wstring(paths.size()) + L" path" + (paths.size() == 1 ? L"" : L"s")).dispatch();
|
||||
|
||||
settings->setFrameworkSearchPaths(paths);
|
||||
settings->save();
|
||||
@@ -208,9 +208,10 @@ int main(int argc, char *argv[])
|
||||
QApplication::setApplicationVersion(version.toDisplayString().c_str());
|
||||
|
||||
MessageStatus(
|
||||
std::string("Starting Sourcetrail ") +
|
||||
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? "32" : "64") + " bit, " +
|
||||
"version " + version.toDisplayString()).dispatch();
|
||||
std::wstring(L"Starting Sourcetrail ") +
|
||||
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? L"32" : L"64") + L" bit, " +
|
||||
L"version " + version.toDisplayWString()
|
||||
).dispatch();
|
||||
|
||||
commandline::CommandLineParser commandLineParser(version.toString());
|
||||
commandLineParser.preparse(argc, argv);
|
||||
@@ -273,7 +274,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (commandLineParser.hasError() )
|
||||
{
|
||||
std::cout << commandLineParser.getError() << std::endl;
|
||||
std::wcout << commandLineParser.getError() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
|
||||
logFilePath = argv[5];
|
||||
}
|
||||
|
||||
AppPath::setAppPath(appPath);
|
||||
AppPath::setAppPath(FilePath(appPath));
|
||||
UserPaths::setUserDataPath(FilePath(userDataPath));
|
||||
|
||||
setupLogging(logFilePath);
|
||||
|
||||
+23
-12
@@ -13,6 +13,7 @@
|
||||
#include "utility/scheduling/TaskScheduler.h"
|
||||
#include "utility/tracing.h"
|
||||
#include "utility/UserPaths.h"
|
||||
#include "utility/utilityQString.h"
|
||||
#include "utility/utilityUuid.h"
|
||||
#include "utility/Version.h"
|
||||
|
||||
@@ -99,7 +100,7 @@ std::string Application::getUUID()
|
||||
|
||||
void Application::loadSettings()
|
||||
{
|
||||
MessageStatus("Load settings: " + UserPaths::getAppSettingsPath().str()).dispatch();
|
||||
MessageStatus(L"Load settings: " + UserPaths::getAppSettingsPath().wstr()).dispatch();
|
||||
|
||||
std::shared_ptr<ApplicationSettings> settings = ApplicationSettings::getInstance();
|
||||
settings->load(UserPaths::getAppSettingsPath());
|
||||
@@ -160,6 +161,16 @@ int Application::handleDialog(const std::string& message, const std::vector<std:
|
||||
return getDialogView()->confirm(message, options);
|
||||
}
|
||||
|
||||
int Application::handleDialog(const std::wstring& message)
|
||||
{
|
||||
return getDialogView()->confirm(message);
|
||||
}
|
||||
|
||||
int Application::handleDialog(const std::wstring& message, const std::vector<std::wstring>& options)
|
||||
{
|
||||
return getDialogView()->confirm(message, options);
|
||||
}
|
||||
|
||||
std::shared_ptr<DialogView> Application::getDialogView()
|
||||
{
|
||||
if (m_componentManager)
|
||||
@@ -182,7 +193,7 @@ void Application::updateBookmarks(const std::vector<std::shared_ptr<Bookmark>>&
|
||||
|
||||
void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
|
||||
{
|
||||
MessageStatus("Loading Project: " + projectSettingsFilePath.str(), false, true).dispatch();
|
||||
MessageStatus(L"Loading Project: " + projectSettingsFilePath.wstr(), false, true).dispatch();
|
||||
try
|
||||
{
|
||||
updateRecentProjects(projectSettingsFilePath);
|
||||
@@ -200,7 +211,7 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
|
||||
else
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Failed to load project.");
|
||||
MessageStatus("Failed to load project: " + projectSettingsFilePath.str(), true).dispatch();
|
||||
MessageStatus(L"Failed to load project: " + projectSettingsFilePath.wstr(), true).dispatch();
|
||||
}
|
||||
|
||||
updateTitle();
|
||||
@@ -208,12 +219,12 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
|
||||
catch (std::exception& e)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Failed to load project, exception thrown: " << e.what());
|
||||
MessageStatus("Failed to load project, exception was thrown: " + projectSettingsFilePath.str(), 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("Failed to load project, unknown exception was thrown: " + projectSettingsFilePath.str(), true).dispatch();
|
||||
MessageStatus(L"Failed to load project, unknown exception was thrown: " + projectSettingsFilePath.wstr(), true).dispatch();
|
||||
}
|
||||
|
||||
if (m_hasGUI)
|
||||
@@ -240,7 +251,7 @@ void Application::handleMessage(MessageActivateWindow* message)
|
||||
|
||||
void Application::handleMessage(MessageEnteredLicense* message)
|
||||
{
|
||||
MessageStatus("Found valid license key, unlocked application.").dispatch();
|
||||
MessageStatus(L"Found valid license key, unlocked application.").dispatch();
|
||||
|
||||
m_licenseType = message->type;
|
||||
|
||||
@@ -313,7 +324,7 @@ void Application::handleMessage(MessageRefresh* message)
|
||||
|
||||
void Application::handleMessage(MessageSwitchColorScheme* message)
|
||||
{
|
||||
MessageStatus("Switch color scheme: " + message->colorSchemePath.str()).dispatch();
|
||||
MessageStatus(L"Switch color scheme: " + message->colorSchemePath.wstr()).dispatch();
|
||||
|
||||
loadStyle(message->colorSchemePath);
|
||||
MessageRefresh().refreshUiOnly().noReloadStyle().dispatch();
|
||||
@@ -416,16 +427,16 @@ void Application::updateTitle()
|
||||
{
|
||||
if (m_hasGUI)
|
||||
{
|
||||
std::string title = "Sourcetrail";
|
||||
std::wstring title = L"Sourcetrail";
|
||||
|
||||
switch (m_licenseType)
|
||||
{
|
||||
case MessageEnteredLicense::LICENSE_TEST:
|
||||
title += " [test]";
|
||||
title += L" [test]";
|
||||
break;
|
||||
case MessageEnteredLicense::LICENSE_NONE:
|
||||
case MessageEnteredLicense::LICENSE_NON_COMMERCIAL:
|
||||
title += " [non-commercial]";
|
||||
title += L" [non-commercial]";
|
||||
break;
|
||||
case MessageEnteredLicense::LICENSE_COMMERCIAL:
|
||||
break;
|
||||
@@ -437,7 +448,7 @@ void Application::updateTitle()
|
||||
|
||||
if (!projectPath.empty())
|
||||
{
|
||||
title += " - " + projectPath.fileName();
|
||||
title += L" - " + projectPath.wFileName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,7 +463,7 @@ bool Application::checkSharedMemory()
|
||||
{
|
||||
MessageStatus("Error on accessing shared memory. Indexing not possible. Please restart computer or run as admin: " + error, true).dispatch();
|
||||
handleDialog(
|
||||
"There was an error accessing shared memory on your computer: " + error + "\n\n"
|
||||
L"There was an error accessing shared memory on your computer: " + utility::decodeFromUtf8(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;
|
||||
|
||||
@@ -53,6 +53,8 @@ public:
|
||||
|
||||
int handleDialog(const std::string& message);
|
||||
int handleDialog(const std::string& message, const std::vector<std::string>& options);
|
||||
int handleDialog(const std::wstring& message);
|
||||
int handleDialog(const std::wstring& message, const std::vector<std::wstring>& options);
|
||||
std::shared_ptr<DialogView> getDialogView();
|
||||
|
||||
void updateHistory(const std::vector<SearchMatch>& history);
|
||||
|
||||
@@ -447,6 +447,7 @@ add_files(
|
||||
utility/messaging/type/MessageShowReference.h
|
||||
utility/messaging/type/MessageShowScope.h
|
||||
utility/messaging/type/MessageShowStatus.h
|
||||
utility/messaging/type/MessageStatus.cpp
|
||||
utility/messaging/type/MessageStatus.h
|
||||
utility/messaging/type/MessageStatusFilterChanged.h
|
||||
utility/messaging/type/MessageSwitchColorScheme.h
|
||||
|
||||
@@ -32,7 +32,7 @@ std::string LicenseChecker::getCurrentLicenseString() const
|
||||
{
|
||||
License license;
|
||||
bool isLoaded = license.loadFromEncodedString(
|
||||
ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath());
|
||||
ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath().str());
|
||||
|
||||
if (isLoaded)
|
||||
{
|
||||
@@ -68,10 +68,9 @@ LicenseChecker::LicenseState LicenseChecker::checkCurrentLicense() const
|
||||
return LICENSE_EMPTY;
|
||||
}
|
||||
|
||||
std::string licenseCheck = appSettings->getLicenseCheck();
|
||||
std::string appPath(AppPath::getAppPath());
|
||||
const FilePath appPath = AppPath::getAppPath();
|
||||
|
||||
if (appPath.size() <= 0)
|
||||
if (appPath.empty())
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Failed to retrieve app path");
|
||||
return LICENSE_EMPTY;
|
||||
@@ -83,13 +82,13 @@ LicenseChecker::LicenseState LicenseChecker::checkCurrentLicense() const
|
||||
return LICENSE_EMPTY;
|
||||
}
|
||||
|
||||
if (!License::checkLocation(FilePath(appPath).makeAbsolute().str(), licenseCheck))
|
||||
if (!License::checkLocation(appPath.getAbsolute().str(), appSettings->getLicenseCheck()))
|
||||
{
|
||||
return LICENSE_MOVED;
|
||||
}
|
||||
|
||||
License license;
|
||||
bool isLoaded = license.loadFromEncodedString(licenseString, appPath);
|
||||
bool isLoaded = license.loadFromEncodedString(licenseString, appPath.str());
|
||||
if (!isLoaded)
|
||||
{
|
||||
return LICENSE_MOVED;
|
||||
@@ -121,7 +120,7 @@ MessageEnteredLicense::LicenseType LicenseChecker::getCurrentLicenseType() const
|
||||
{
|
||||
License license;
|
||||
bool isLoaded = license.loadFromEncodedString(
|
||||
ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath());
|
||||
ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath().str());
|
||||
|
||||
if (!isLoaded)
|
||||
{
|
||||
|
||||
@@ -154,9 +154,8 @@ void ActivationController::handleMessage(MessageResetZoom* message)
|
||||
MessageRefresh().refreshUiOnly().dispatch();
|
||||
}
|
||||
|
||||
std::stringstream text;
|
||||
text << "Font size: " << fontSizeStd;
|
||||
MessageStatus(text.str()).dispatch();
|
||||
|
||||
MessageStatus(L"Font size: " + std::to_wstring(fontSizeStd)).dispatch();
|
||||
}
|
||||
|
||||
void ActivationController::handleMessage(MessageZoom* message)
|
||||
@@ -178,10 +177,7 @@ void ActivationController::handleMessage(MessageZoom* message)
|
||||
settings->setFontSize(fontSize + (message->zoomIn ? 1 : -1));
|
||||
settings->save();
|
||||
|
||||
std::stringstream text;
|
||||
text << "Font size: " << settings->getFontSize();
|
||||
MessageStatus(text.str()).dispatch();
|
||||
|
||||
MessageStatus(L"Font size: " + std::to_wstring(settings->getFontSize())).dispatch();
|
||||
MessageRefresh().refreshUiOnly().dispatch();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "utility/text/TextAccess.h"
|
||||
#include "utility/tracing.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/utilityQString.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
#include "data/access/StorageAccess.h"
|
||||
@@ -156,25 +157,25 @@ void CodeController::handleMessage(MessageActivateTokens* message)
|
||||
size_t fileCount = m_collection->getSourceLocationFileCount();
|
||||
size_t referenceCount = m_collection->getSourceLocationCount();
|
||||
|
||||
std::stringstream ss;
|
||||
std::wstring status = L"";
|
||||
|
||||
if (message->tokenNames.size())
|
||||
{
|
||||
ss << "Activate \"" << message->tokenNames[0].getQualifiedName() << "\": ";
|
||||
status += L"Activate \"" + utility::decodeFromUtf8(message->tokenNames[0].getQualifiedName()) + L"\": ";
|
||||
}
|
||||
|
||||
ss << message->tokenIds.size() << ' ';
|
||||
ss << (message->tokenIds.size() == 1 ? "result" : "results");
|
||||
status += std::to_wstring(message->tokenIds.size()) + L" ";
|
||||
status += (message->tokenIds.size() == 1 ? L"result" : L"results");
|
||||
|
||||
if (fileCount > 0)
|
||||
{
|
||||
ss << " with " << referenceCount << ' ';
|
||||
ss << (referenceCount == 1 ? "reference" : "references");
|
||||
ss << " in " << fileCount << ' ';
|
||||
ss << (fileCount == 1 ? "file" : "files");
|
||||
status += L" with " + std::to_wstring(referenceCount) + L" ";
|
||||
status += (referenceCount == 1 ? L"reference" : L"references");
|
||||
status += L" in " + std::to_wstring(fileCount) + L" ";
|
||||
status += (fileCount == 1 ? L"file" : L"files");
|
||||
}
|
||||
|
||||
MessageStatus(ss.str()).dispatch();
|
||||
MessageStatus(status).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +282,7 @@ void CodeController::handleMessage(MessageScrollToLine* message)
|
||||
getView()->showContents();
|
||||
|
||||
MessageStatus(
|
||||
"Showing source location: " + message->filePath.str() + " : " + std::to_string(message->line)
|
||||
L"Showing source location: " + message->filePath.wstr() + L" : " + std::to_wstring(message->line)
|
||||
).dispatch();
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ void GraphController::handleMessage(MessageActivateTrail* message)
|
||||
{
|
||||
TRACE("trail activate");
|
||||
|
||||
MessageStatus("Retrieving depth graph data", false, true).dispatch();
|
||||
MessageStatus(L"Retrieving depth graph data", false, true).dispatch();
|
||||
|
||||
m_activeEdgeIds.clear();
|
||||
|
||||
@@ -172,7 +172,7 @@ void GraphController::handleMessage(MessageActivateTrail* message)
|
||||
|
||||
if (r == 1)
|
||||
{
|
||||
MessageStatus("Depth graph aborted.").dispatch();
|
||||
MessageStatus(L"Depth graph aborted.").dispatch();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -183,12 +183,12 @@ void GraphController::handleMessage(MessageActivateTrail* message)
|
||||
|
||||
setVisibility(setActive(m_activeNodeIds, true));
|
||||
|
||||
MessageStatus("Layouting depth graph", false, true).dispatch();
|
||||
MessageStatus(L"Layouting depth graph", false, true).dispatch();
|
||||
|
||||
layoutNesting();
|
||||
layoutTrail(message->horizontalLayout, message->originId);
|
||||
|
||||
MessageStatus("Displaying depth graph", false, true).dispatch();
|
||||
MessageStatus(L"Displaying depth graph", false, true).dispatch();
|
||||
|
||||
message->setIsReplayed(false);
|
||||
buildGraph(message, message->isLast(), true, false);
|
||||
@@ -386,7 +386,7 @@ void GraphController::handleMessage(MessageGraphNodeHide* message)
|
||||
{
|
||||
if (node->active || node->hasActiveSubNode())
|
||||
{
|
||||
MessageStatus("Can't hide active node or node with active children", true).dispatch();
|
||||
MessageStatus(L"Can't hide active node or node with active children", true).dispatch();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,8 +115,10 @@ void IDECommunicationController::handleSetActiveTokenMessage(
|
||||
|
||||
if (selectedLocationIds.size() > 0)
|
||||
{
|
||||
MessageStatus("Activating source location from plug-in succeeded: " + filePath.str() + ", row: " +
|
||||
std::to_string(message.row) + ", col: " + std::to_string(message.column)).dispatch();
|
||||
MessageStatus(
|
||||
L"Activating source location from plug-in succeeded: " + filePath.wstr() + L", row: " +
|
||||
std::to_wstring(message.row) + L", col: " + std::to_wstring(message.column)
|
||||
).dispatch();
|
||||
|
||||
MessageActivateSourceLocations(selectedLocationIds).dispatch();
|
||||
MessageActivateWindow().dispatch();
|
||||
@@ -133,8 +135,8 @@ void IDECommunicationController::handleSetActiveTokenMessage(
|
||||
else
|
||||
{
|
||||
MessageStatus(
|
||||
"Activating source location from plug-in failed. File " + filePath.str()
|
||||
+ " was not found in the project.",
|
||||
L"Activating source location from plug-in failed. File " + filePath.wstr()
|
||||
+ L" was not found in the project.",
|
||||
true
|
||||
).dispatch();
|
||||
}
|
||||
@@ -191,7 +193,7 @@ void IDECommunicationController::handleMessage(MessageIDECreateCDB* message)
|
||||
{
|
||||
std::string networkMessage = NetworkProtocolHelper::buildCreateCDBMessage();
|
||||
|
||||
MessageStatus("Requesting IDE to create Compilation Database via plug-in.").dispatch();
|
||||
MessageStatus(L"Requesting IDE to create Compilation Database via plug-in.").dispatch();
|
||||
|
||||
sendMessage(networkMessage);
|
||||
}
|
||||
@@ -199,12 +201,12 @@ void IDECommunicationController::handleMessage(MessageIDECreateCDB* message)
|
||||
void IDECommunicationController::handleMessage(MessageMoveIDECursor* message)
|
||||
{
|
||||
std::string networkMessage = NetworkProtocolHelper::buildSetIDECursorMessage(
|
||||
message->FilePosition, message->Row, message->Column
|
||||
message->FilePosition.str(), message->Row, message->Column
|
||||
);
|
||||
|
||||
MessageStatus(
|
||||
"Jump to source location via plug-in: " + message->FilePosition + ", row: " +
|
||||
std::to_string(message->Row) + ", col: " + std::to_string(message->Column)
|
||||
L"Jump to source location via plug-in: " + message->FilePosition.wstr() + L", row: " +
|
||||
std::to_wstring(message->Row) + L", col: " + std::to_wstring(message->Column)
|
||||
).dispatch();
|
||||
|
||||
sendMessage(networkMessage);
|
||||
|
||||
@@ -72,13 +72,12 @@ void StatusBarController::handleMessage(MessageStatus* message)
|
||||
setStatus(message->status(), message->isError, message->showLoader);
|
||||
}
|
||||
|
||||
void StatusBarController::setStatus(const std::string& status, bool isError, bool showLoader)
|
||||
void StatusBarController::setStatus(const std::wstring& status, bool isError, bool showLoader)
|
||||
{
|
||||
if (!status.empty())
|
||||
{
|
||||
LOG_INFO_STREAM(<< "STATUS " << status);
|
||||
LOG_INFO(L"STATUS " + status);
|
||||
}
|
||||
|
||||
getView()->showMessage(status, isError, showLoader);
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
virtual void handleMessage(MessageShowErrors* message);
|
||||
virtual void handleMessage(MessageStatus* message);
|
||||
|
||||
void setStatus(const std::string& status, bool isError, bool showLoader);
|
||||
void setStatus(const std::wstring& status, bool isError, bool showLoader);
|
||||
|
||||
StorageAccess* m_storageAccess;
|
||||
};
|
||||
|
||||
@@ -35,14 +35,14 @@ void StatusController::handleMessage(MessageShowStatus* message)
|
||||
|
||||
void StatusController::handleMessage(MessageStatus* message)
|
||||
{
|
||||
if (!message->status().size())
|
||||
if (message->status().empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<Status> stati;
|
||||
|
||||
for (const std::string& status : message->stati())
|
||||
for (const std::wstring& status : message->stati())
|
||||
{
|
||||
stati.push_back(Status(status, message->isError));
|
||||
}
|
||||
|
||||
@@ -54,3 +54,13 @@ int DialogView::confirm(const std::string& message, const std::vector<std::strin
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int DialogView::confirm(const std::wstring& message)
|
||||
{
|
||||
return confirm(message, std::vector<std::wstring>());
|
||||
}
|
||||
|
||||
int DialogView::confirm(const std::wstring& message, const std::vector<std::wstring>& options)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ public:
|
||||
|
||||
int confirm(const std::string& message);
|
||||
virtual int confirm(const std::string& message, const std::vector<std::string>& options);
|
||||
int confirm(const std::wstring& message);
|
||||
virtual int confirm(const std::wstring& message, const std::vector<std::wstring>& options);
|
||||
|
||||
protected:
|
||||
StorageAccess* m_storageAccess;
|
||||
|
||||
@@ -486,7 +486,7 @@ GraphViewStyle::NodeStyle GraphViewStyle::getStyleOfBundleNode(bool isFocused)
|
||||
return getStyleForNodeType(
|
||||
NodeType::STYLE_BIG_NODE,
|
||||
"bundle",
|
||||
ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/bundle.png")),
|
||||
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/bundle.png"),
|
||||
true,
|
||||
false,
|
||||
isFocused,
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
virtual void refreshView() = 0;
|
||||
|
||||
virtual void hideStartScreen() = 0;
|
||||
virtual void setTitle(const std::string& title) = 0;
|
||||
virtual void setTitle(const std::wstring& title) = 0;
|
||||
virtual void activateWindow() = 0;
|
||||
|
||||
virtual void updateRecentProjectMenu() = 0;
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
~StatusBarView(void);
|
||||
|
||||
virtual std::string getName() const;
|
||||
virtual void showMessage(const std::string& message, bool isError, bool showLoader) = 0;
|
||||
virtual void showMessage(const std::wstring& message, bool isError, bool showLoader) = 0;
|
||||
virtual void setErrorCount(ErrorCountInfo errorCount) = 0;
|
||||
|
||||
virtual void showIdeStatus(const std::string& message) = 0;
|
||||
|
||||
@@ -62,7 +62,7 @@ bool CodeSnippetParams::sort(const CodeSnippetParams& a, const CodeSnippetParams
|
||||
// alphabetical filepath without extension
|
||||
else
|
||||
{
|
||||
return aFilePath.withoutExtension().fileName() < bFilePath.withoutExtension().fileName();
|
||||
return aFilePath.withoutExtension().wFileName() < bFilePath.withoutExtension().wFileName();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -228,19 +228,19 @@ FilePath NodeType::getIconPath() const
|
||||
if (isPackage())
|
||||
{
|
||||
// this icon cannot be changed
|
||||
return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/namespace.png"));
|
||||
return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/namespace.png");
|
||||
}
|
||||
|
||||
switch (m_type)
|
||||
{
|
||||
case NodeType::NODE_ENUM:
|
||||
return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/enum.png"));
|
||||
return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/enum.png");
|
||||
case NodeType::NODE_TYPEDEF:
|
||||
return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/typedef.png"));
|
||||
return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/typedef.png");
|
||||
case NodeType::NODE_MACRO:
|
||||
return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/macro.png"));
|
||||
return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/macro.png");
|
||||
case NodeType::NODE_FILE:
|
||||
return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/file.png"));
|
||||
return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/file.png");
|
||||
default:
|
||||
return FilePath();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
#include "utility/scheduling/Blackboard.h"
|
||||
#include "utility/utility.h"
|
||||
#include "utility/utilityQString.h"
|
||||
#include "Application.h"
|
||||
|
||||
TaskFinishParsing::TaskFinishParsing(
|
||||
@@ -69,16 +70,16 @@ Task::TaskState TaskFinishParsing::doUpdate(std::shared_ptr<Blackboard> blackboa
|
||||
|
||||
ErrorCountInfo errorInfo = m_storageAccess->getErrorCount();
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Finished indexing: ";
|
||||
ss << indexedSourceFileCount << "/" << sourceFileCount << " source files indexed; ";
|
||||
ss << utility::timeToString(time);
|
||||
ss << "; " << errorInfo.total << " error" << (errorInfo.total != 1 ? "s" : "");
|
||||
std::wstring status;
|
||||
status += L"Finished indexing: ";
|
||||
status += std::to_wstring(indexedSourceFileCount) + L"/" + std::to_wstring(sourceFileCount) + L" source files indexed; ";
|
||||
status += utility::decodeFromUtf8(utility::timeToString(time));
|
||||
status += L"; " + std::to_wstring(errorInfo.total) + L" error" + (errorInfo.total != 1 ? L"s" : L"");
|
||||
if (errorInfo.fatal > 0)
|
||||
{
|
||||
ss << " (" << errorInfo.fatal << " fatal)";
|
||||
status += L" (" + std::to_wstring(errorInfo.fatal) + L" fatal)";
|
||||
}
|
||||
MessageStatus(ss.str(), false, false).dispatch();
|
||||
MessageStatus(status, false, false).dispatch();
|
||||
|
||||
StorageStats stats = m_storageAccess->getStorageStats();
|
||||
dialogView->finishedIndexingDialog(
|
||||
@@ -110,6 +111,6 @@ void TaskFinishParsing::terminate()
|
||||
app->getDialogView()->hideDialogs();
|
||||
}
|
||||
|
||||
MessageStatus("An unknown exception was thrown during indexing.", true, false).dispatch();
|
||||
MessageStatus(L"An unknown exception was thrown during indexing.", true, false).dispatch();
|
||||
MessageFinishedParsing().dispatch();
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
|
||||
#if _WIN32
|
||||
const std::string TaskBuildIndex::s_processName("sourcetrail_indexer.exe");
|
||||
const std::wstring TaskBuildIndex::s_processName(L"sourcetrail_indexer.exe");
|
||||
#else
|
||||
const std::string TaskBuildIndex::s_processName("sourcetrail_indexer");
|
||||
const std::wstring TaskBuildIndex::s_processName(L"sourcetrail_indexer");
|
||||
#endif
|
||||
|
||||
TaskBuildIndex::TaskBuildIndex(
|
||||
@@ -177,7 +177,7 @@ void TaskBuildIndex::runIndexerProcess(int processId, const std::string& logFile
|
||||
m_runningThreadCount++;
|
||||
}
|
||||
|
||||
FilePath indexerProcessPath(AppPath::getAppPath() + s_processName);
|
||||
FilePath indexerProcessPath = AppPath::getAppPath().concatenate(s_processName);
|
||||
if (!indexerProcessPath.exists())
|
||||
{
|
||||
m_interrupted = true;
|
||||
@@ -188,7 +188,7 @@ void TaskBuildIndex::runIndexerProcess(int processId, const std::string& logFile
|
||||
std::string command = "\"" + indexerProcessPath.str() + "\"";
|
||||
command += " " + std::to_string(processId);
|
||||
command += " " + Application::getUUID();
|
||||
command += " \"" + AppPath::getAppPath() + "\"";
|
||||
command += " \"" + AppPath::getAppPath().str() + "\"";
|
||||
command += " \"" + UserPaths::getUserDataPath().str() + "\"";
|
||||
|
||||
if (logFilePath.size())
|
||||
@@ -292,14 +292,11 @@ void TaskBuildIndex::updateIndexingDialog(
|
||||
|
||||
if (sourcePaths.size())
|
||||
{
|
||||
std::vector<std::string> stati;
|
||||
std::vector<std::wstring> stati;
|
||||
for (const FilePath& path : sourcePaths)
|
||||
{
|
||||
m_indexingFileCount++;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "[" << m_indexingFileCount << "/" << sourceFileCount << "] Indexing file: " << path.str();
|
||||
stati.push_back(ss.str());
|
||||
stati.push_back(L"[" + std::to_wstring(m_indexingFileCount) + L"/" + std::to_wstring(sourceFileCount) + L"] Indexing file: " + path.wstr());
|
||||
}
|
||||
MessageStatus(stati, false, true).dispatch();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ protected:
|
||||
bool fetchIntermediateStorages(std::shared_ptr<Blackboard> blackboard);
|
||||
void updateIndexingDialog(std::shared_ptr<Blackboard> blackboard, const std::vector<FilePath>& sourcePaths);
|
||||
|
||||
static const std::string s_processName;
|
||||
static const std::wstring s_processName;
|
||||
|
||||
std::shared_ptr<IndexerCommandList> m_indexerCommandList;
|
||||
std::shared_ptr<StorageProvider> m_storageProvider;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "data/parser/ParseLocation.h"
|
||||
|
||||
ParseLocation::ParseLocation()
|
||||
: filePath("")
|
||||
: filePath(L"")
|
||||
, startLineNumber(0)
|
||||
, startColumnNumber(0)
|
||||
, endLineNumber(0)
|
||||
|
||||
@@ -476,7 +476,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getFullTextSearchLo
|
||||
|
||||
if (m_fullTextSearchIndex.fileCount() == 0)
|
||||
{
|
||||
MessageStatus("Building fulltext search index", false, true).dispatch();
|
||||
MessageStatus(L"Building fulltext search index", false, true).dispatch();
|
||||
buildFullTextSearchIndex();
|
||||
}
|
||||
|
||||
|
||||
@@ -146,11 +146,11 @@ void Project::load()
|
||||
{
|
||||
MessageFinishedParsing().dispatch();
|
||||
}
|
||||
MessageStatus("Finished Loading", false, false).dispatch();
|
||||
MessageStatus(L"Finished Loading", false, false).dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageStatus("Project not loaded", false, false).dispatch();
|
||||
MessageStatus(L"Project not loaded", false, false).dispatch();
|
||||
}
|
||||
|
||||
if (m_state != PROJECT_STATE_LOADED && m_hasGUI)
|
||||
@@ -326,11 +326,11 @@ void Project::buildIndex(const RefreshInfo& info, DialogView* dialogView)
|
||||
MessageFinishedParsing().dispatch();
|
||||
}
|
||||
|
||||
MessageStatus("Nothing to refresh, all files are up-to-date.").dispatch();
|
||||
MessageStatus(L"Nothing to refresh, all files are up-to-date.").dispatch();
|
||||
return;
|
||||
}
|
||||
|
||||
MessageStatus("Preparing Indexing", false, true).dispatch();
|
||||
MessageStatus(L"Preparing Indexing", false, true).dispatch();
|
||||
MessageClearErrorCount().dispatch();
|
||||
|
||||
dialogView->showUnknownProgressDialog("Preparing Indexing", "Setting up Indexers");
|
||||
|
||||
@@ -65,7 +65,7 @@ bool ApplicationSettings::load(const FilePath& filePath)
|
||||
{
|
||||
License license;
|
||||
bool isLoaded = license.loadFromEncodedString(
|
||||
migration->getValueFromSettings<std::string>(settings, "user/license/license", ""), AppPath::getAppPath());
|
||||
migration->getValueFromSettings<std::string>(settings, "user/license/license", ""), AppPath::getAppPath().str());
|
||||
if (isLoaded && license.isValid() && license.isNonCommercialLicenseType())
|
||||
{
|
||||
migration->removeValuesInSettings(settings, "user/license/license");
|
||||
@@ -149,8 +149,8 @@ void ApplicationSettings::setShowBuiltinTypesInGraph(bool showBuiltinTypes)
|
||||
|
||||
FilePath ApplicationSettings::getColorSchemePath() const
|
||||
{
|
||||
FilePath defaultPath(ResourcePaths::getColorSchemesPath().concatenate(FilePath("bright.xml")));
|
||||
FilePath path(getValue<std::string>("application/color_scheme", defaultPath.str()));
|
||||
FilePath defaultPath(ResourcePaths::getColorSchemesPath().concatenate(L"bright.xml"));
|
||||
FilePath path(getValue<std::wstring>("application/color_scheme", defaultPath.wstr()));
|
||||
|
||||
if (path != defaultPath && !path.exists())
|
||||
{
|
||||
@@ -305,14 +305,14 @@ void ApplicationSettings::setMultiProcessIndexingEnabled(bool enabled)
|
||||
setValue<bool>("indexing/multi_process_indexing", enabled);
|
||||
}
|
||||
|
||||
std::string ApplicationSettings::getJavaPath() const
|
||||
FilePath ApplicationSettings::getJavaPath() const
|
||||
{
|
||||
return getValue<std::string>("indexing/java/java_path", "");
|
||||
return FilePath(getValue<std::wstring>("indexing/java/java_path", L""));
|
||||
}
|
||||
|
||||
void ApplicationSettings::setJavaPath(const FilePath& path)
|
||||
{
|
||||
setValue<std::string>("indexing/java/java_path", path.str());
|
||||
setValue<std::wstring>("indexing/java/java_path", path.wstr());
|
||||
}
|
||||
|
||||
int ApplicationSettings::getJavaMaximumMemory() const
|
||||
@@ -342,12 +342,12 @@ bool ApplicationSettings::setJreSystemLibraryPaths(const std::vector<FilePath>&
|
||||
|
||||
FilePath ApplicationSettings::getMavenPath() const
|
||||
{
|
||||
return FilePath(getValue<std::string>("indexing/java/maven_path", ""));
|
||||
return FilePath(getValue<std::wstring>("indexing/java/maven_path", L""));
|
||||
}
|
||||
|
||||
void ApplicationSettings::setMavenPath(const FilePath& path)
|
||||
{
|
||||
setValue<std::string>("indexing/java/maven_path", path.str());
|
||||
setValue<std::wstring>("indexing/java/maven_path", path.wstr());
|
||||
}
|
||||
|
||||
std::vector<FilePath> ApplicationSettings::getHeaderSearchPaths() const
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
bool getMultiProcessIndexingEnabled() const;
|
||||
void setMultiProcessIndexingEnabled(bool enabled);
|
||||
|
||||
std::string getJavaPath() const;
|
||||
FilePath getJavaPath() const;
|
||||
void setJavaPath(const FilePath& path);
|
||||
|
||||
int getJavaMaximumMemory() const;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "utility/utilityUuid.h"
|
||||
|
||||
const size_t ProjectSettings::VERSION = 4;
|
||||
const char PROJECT_FILE_EXTENSION[] = ".srctrlprj";
|
||||
const wchar_t PROJECT_FILE_EXTENSION[] = L".srctrlprj";
|
||||
|
||||
LanguageType ProjectSettings::getLanguageOfProject(const FilePath& filePath)
|
||||
{
|
||||
@@ -48,11 +48,6 @@ ProjectSettings::ProjectSettings(const FilePath& projectFilePath)
|
||||
setFilePath(projectFilePath);
|
||||
}
|
||||
|
||||
ProjectSettings::ProjectSettings(std::string projectName, const FilePath& projectFileLocation)
|
||||
{
|
||||
setProjectFilePath(projectName, projectFileLocation);
|
||||
}
|
||||
|
||||
ProjectSettings::~ProjectSettings()
|
||||
{
|
||||
}
|
||||
@@ -114,14 +109,14 @@ FilePath ProjectSettings::getProjectFilePath() const
|
||||
return getFilePath();
|
||||
}
|
||||
|
||||
void ProjectSettings::setProjectFilePath(std::string projectName, const FilePath& projectFileLocation)
|
||||
void ProjectSettings::setProjectFilePath(std::wstring projectName, const FilePath& projectFileLocation)
|
||||
{
|
||||
setFilePath(FilePath(projectFileLocation.str() + "/" + projectName + PROJECT_FILE_EXTENSION));
|
||||
setFilePath(projectFileLocation.getConcatenated(L"/" + projectName + PROJECT_FILE_EXTENSION));
|
||||
}
|
||||
|
||||
std::string ProjectSettings::getProjectName() const
|
||||
std::wstring ProjectSettings::getProjectName() const
|
||||
{
|
||||
return getFilePath().withoutExtension().fileName();
|
||||
return getFilePath().withoutExtension().wFileName();
|
||||
}
|
||||
|
||||
FilePath ProjectSettings::getProjectDirectoryPath() const
|
||||
|
||||
@@ -19,7 +19,6 @@ public:
|
||||
|
||||
ProjectSettings();
|
||||
ProjectSettings(const FilePath& projectFilePath);
|
||||
ProjectSettings(std::string projectName, const FilePath& projectFileLocation);
|
||||
virtual ~ProjectSettings();
|
||||
|
||||
bool equalsExceptNameAndLocation(const ProjectSettings& other) const;
|
||||
@@ -30,9 +29,9 @@ public:
|
||||
bool reload();
|
||||
|
||||
FilePath getProjectFilePath() const;
|
||||
void setProjectFilePath(std::string projectName, const FilePath& projectFileLocation);
|
||||
void setProjectFilePath(std::wstring projectName, const FilePath& projectFileLocation);
|
||||
|
||||
std::string getProjectName() const;
|
||||
std::wstring getProjectName() const;
|
||||
FilePath getProjectDirectoryPath() const;
|
||||
|
||||
std::string getDescription() const;
|
||||
|
||||
@@ -114,11 +114,8 @@ void Settings::setFilePath(const FilePath& filePath)
|
||||
|
||||
std::vector<FilePath> Settings::getPathValues(const std::string& key) const
|
||||
{
|
||||
std::vector<std::string> values;
|
||||
values = getValues(key, values);
|
||||
|
||||
std::vector<FilePath> paths;
|
||||
for (const std::string& value : values)
|
||||
for (const std::wstring& value : getValues<std::wstring>(key, {}))
|
||||
{
|
||||
paths.push_back(FilePath(value));
|
||||
}
|
||||
@@ -127,10 +124,10 @@ std::vector<FilePath> Settings::getPathValues(const std::string& key) const
|
||||
|
||||
bool Settings::setPathValues(const std::string& key, const std::vector<FilePath>& paths)
|
||||
{
|
||||
std::vector<std::string> values;
|
||||
std::vector<std::wstring> values;
|
||||
for (const FilePath& path : paths)
|
||||
{
|
||||
values.push_back(path.str());
|
||||
values.push_back(path.wstr());
|
||||
}
|
||||
|
||||
return setValues(key, values);
|
||||
|
||||
@@ -174,11 +174,8 @@ void SourceGroupSettings::setSourceExtensions(const std::vector<std::string>& so
|
||||
|
||||
std::vector<FilePath> SourceGroupSettings::getPathValues(const std::string& key, std::shared_ptr<const ConfigManager> config)
|
||||
{
|
||||
std::vector<std::string> values;
|
||||
values = getValues(key, values, config);
|
||||
|
||||
std::vector<FilePath> paths;
|
||||
for (const std::string& value : values)
|
||||
for (const std::wstring& value : getValues<std::wstring>(key, {}, config))
|
||||
{
|
||||
paths.push_back(FilePath(value));
|
||||
}
|
||||
@@ -187,10 +184,10 @@ std::vector<FilePath> SourceGroupSettings::getPathValues(const std::string& key,
|
||||
|
||||
bool SourceGroupSettings::setPathValues(const std::string& key, const std::vector<FilePath>& paths, std::shared_ptr<ConfigManager> config)
|
||||
{
|
||||
std::vector<std::string> values;
|
||||
std::vector<std::wstring> values;
|
||||
for (const FilePath& path : paths)
|
||||
{
|
||||
values.push_back(path.str());
|
||||
values.push_back(path.wstr());
|
||||
}
|
||||
|
||||
return setValues(key, values, config);
|
||||
|
||||
@@ -19,7 +19,7 @@ void SourceGroupSettingsCxxCdb::load(std::shared_ptr<const ConfigManager> config
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setCompilationDatabasePath(FilePath(getValue<std::string>(key + "/build_file_path/compilation_db_path", "", config)));
|
||||
setCompilationDatabasePath(FilePath(getValue<std::wstring>(key + "/build_file_path/compilation_db_path", L"", config)));
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxxCdb::save(std::shared_ptr<ConfigManager> config)
|
||||
@@ -28,7 +28,7 @@ void SourceGroupSettingsCxxCdb::save(std::shared_ptr<ConfigManager> config)
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setValue(key + "/build_file_path/compilation_db_path", getCompilationDatabasePath().str(), config);
|
||||
setValue(key + "/build_file_path/compilation_db_path", getCompilationDatabasePath().wstr(), config);
|
||||
}
|
||||
|
||||
bool SourceGroupSettingsCxxCdb::equals(std::shared_ptr<SourceGroupSettings> other) const
|
||||
|
||||
@@ -18,8 +18,8 @@ void SourceGroupSettingsJavaGradle::load(std::shared_ptr<const ConfigManager> co
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setGradleProjectFilePath(FilePath(getValue<std::string>(key + "/gradle/project_file_path", "", config)));
|
||||
setGradleDependenciesDirectory(FilePath(getValue<std::string>(key + "/gradle/dependencies_directory", "", config)));
|
||||
setGradleProjectFilePath(FilePath(getValue<std::wstring>(key + "/gradle/project_file_path", L"", config)));
|
||||
setGradleDependenciesDirectory(FilePath(getValue<std::wstring>(key + "/gradle/dependencies_directory", L"", config)));
|
||||
setShouldIndexGradleTests(getValue<bool>(key + "/gradle/should_index_tests", false, config));
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ void SourceGroupSettingsJavaGradle::save(std::shared_ptr<ConfigManager> config)
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setValue(key + "/gradle/project_file_path", getGradleProjectFilePath().str(), config);
|
||||
setValue(key + "/gradle/dependencies_directory", getGradleDependenciesDirectory().str(), config);
|
||||
setValue(key + "/gradle/project_file_path", getGradleProjectFilePath().wstr(), config);
|
||||
setValue(key + "/gradle/dependencies_directory", getGradleDependenciesDirectory().wstr(), config);
|
||||
setValue(key + "/gradle/should_index_tests", getShouldIndexGradleTests(), config);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ void SourceGroupSettingsJavaMaven::load(std::shared_ptr<const ConfigManager> con
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setMavenProjectFilePath(FilePath(getValue<std::string>(key + "/maven/project_file_path", "", config)));
|
||||
setMavenDependenciesDirectory(FilePath(getValue<std::string>(key + "/maven/dependencies_directory", "", config)));
|
||||
setMavenProjectFilePath(FilePath(getValue<std::wstring>(key + "/maven/project_file_path", L"", config)));
|
||||
setMavenDependenciesDirectory(FilePath(getValue<std::wstring>(key + "/maven/dependencies_directory", L"", config)));
|
||||
setShouldIndexMavenTests(getValue<bool>(key + "/maven/should_index_tests", false, config));
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ void SourceGroupSettingsJavaMaven::save(std::shared_ptr<ConfigManager> config)
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setValue(key + "/maven/project_file_path", getMavenProjectFilePath().str(), config);
|
||||
setValue(key + "/maven/dependencies_directory", getMavenDependenciesDirectory().str(), config);
|
||||
setValue(key + "/maven/project_file_path", getMavenProjectFilePath().wstr(), config);
|
||||
setValue(key + "/maven/dependencies_directory", getMavenDependenciesDirectory().wstr(), config);
|
||||
setValue(key + "/maven/should_index_tests", getShouldIndexMavenTests(), config);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
#include "AppPath.h"
|
||||
|
||||
#include <string>
|
||||
FilePath AppPath::m_appPath(L"");
|
||||
|
||||
std::string AppPath::m_appPath = "";
|
||||
|
||||
std::string AppPath::getAppPath()
|
||||
FilePath AppPath::getAppPath()
|
||||
{
|
||||
return m_appPath;
|
||||
}
|
||||
|
||||
bool AppPath::setAppPath(std::string path)
|
||||
bool AppPath::setAppPath(const FilePath& path)
|
||||
{
|
||||
if(!path.empty())
|
||||
{
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
#ifndef APP_PATH_H
|
||||
#define APP_PATH_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
#include <Windows.h>
|
||||
#endif // _WIN32
|
||||
#include "utility/file/FilePath.h"
|
||||
|
||||
class AppPath
|
||||
{
|
||||
public:
|
||||
static std::string getAppPath();
|
||||
static bool setAppPath(std::string path);
|
||||
static FilePath getAppPath();
|
||||
static bool setAppPath(const FilePath& path);
|
||||
|
||||
private:
|
||||
static std::string m_appPath;
|
||||
static FilePath m_appPath;
|
||||
};
|
||||
|
||||
#endif // APP_PATH_H
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "utility/text/TextAccess.h"
|
||||
#include "utility/utility.h"
|
||||
#include "utility/utilityString.h"
|
||||
#include "utility/utilityQString.h"
|
||||
|
||||
std::shared_ptr<ConfigManager> ConfigManager::createEmpty()
|
||||
{
|
||||
@@ -50,6 +51,17 @@ bool ConfigManager::getValue(const std::string& key, std::string& value) const
|
||||
}
|
||||
}
|
||||
|
||||
bool ConfigManager::getValue(const std::string& key, std::wstring& value) const
|
||||
{
|
||||
std::string valueString;
|
||||
if (getValue(key, valueString))
|
||||
{
|
||||
value = utility::decodeFromUtf8(valueString.c_str());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ConfigManager::getValue(const std::string& key, int& value) const
|
||||
{
|
||||
std::string valueString;
|
||||
@@ -110,6 +122,21 @@ bool ConfigManager::getValues(const std::string& key, std::vector<std::string>&
|
||||
}
|
||||
}
|
||||
|
||||
bool ConfigManager::getValues(const std::string& key, std::vector<std::wstring>& values) const
|
||||
{
|
||||
std::vector<std::string> valuesStringVector;
|
||||
if (getValues(key, valuesStringVector))
|
||||
{
|
||||
for (const std::string& valueString : valuesStringVector)
|
||||
{
|
||||
values.push_back(utility::decodeFromUtf8(valueString));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool ConfigManager::getValues(const std::string& key, std::vector<int>& values) const
|
||||
{
|
||||
std::vector<std::string> valuesStringVector;
|
||||
@@ -166,6 +193,11 @@ void ConfigManager::setValue(const std::string& key, const std::string& value)
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManager::setValue(const std::string& key, const std::wstring& value)
|
||||
{
|
||||
setValue(key, utility::encodeToUtf8(value));
|
||||
}
|
||||
|
||||
void ConfigManager::setValue(const std::string& key, const int value)
|
||||
{
|
||||
setValue(key, std::to_string(value));
|
||||
@@ -197,6 +229,16 @@ void ConfigManager::setValues(const std::string& key, const std::vector<std::str
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManager::setValues(const std::string& key, const std::vector<std::wstring>& values)
|
||||
{
|
||||
std::vector<std::string> stringValues;
|
||||
for (std::wstring v : values)
|
||||
{
|
||||
stringValues.push_back(utility::encodeToUtf8(v));
|
||||
}
|
||||
setValues(key, stringValues);
|
||||
}
|
||||
|
||||
void ConfigManager::setValues(const std::string& key, const std::vector<int>& values)
|
||||
{
|
||||
std::vector<std::string> stringValues;
|
||||
|
||||
@@ -19,21 +19,25 @@ public:
|
||||
void clear();
|
||||
|
||||
bool getValue(const std::string& key, std::string& value) const;
|
||||
bool getValue(const std::string& key, std::wstring& value) const;
|
||||
bool getValue(const std::string& key, int& value) const;
|
||||
bool getValue(const std::string& key, float& value) const;
|
||||
bool getValue(const std::string& key, bool& value) const;
|
||||
|
||||
bool getValues(const std::string& key, std::vector<std::string>& values) const;
|
||||
bool getValues(const std::string& key, std::vector<std::wstring>& values) const;
|
||||
bool getValues(const std::string& key, std::vector<int>& values) const;
|
||||
bool getValues(const std::string& key, std::vector<float>& values) const;
|
||||
bool getValues(const std::string& key, std::vector<bool>& values) const;
|
||||
|
||||
void setValue(const std::string& key, const std::string& value);
|
||||
void setValue(const std::string& key, const std::wstring& value);
|
||||
void setValue(const std::string& key, const int value);
|
||||
void setValue(const std::string& key, const float value);
|
||||
void setValue(const std::string& key, const bool value);
|
||||
|
||||
void setValues(const std::string& key, const std::vector<std::string>& values);
|
||||
void setValues(const std::string& key, const std::vector<std::wstring>& values);
|
||||
void setValues(const std::string& key, const std::vector<int>& values);
|
||||
void setValues(const std::string& key, const std::vector<float>& values);
|
||||
void setValues(const std::string& key, const std::vector<bool>& values);
|
||||
@@ -52,7 +56,7 @@ public:
|
||||
private:
|
||||
ConfigManager();
|
||||
ConfigManager(const ConfigManager&);
|
||||
void operator=(const ConfigManager&);
|
||||
void operator=(const ConfigManager&) = delete;
|
||||
|
||||
void parseSubtree(TiXmlNode* parentElement, const std::string& currentPath);
|
||||
bool createXmlDocument(bool saveAsFile, std::string filepath, std::string& output);
|
||||
|
||||
@@ -4,25 +4,25 @@
|
||||
|
||||
FilePath ResourcePaths::getColorSchemesPath()
|
||||
{
|
||||
return FilePath(AppPath::getAppPath() + "data/color_schemes/");
|
||||
return AppPath::getAppPath().concatenate(L"data/color_schemes/");
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getFallbackPath()
|
||||
{
|
||||
return FilePath(AppPath::getAppPath() + "data/fallback/");
|
||||
return AppPath::getAppPath().concatenate(L"data/fallback/");
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getFontsPath()
|
||||
{
|
||||
return FilePath(AppPath::getAppPath() + "data/fonts/");
|
||||
return AppPath::getAppPath().concatenate(L"data/fonts/");
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getGuiPath()
|
||||
{
|
||||
return FilePath(AppPath::getAppPath() + "data/gui/");
|
||||
return AppPath::getAppPath().concatenate(L"data/gui/");
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getJavaPath()
|
||||
{
|
||||
return FilePath(AppPath::getAppPath() + "data/java/");
|
||||
return AppPath::getAppPath().concatenate(L"data/java/");
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@ typedef int StatusFilter;
|
||||
|
||||
struct Status
|
||||
{
|
||||
Status(std::string message, bool isError = false)
|
||||
Status(std::wstring message, bool isError = false)
|
||||
: message(message)
|
||||
, type(isError ? StatusType::STATUS_ERROR : StatusType::STATUS_INFO)
|
||||
{
|
||||
}
|
||||
|
||||
std::string message;
|
||||
std::wstring message;
|
||||
StatusType type;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@ void UserPaths::setUserDataPath(const FilePath& path)
|
||||
|
||||
FilePath UserPaths::getAppSettingsPath()
|
||||
{
|
||||
return getUserDataPath().concatenate(FilePath("ApplicationSettings.xml"));
|
||||
return getUserDataPath().concatenate(L"ApplicationSettings.xml");
|
||||
}
|
||||
|
||||
FilePath UserPaths::getWindowSettingsPath()
|
||||
{
|
||||
return getUserDataPath().concatenate(FilePath("window_settings.ini"));
|
||||
return getUserDataPath().concatenate(L"window_settings.ini");
|
||||
}
|
||||
|
||||
FilePath UserPaths::getLogPath()
|
||||
{
|
||||
return getUserDataPath().concatenate(FilePath("log/"));
|
||||
return getUserDataPath().concatenate(L"log/");
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ bool CommandLineParser::hasError()
|
||||
return !m_errorString.empty();
|
||||
}
|
||||
|
||||
std::string CommandLineParser::getError()
|
||||
std::wstring CommandLineParser::getError()
|
||||
{
|
||||
return m_errorString;
|
||||
}
|
||||
@@ -220,18 +220,18 @@ void CommandLineParser::processProjectfile()
|
||||
{
|
||||
m_projectFile.makeAbsolute();
|
||||
|
||||
const std::string errorstring =
|
||||
"Provided Projectfile is not valid:\n* Provided Projectfile('" + m_projectFile.fileName() + "') ";
|
||||
const std::wstring errorstring =
|
||||
L"Provided Projectfile is not valid:\n* Provided Projectfile('" + m_projectFile.wFileName() + L"') ";
|
||||
if (!m_projectFile.exists())
|
||||
{
|
||||
m_errorString = errorstring + " does not exist";
|
||||
m_errorString = errorstring + L" does not exist";
|
||||
m_projectFile = FilePath();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_projectFile.extension() != ".srctrlprj" && m_projectFile.extension() != ".coatiproject")
|
||||
{
|
||||
m_errorString = errorstring + " has a wrong file ending";
|
||||
m_errorString = errorstring + L" has a wrong file ending";
|
||||
m_projectFile = FilePath();
|
||||
return;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ void CommandLineParser::processProjectfile()
|
||||
std::shared_ptr<ConfigManager> configManager = ConfigManager::createEmpty();
|
||||
if (!configManager->load(TextAccess::createFromFile(m_projectFile)))
|
||||
{
|
||||
m_errorString = errorstring + " could not be loaded (invalid)";
|
||||
m_errorString = errorstring + L" could not be loaded (invalid)";
|
||||
m_projectFile = FilePath();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
void fullRefresh();
|
||||
void incompleteRefresh();
|
||||
|
||||
std::string getError();
|
||||
std::wstring getError();
|
||||
License getLicense();
|
||||
License* getLicensePtr();
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
boost::program_options::options_description m_options;
|
||||
boost::program_options::positional_options_description m_positional;
|
||||
|
||||
std::string m_errorString;
|
||||
std::wstring m_errorString;
|
||||
License m_license;
|
||||
|
||||
std::vector<std::string> m_args;
|
||||
|
||||
@@ -136,7 +136,7 @@ void CommandConfig::printSettings(ApplicationSettings* settings)
|
||||
<< "\n use-processes: " << settings->getMultiProcessIndexingEnabled()
|
||||
<< "\n logging-enabled: " << settings->getLoggingEnabled()
|
||||
<< "\n verbose-indexer-logging-enabled: " << settings->getVerboseIndexerLoggingEnabled()
|
||||
<< "\n jvm-path: " << settings->getJavaPath()
|
||||
<< "\n jvm-path: " << settings->getJavaPath().str()
|
||||
<< "\n jvm-max-memory: " << settings->getJavaMaximumMemory()
|
||||
<< "\n maven-path: " << settings->getMavenPath().str();
|
||||
printVector("global-header-search-paths", settings->getHeaderSearchPaths());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "FileInfo.h"
|
||||
|
||||
FileInfo::FileInfo()
|
||||
: path(FilePath(""))
|
||||
: path(FilePath(L""))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,16 +18,6 @@ FilePath::FilePath()
|
||||
{
|
||||
}
|
||||
|
||||
FilePath::FilePath(const char* filePath)
|
||||
: m_path(std::make_unique<boost::filesystem::path>(filePath))
|
||||
, m_exists(false)
|
||||
, m_checkedExists(false)
|
||||
, m_isDirectory(false)
|
||||
, m_checkedIsDirectory(false)
|
||||
, m_canonicalized(false)
|
||||
{
|
||||
}
|
||||
|
||||
FilePath::FilePath(const std::string& filePath)
|
||||
: m_path(std::make_unique<boost::filesystem::path>(filePath))
|
||||
, m_exists(false)
|
||||
@@ -38,7 +28,7 @@ FilePath::FilePath(const std::string& filePath)
|
||||
{
|
||||
}
|
||||
|
||||
FilePath::FilePath(const boost::filesystem::path& filePath)
|
||||
FilePath::FilePath(const std::wstring& filePath)
|
||||
: m_path(std::make_unique<boost::filesystem::path>(filePath))
|
||||
, m_exists(false)
|
||||
, m_checkedExists(false)
|
||||
@@ -127,7 +117,7 @@ bool FilePath::isAbsolute() const
|
||||
|
||||
FilePath FilePath::getParentDirectory() const
|
||||
{
|
||||
FilePath parentDirectory(m_path->parent_path());
|
||||
FilePath parentDirectory(m_path->parent_path().wstring());
|
||||
|
||||
if (!parentDirectory.empty())
|
||||
{
|
||||
@@ -320,6 +310,25 @@ FilePath FilePath::getConcatenated(const FilePath& other) const
|
||||
return path;
|
||||
}
|
||||
|
||||
FilePath& FilePath::concatenate(const std::wstring& other)
|
||||
{
|
||||
m_path->operator/=(other);
|
||||
m_exists = false;
|
||||
m_checkedExists = false;
|
||||
m_isDirectory = false;
|
||||
m_checkedIsDirectory = false;
|
||||
m_canonicalized = false;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
FilePath FilePath::getConcatenated(const std::wstring& other) const
|
||||
{
|
||||
FilePath path(*this);
|
||||
path.concatenate(other);
|
||||
return path;
|
||||
}
|
||||
|
||||
bool FilePath::contains(const FilePath& other) const
|
||||
{
|
||||
if (!isDirectory())
|
||||
@@ -362,6 +371,11 @@ std::string FilePath::str() const
|
||||
return m_path->generic_string();
|
||||
}
|
||||
|
||||
std::wstring FilePath::wstr() const
|
||||
{
|
||||
return m_path->generic_wstring();
|
||||
}
|
||||
|
||||
std::string FilePath::getBackslashedString() const
|
||||
{
|
||||
return utility::replace(str(), "/", "\\");
|
||||
@@ -372,6 +386,11 @@ std::string FilePath::fileName() const
|
||||
return m_path->filename().generic_string();
|
||||
}
|
||||
|
||||
std::wstring FilePath::wFileName() const
|
||||
{
|
||||
return m_path->filename().generic_wstring();
|
||||
}
|
||||
|
||||
std::string FilePath::extension() const
|
||||
{
|
||||
return m_path->extension().generic_string();
|
||||
@@ -379,12 +398,12 @@ std::string FilePath::extension() const
|
||||
|
||||
FilePath FilePath::withoutExtension() const
|
||||
{
|
||||
return FilePath(getPath().replace_extension());
|
||||
return FilePath(getPath().replace_extension().wstring());
|
||||
}
|
||||
|
||||
FilePath FilePath::replaceExtension(const std::string& extension) const
|
||||
{
|
||||
return FilePath(getPath().replace_extension(extension));
|
||||
return FilePath(getPath().replace_extension(extension).wstring());
|
||||
}
|
||||
|
||||
bool FilePath::hasExtension(const std::vector<std::string>& extensions) const
|
||||
|
||||
@@ -17,9 +17,8 @@ class FilePath
|
||||
{
|
||||
public:
|
||||
FilePath();
|
||||
explicit FilePath(const char* filePath);
|
||||
explicit FilePath(const std::string& filePath);
|
||||
explicit FilePath(const boost::filesystem::path& filePath);
|
||||
explicit FilePath(const std::wstring& filePath);
|
||||
FilePath(const FilePath& other);
|
||||
FilePath(FilePath&& other);
|
||||
FilePath(const std::string& filePath, const std::string& base);
|
||||
@@ -43,13 +42,17 @@ public:
|
||||
FilePath getRelativeTo(const FilePath& other) const;
|
||||
FilePath& concatenate(const FilePath& other);
|
||||
FilePath getConcatenated(const FilePath& other) const;
|
||||
FilePath& concatenate(const std::wstring& other);
|
||||
FilePath getConcatenated(const std::wstring& other) const;
|
||||
std::vector<FilePath> expandEnvironmentVariables() const;
|
||||
|
||||
bool contains(const FilePath& other) const;
|
||||
|
||||
std::string str() const;
|
||||
std::wstring wstr() const;
|
||||
std::string getBackslashedString() const;
|
||||
std::string fileName() const;
|
||||
std::wstring wFileName() const;
|
||||
|
||||
std::string extension() const;
|
||||
FilePath withoutExtension() const;
|
||||
|
||||
@@ -13,7 +13,7 @@ FileRegister::FileRegister(
|
||||
, m_indexedPaths(indexedPaths)
|
||||
, m_excludedPaths(excludedPaths)
|
||||
, m_hasFilePathCache(
|
||||
[&](const std::string& f)
|
||||
[&](const std::wstring& f)
|
||||
{
|
||||
const FilePath filePath(f);
|
||||
bool ret = false;
|
||||
@@ -101,5 +101,5 @@ bool FileRegister::fileIsIndexed(const FilePath& filePath) const
|
||||
|
||||
bool FileRegister::hasFilePath(const FilePath& filePath) const
|
||||
{
|
||||
return m_hasFilePathCache.getValue(filePath.str());
|
||||
return m_hasFilePathCache.getValue(filePath.wstr());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ private:
|
||||
const FilePath& m_currentPath;
|
||||
const std::set<FilePath> m_indexedPaths;
|
||||
const std::set<FilePath> m_excludedPaths;
|
||||
mutable UnorderedCache<std::string, bool> m_hasFilePathCache;
|
||||
mutable UnorderedCache<std::wstring, bool> m_hasFilePathCache;
|
||||
};
|
||||
|
||||
#endif // FILE_REGISTER_H
|
||||
|
||||
@@ -32,7 +32,7 @@ std::vector<FilePath> FileSystem::getFilePathsFromDirectory(
|
||||
|
||||
if (boost::filesystem::is_regular_file(*it) && (ext.empty() || ext.find(it->path().extension().string()) != ext.end()))
|
||||
{
|
||||
files.push_back(FilePath(it->path().generic_string()));
|
||||
files.push_back(FilePath(it->path().generic_wstring()));
|
||||
}
|
||||
++it;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ std::vector<FileInfo> FileSystem::getFileInfosFromPaths(
|
||||
continue;
|
||||
}
|
||||
filePaths.insert(p);
|
||||
files.push_back(getFileInfoForPath(FilePath(it->path())));
|
||||
files.push_back(getFileInfoForPath(FilePath(it->path().wstring())));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,7 +175,7 @@ std::set<FilePath> FileSystem::getSymLinkedDirectories(const std::vector<FilePat
|
||||
std::set<FilePath> files;
|
||||
for (auto& p : symlinkDirs)
|
||||
{
|
||||
files.insert(FilePath(p));
|
||||
files.insert(FilePath(p.wstring()));
|
||||
}
|
||||
return files;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ std::vector<FilePath> FileSystem::getDirectSubDirectories(const FilePath& path)
|
||||
{
|
||||
if (boost::filesystem::is_directory(dir->path()))
|
||||
{
|
||||
v.push_back(FilePath(dir->path()));
|
||||
v.push_back(FilePath(dir->path().wstring()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -272,7 +272,7 @@ std::vector<FilePath> FileSystem::getRecursiveSubDirectories(const FilePath &pat
|
||||
{
|
||||
if (boost::filesystem::is_directory(dir->path()))
|
||||
{
|
||||
v.push_back(FilePath(dir->path()));
|
||||
v.push_back(FilePath(dir->path().wstring()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
FileLogger::FileLogger()
|
||||
: Logger("FileLogger")
|
||||
, m_logFileName("log")
|
||||
, m_logDirectory("user/log/")
|
||||
, m_logDirectory(L"user/log/")
|
||||
, m_maxLogLineCount(0)
|
||||
, m_maxLogFileCount(0)
|
||||
, m_currentLogLineCount(0)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
#include "utility/utility.h"
|
||||
#include "utility/Version.h"
|
||||
#include "utility/utilityQString.h"
|
||||
|
||||
std::shared_ptr<LogManager> LogManager::getInstance()
|
||||
{
|
||||
@@ -38,12 +39,12 @@ void LogManager::setLoggingEnabled(bool enabled)
|
||||
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? "32" : "64") + " bit, " +
|
||||
"version " + Version::getApplicationVersion().toDisplayString()
|
||||
);
|
||||
MessageStatus("Enabled console and file logging.").dispatch();
|
||||
MessageStatus(L"Enabled console and file logging.").dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_INFO("Disabled logging");
|
||||
MessageStatus("Disabled console and file logging.").dispatch();
|
||||
MessageStatus(L"Disabled console and file logging.").dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,6 +97,19 @@ void LogManager::logInfo(
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::logInfo(
|
||||
const std::wstring& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
)
|
||||
{
|
||||
if (m_loggingEnabled)
|
||||
{
|
||||
m_logManagerImplementation.logInfo(utility::encodeToUtf8(message), file, function, line);
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::logWarning(
|
||||
const std::string& message,
|
||||
const std::string& file,
|
||||
@@ -109,6 +123,19 @@ void LogManager::logWarning(
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::logWarning(
|
||||
const std::wstring& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
)
|
||||
{
|
||||
if (m_loggingEnabled)
|
||||
{
|
||||
m_logManagerImplementation.logWarning(utility::encodeToUtf8(message), file, function, line);
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::logError(
|
||||
const std::string& message,
|
||||
const std::string& file,
|
||||
@@ -122,6 +149,19 @@ void LogManager::logError(
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::logError(
|
||||
const std::wstring& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
)
|
||||
{
|
||||
if (m_loggingEnabled)
|
||||
{
|
||||
m_logManagerImplementation.logError(utility::encodeToUtf8(message), file, function, line);
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<LogManager> LogManager::s_instance;
|
||||
|
||||
LogManager::LogManager()
|
||||
|
||||
@@ -30,18 +30,36 @@ public:
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
);
|
||||
void logInfo(
|
||||
const std::wstring& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
);
|
||||
void logWarning(
|
||||
const std::string& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
);
|
||||
void logWarning(
|
||||
const std::wstring& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
);
|
||||
void logError(
|
||||
const std::string& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
);
|
||||
void logError(
|
||||
const std::wstring& message,
|
||||
const std::string& file,
|
||||
const std::string& function,
|
||||
const unsigned int line
|
||||
);
|
||||
|
||||
private:
|
||||
static std::shared_ptr<LogManager> s_instance;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#ifndef MESSAGE_MOVE_IDE_CURSOR_H
|
||||
#define MESSAGE_MOVE_IDE_CURSOR_H
|
||||
|
||||
#include "utility/file/FilePath.h"
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageMoveIDECursor : public Message<MessageMoveIDECursor>
|
||||
{
|
||||
public:
|
||||
MessageMoveIDECursor(const std::string& FilePos, const unsigned int Row, const unsigned int Column)
|
||||
MessageMoveIDECursor(const FilePath& FilePos, const unsigned int Row, const unsigned int Column)
|
||||
: FilePosition(FilePos)
|
||||
, Row(Row)
|
||||
, Column(Column)
|
||||
@@ -20,10 +21,10 @@ public:
|
||||
|
||||
virtual void print(std::ostream& os) const
|
||||
{
|
||||
os << FilePosition << ":" << Row << ":" << Column;
|
||||
os << FilePosition.str() << ":" << Row << ":" << Column;
|
||||
}
|
||||
|
||||
const std::string FilePosition;
|
||||
const FilePath FilePosition;
|
||||
const unsigned int Row;
|
||||
const unsigned int Column;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
|
||||
#include "utility/utilityQString.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
MessageStatus::MessageStatus(const std::string& status, bool isError, bool showLoader)
|
||||
: isError(isError)
|
||||
, showLoader(showLoader)
|
||||
{
|
||||
m_stati.push_back(utility::decodeFromUtf8(utility::replace(status, "\n", " ")));
|
||||
|
||||
setSendAsTask(false);
|
||||
}
|
||||
|
||||
MessageStatus::MessageStatus(const std::wstring& status, bool isError, bool showLoader)
|
||||
: isError(isError)
|
||||
, showLoader(showLoader)
|
||||
{
|
||||
m_stati.push_back(utility::replace(status, L"\n", L" "));
|
||||
|
||||
setSendAsTask(false);
|
||||
}
|
||||
|
||||
MessageStatus::MessageStatus(const std::vector<std::wstring>& stati, bool isError, bool showLoader)
|
||||
: isError(isError)
|
||||
, showLoader(showLoader)
|
||||
, m_stati(stati)
|
||||
{
|
||||
setSendAsTask(false);
|
||||
}
|
||||
|
||||
const std::string MessageStatus::getStaticType()
|
||||
{
|
||||
return "MessageStatus";
|
||||
}
|
||||
|
||||
const std::vector<std::wstring>& MessageStatus::stati() const
|
||||
{
|
||||
return m_stati;
|
||||
}
|
||||
|
||||
std::wstring MessageStatus::status() const
|
||||
{
|
||||
if (m_stati.size())
|
||||
{
|
||||
return m_stati[0];
|
||||
}
|
||||
|
||||
return L"";
|
||||
}
|
||||
|
||||
void MessageStatus::print(std::ostream& os) const
|
||||
{
|
||||
for (const std::wstring& status : m_stati)
|
||||
{
|
||||
os << utility::encodeToUtf8(status);
|
||||
|
||||
if (m_stati.size() > 1)
|
||||
{
|
||||
os << " - ";
|
||||
}
|
||||
}
|
||||
|
||||
if (isError)
|
||||
{
|
||||
os << " - error";
|
||||
}
|
||||
|
||||
if (showLoader)
|
||||
{
|
||||
os << " - loading";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,80 +1,30 @@
|
||||
#ifndef MESSAGE_STATUS_H
|
||||
#define MESSAGE_STATUS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
class MessageStatus
|
||||
: public Message<MessageStatus>
|
||||
{
|
||||
public:
|
||||
MessageStatus(const std::string& status, bool isError = false, bool showLoader = false)
|
||||
: isError(isError)
|
||||
, showLoader(showLoader)
|
||||
{
|
||||
m_stati.push_back(utility::replace(status, "\n", " "));
|
||||
MessageStatus(const std::string& status, bool isError = false, bool showLoader = false);
|
||||
MessageStatus(const std::wstring& status, bool isError = false, bool showLoader = false);
|
||||
MessageStatus(const std::vector<std::wstring>& stati, bool isError = false, bool showLoader = false);
|
||||
|
||||
setSendAsTask(false);
|
||||
}
|
||||
static const std::string getStaticType();
|
||||
|
||||
MessageStatus(const std::vector<std::string>& stati, bool isError = false, bool showLoader = false)
|
||||
: isError(isError)
|
||||
, showLoader(showLoader)
|
||||
, m_stati(stati)
|
||||
{
|
||||
setSendAsTask(false);
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageStatus";
|
||||
}
|
||||
|
||||
const std::vector<std::string>& stati() const
|
||||
{
|
||||
return m_stati;
|
||||
}
|
||||
|
||||
std::string status() const
|
||||
{
|
||||
if (m_stati.size())
|
||||
{
|
||||
return m_stati[0];
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
virtual void print(std::ostream& os) const
|
||||
{
|
||||
for (const std::string& status : m_stati)
|
||||
{
|
||||
os << status;
|
||||
|
||||
if (m_stati.size() > 1)
|
||||
{
|
||||
os << " - ";
|
||||
}
|
||||
}
|
||||
|
||||
if (isError)
|
||||
{
|
||||
os << " - error";
|
||||
}
|
||||
|
||||
if (showLoader)
|
||||
{
|
||||
os << " - loading";
|
||||
}
|
||||
}
|
||||
const std::vector<std::wstring>& stati() const;
|
||||
std::wstring status() const;
|
||||
virtual void print(std::ostream& os) const;
|
||||
|
||||
const bool isError;
|
||||
const bool showLoader;
|
||||
|
||||
private:
|
||||
std::vector<std::string> m_stati;
|
||||
std::vector<std::wstring> m_stati;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_STATUS_H
|
||||
|
||||
@@ -134,7 +134,7 @@ std::vector<std::string> TextAccess::splitStringByLines(const std::string& text)
|
||||
}
|
||||
|
||||
TextAccess::TextAccess()
|
||||
: m_filePath("")
|
||||
: m_filePath(L"")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,28 @@
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename StringType>
|
||||
StringType doRreplace(StringType str, const StringType& from, const StringType& to)
|
||||
{
|
||||
size_t pos = 0;
|
||||
|
||||
if (from.size() == 0)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
while ((pos = str.find(from, pos)) != std::string::npos)
|
||||
{
|
||||
str.replace(pos, from.length(), to);
|
||||
pos += to.length();
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
namespace utility
|
||||
{
|
||||
std::deque<std::string> split(const std::string& str, char delimiter)
|
||||
@@ -199,20 +221,12 @@ namespace utility
|
||||
|
||||
std::string replace(std::string str, const std::string& from, const std::string& to)
|
||||
{
|
||||
size_t pos = 0;
|
||||
return doRreplace(str, from, to);
|
||||
}
|
||||
|
||||
if (from.size() == 0)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
while ((pos = str.find(from, pos)) != std::string::npos)
|
||||
{
|
||||
str.replace(pos, from.length(), to);
|
||||
pos += to.length();
|
||||
}
|
||||
|
||||
return str;
|
||||
std::wstring replace(std::wstring str, const std::wstring& from, const std::wstring& to)
|
||||
{
|
||||
return doRreplace(str, from, to);
|
||||
}
|
||||
|
||||
std::string replaceBetween(const std::string& str, char startDelimiter, char endDelimiter, const std::string& to)
|
||||
|
||||
@@ -45,6 +45,8 @@ namespace utility
|
||||
bool equalsCaseInsensitive(const std::string& a, const std::string& b);
|
||||
|
||||
std::string replace(std::string str, const std::string& from, const std::string& to);
|
||||
std::wstring replace(std::wstring str, const std::wstring& from, const std::wstring& to);
|
||||
|
||||
std::string replaceBetween(const std::string& str, char startDelimiter, char endDelimiter, const std::string& to);
|
||||
|
||||
std::string insertLineBreaksAtBlankSpaces(const std::string& s, size_t maxLineLength);
|
||||
|
||||
@@ -120,7 +120,7 @@ std::string utility::getFileNameOfFileEntry(const clang::FileEntry* entry)
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = FilePath(entry->getName().str()).getParentDirectory().concatenate(FilePath(FilePath(fileName).fileName())).str();
|
||||
fileName = FilePath(entry->getName().str()).getParentDirectory().concatenate(FilePath(fileName).wFileName()).str();
|
||||
}
|
||||
}
|
||||
return fileName;
|
||||
|
||||
@@ -28,17 +28,15 @@ bool SourceGroupCxxCdb::prepareIndexing()
|
||||
FilePath cdbPath = m_settings->getCompilationDatabasePathExpandedAndAbsolute();
|
||||
if (!cdbPath.empty() && !cdbPath.exists())
|
||||
{
|
||||
MessageStatus("Can't refresh project").dispatch();
|
||||
MessageStatus(L"Can't refresh project").dispatch();
|
||||
|
||||
if (std::shared_ptr<Application> application = Application::getInstance())
|
||||
{
|
||||
if (application->hasGUI())
|
||||
{
|
||||
std::vector<std::string> options;
|
||||
options.push_back("Ok");
|
||||
application->handleDialog(
|
||||
"Can't refresh. The compilation database of the project does not exist anymore: " + cdbPath.str(),
|
||||
options
|
||||
L"Can't refresh. The compilation database of the project does not exist anymore: " + cdbPath.wstr(),
|
||||
{ L"Ok" }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,5 +285,7 @@ add_files(
|
||||
utility/utilityApp.h
|
||||
utility/utilityPathDetection.cpp
|
||||
utility/utilityPathDetection.h
|
||||
utility/utilityQString.cpp
|
||||
utility/utilityQString.h
|
||||
)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ void setupApp(int argc, char *argv[])
|
||||
{
|
||||
if (AppPath::getAppPath().empty())
|
||||
{
|
||||
AppPath::setAppPath(QCoreApplication::applicationDirPath().toStdString() + "/");
|
||||
AppPath::setAppPath(FilePath(QCoreApplication::applicationDirPath().toStdWString() + L"/"));
|
||||
}
|
||||
|
||||
std::string userdir(std::getenv("HOME"));
|
||||
@@ -67,8 +67,8 @@ void setupApp(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
utility::copyNewFilesFromDirectory(QString::fromStdString(ResourcePaths::getFallbackPath().str()), userDataPath);
|
||||
utility::copyNewFilesFromDirectory(QString::fromStdString(AppPath::getAppPath() + "/user/" ), userDataPath);
|
||||
utility::copyNewFilesFromDirectory(QString::fromStdWString(ResourcePaths::getFallbackPath().wstr()), userDataPath);
|
||||
utility::copyNewFilesFromDirectory(QString::fromStdWString(AppPath::getAppPath().concatenate(L"user/").wstr()), userDataPath);
|
||||
}
|
||||
|
||||
#endif // INCLUDES_DEFAULT_H
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
void setupPlatform(int argc, char *argv[])
|
||||
{
|
||||
UserPaths::setUserDataPath(FilePath("./user/"));
|
||||
UserPaths::setUserDataPath(FilePath(L"./user/"));
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// This makes relative paths work in C++ in Xcode by changing directory to the Resources folder inside the .app bundle
|
||||
@@ -58,7 +58,7 @@ 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(ResourcePaths::getFallbackPath().str());
|
||||
QString oldDataPath = QString::fromStdWString(ResourcePaths::getFallbackPath().wstr());
|
||||
|
||||
QDir dataDir(dataPath);
|
||||
if (!dataDir.exists())
|
||||
@@ -81,13 +81,13 @@ void setupPlatform(int argc, char *argv[])
|
||||
utility::copyNewFilesFromDirectory(oldDataPath, dataPath);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
UserPaths::setUserDataPath(FilePath(dataPath.toStdString() + "/"));
|
||||
UserPaths::setUserDataPath(FilePath(dataPath.toStdWString() + L"/"));
|
||||
}
|
||||
|
||||
void setupApp(int argc, char *argv[])
|
||||
{
|
||||
FilePath path(QDir::currentPath().toStdString());
|
||||
AppPath::setAppPath(path.getAbsolute().str() + "/");
|
||||
const FilePath path(QDir::currentPath().toStdWString() + L"/");
|
||||
AppPath::setAppPath(path.getAbsolute());
|
||||
}
|
||||
|
||||
#endif // INCLUDES_MAC_H
|
||||
|
||||
@@ -36,21 +36,20 @@ void setupApp(int argc, char *argv[])
|
||||
{
|
||||
appPath = appPath.substr(0, pos + 1);
|
||||
}
|
||||
AppPath::setAppPath(FilePath(appPath).str());
|
||||
}
|
||||
|
||||
{
|
||||
FilePath userDataPath(AppPath::getAppPath() + "user/");
|
||||
FilePath userDataPath = AppPath::getAppPath().concatenate(L"user/");
|
||||
if (!userDataPath.exists())
|
||||
{
|
||||
userDataPath = FilePath(std::string(std::getenv("APPDATA")) + "/../local/Coati Software/");
|
||||
if (utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_64)
|
||||
{
|
||||
userDataPath.concatenate(FilePath("Sourcetrail 64-bit/"));
|
||||
userDataPath.concatenate(L"Sourcetrail 64-bit/");
|
||||
}
|
||||
else
|
||||
{
|
||||
userDataPath.concatenate(FilePath("Sourcetrail/"));
|
||||
userDataPath.concatenate(L"Sourcetrail/");
|
||||
}
|
||||
userDataPath.makeCanonical();
|
||||
}
|
||||
@@ -58,8 +57,8 @@ void setupApp(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// This "copyFile" method does nothing if the copy destination already exist
|
||||
FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(FilePath("ApplicationSettings.xml")), UserPaths::getAppSettingsPath());
|
||||
FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(FilePath("window_settings.ini")), UserPaths::getWindowSettingsPath());
|
||||
FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(L"ApplicationSettings.xml"), UserPaths::getAppSettingsPath());
|
||||
FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(L"window_settings.ini"), UserPaths::getWindowSettingsPath());
|
||||
}
|
||||
|
||||
#endif // INCLUDES_WINDOWS_H
|
||||
|
||||
@@ -26,7 +26,7 @@ bool QtApplication::event(QEvent *event)
|
||||
{
|
||||
QFileOpenEvent* fileEvent = dynamic_cast<QFileOpenEvent*>(event);
|
||||
|
||||
FilePath path(fileEvent->file().toStdString());
|
||||
FilePath path(fileEvent->file().toStdWString());
|
||||
|
||||
if (path.exists() && (path.extension() == ".srctrlprj" || path.extension() == ".coatiproject"))
|
||||
{
|
||||
|
||||
@@ -19,8 +19,8 @@ void QtCoreApplication::handleMessage(MessageQuitApplication* message)
|
||||
|
||||
void QtCoreApplication::handleMessage(MessageStatus* message)
|
||||
{
|
||||
for (const std::string& status : message->stati())
|
||||
for (const std::wstring& status : message->stati())
|
||||
{
|
||||
std::cout << status << std::endl;
|
||||
std::wcout << status << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,7 +682,7 @@ void QtCodeArea::setIDECursorPosition()
|
||||
{
|
||||
std::pair<int, int> lineColumn = toLineColumn(this->cursorForPosition(m_eventPosition).position());
|
||||
|
||||
MessageMoveIDECursor(getSourceLocationFile()->getFilePath().str(), lineColumn.first, lineColumn.second).dispatch();
|
||||
MessageMoveIDECursor(getSourceLocationFile()->getFilePath(), lineColumn.first, lineColumn.second).dispatch();
|
||||
}
|
||||
|
||||
void QtCodeArea::activateErrors(const std::vector<const Annotation*>& annotations)
|
||||
|
||||
@@ -60,11 +60,6 @@ const FilePath& QtCodeFile::getFilePath() const
|
||||
return m_filePath;
|
||||
}
|
||||
|
||||
std::string QtCodeFile::getFileName() const
|
||||
{
|
||||
return m_filePath.fileName();
|
||||
}
|
||||
|
||||
const QtCodeFileTitleBar* QtCodeFile::getTitleBar() const
|
||||
{
|
||||
return m_titleBar;
|
||||
|
||||
@@ -30,7 +30,6 @@ public:
|
||||
void setModificationTime(const TimeStamp modificationTime);
|
||||
|
||||
const FilePath& getFilePath() const;
|
||||
std::string getFileName() const;
|
||||
|
||||
const QtCodeFileTitleBar* getTitleBar() const;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
#include "utility/utilityQString.h"
|
||||
|
||||
QtCodeFileTitleButton::QtCodeFileTitleButton(QWidget* parent)
|
||||
: QPushButton(parent)
|
||||
@@ -67,8 +68,8 @@ void QtCodeFileTitleButton::setIsComplete(bool isComplete)
|
||||
|
||||
if (!isComplete)
|
||||
{
|
||||
FilePath hatchingFilePath(ResourcePaths::getGuiPath().str() + "code_view/images/pattern_" +
|
||||
ColorScheme::getInstance()->getColor("code/file/title/hatching") + ".png"
|
||||
FilePath hatchingFilePath = ResourcePaths::getGuiPath().concatenate(L"code_view/images/pattern_" +
|
||||
utility::decodeFromUtf8(ColorScheme::getInstance()->getColor("code/file/title/hatching")) + L".png"
|
||||
);
|
||||
|
||||
setStyleSheet((
|
||||
@@ -103,23 +104,23 @@ void QtCodeFileTitleButton::updateTexts()
|
||||
return;
|
||||
}
|
||||
|
||||
std::string title = m_filePath.fileName();
|
||||
std::string toolTip = "file: " + m_filePath.str();
|
||||
std::wstring title = m_filePath.wFileName();
|
||||
std::wstring toolTip = L"file: " + m_filePath.wstr();
|
||||
|
||||
if ((!m_filePath.recheckExists()) ||
|
||||
(FileSystem::getLastWriteTime(m_filePath) > m_modificationTime))
|
||||
{
|
||||
title += "*";
|
||||
toolTip = "out of date " + toolTip;
|
||||
title += L"*";
|
||||
toolTip = L"out of date " + toolTip;
|
||||
}
|
||||
|
||||
if (!m_isComplete)
|
||||
{
|
||||
toolTip = "incomplete " + toolTip;
|
||||
toolTip = L"incomplete " + toolTip;
|
||||
}
|
||||
|
||||
setText(title.c_str());
|
||||
setToolTip(toolTip.c_str());
|
||||
setText(QString::fromStdWString(title));
|
||||
setToolTip(QString::fromStdWString(toolTip));
|
||||
}
|
||||
|
||||
void QtCodeFileTitleButton::updateFromOther(const QtCodeFileTitleButton* other)
|
||||
|
||||
@@ -569,22 +569,22 @@ void QtCodeNavigator::refreshStyle()
|
||||
m_fileButton->setFixedHeight(height);
|
||||
|
||||
m_prevButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "code_view/images/arrow_left.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_left.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_nextButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "code_view/images/arrow_right.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_right.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_listButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "code_view/images/list.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"code_view/images/list.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_fileButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "code_view/images/file.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"code_view/images/file.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ QtCodeSnippet::QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* n
|
||||
m_title = createScopeLine(layout);
|
||||
if (m_titleId == 0) // title is a file path
|
||||
{
|
||||
m_title->setText(FilePath(m_titleString).fileName().c_str());
|
||||
m_title->setText(QString::fromStdWString(FilePath(m_titleString).wFileName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -100,7 +100,7 @@ QtCodeSnippet::QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* n
|
||||
m_footer = createScopeLine(layout);
|
||||
if (m_footerId == 0) // footer is a file path
|
||||
{
|
||||
m_footer->setText(FilePath(m_footerString).fileName().c_str());
|
||||
m_footer->setText(QString::fromStdWString(FilePath(m_footerString).wFileName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ void QtListItemWidget::setText(QString text)
|
||||
FilePath relativeRoot = m_list->getRelativeRootDirectory();
|
||||
if (!relativeRoot.empty())
|
||||
{
|
||||
const FilePath path(text.toStdString());
|
||||
const FilePath path(text.toStdWString());
|
||||
const FilePath relPath = path.getRelativeTo(relativeRoot);
|
||||
if (relPath.str().size() < path.str().size())
|
||||
{
|
||||
@@ -100,7 +100,7 @@ void QtListItemWidget::setFocus()
|
||||
|
||||
void QtListItemWidget::handleButtonPress()
|
||||
{
|
||||
FilePath path(m_data->text().toStdString());
|
||||
FilePath path(m_data->text().toStdWString());
|
||||
const FilePath relativeRoot = m_list->getRelativeRootDirectory();
|
||||
if (!path.empty() && !path.isAbsolute() && !relativeRoot.empty())
|
||||
{
|
||||
@@ -141,7 +141,7 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, const QString& listName,
|
||||
m_list->setObjectName("list");
|
||||
m_list->setAttribute(Qt::WA_MacShowFocusRect, 0);
|
||||
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("window/listbox.css"))).c_str());
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"window/listbox.css")).c_str());
|
||||
layout->addWidget(m_list, 5);
|
||||
|
||||
QWidget* buttonContainer = new QWidget(this);
|
||||
|
||||
@@ -131,7 +131,7 @@ QtHistoryList::QtHistoryList(const std::vector<SearchMatch>& history, size_t cur
|
||||
}
|
||||
|
||||
setStyleSheet(utility::getStyleSheet(
|
||||
ResourcePaths::getGuiPath().concatenate(FilePath("history_list/history_list.css"))).c_str());
|
||||
ResourcePaths::getGuiPath().concatenate(L"history_list/history_list.css")).c_str());
|
||||
|
||||
connect(m_list, &QListWidget::itemClicked, this, &QtHistoryList::onItemClicked);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ void QtLocationPicker::changeEvent(QEvent *event)
|
||||
|
||||
void QtLocationPicker::handleButtonPress()
|
||||
{
|
||||
FilePath path(m_data->text().toStdString());
|
||||
FilePath path(m_data->text().toStdWString());
|
||||
if (!path.empty() && !path.isAbsolute() && !m_relativeRootDirectory.empty())
|
||||
{
|
||||
path = m_relativeRootDirectory.getConcatenated(path);
|
||||
|
||||
@@ -46,7 +46,7 @@ void QtRefreshBar::refreshStyle()
|
||||
m_refreshButton->setFixedHeight(height);
|
||||
|
||||
m_refreshButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "refresh_view/images/refresh.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"refresh_view/images/refresh.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
|
||||
@@ -123,22 +123,22 @@ QtScreenSearchBox::~QtScreenSearchBox()
|
||||
void QtScreenSearchBox::refreshStyle()
|
||||
{
|
||||
m_searchButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "search_view/images/search.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"search_view/images/search.png"),
|
||||
"screen_search/button"
|
||||
));
|
||||
|
||||
m_prevButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "code_view/images/arrow_left.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_left.png"),
|
||||
"screen_search/button"
|
||||
));
|
||||
|
||||
m_nextButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "code_view/images/arrow_right.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_right.png"),
|
||||
"screen_search/button"
|
||||
));
|
||||
|
||||
m_closeButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "screen_search_view/images/close.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"screen_search_view/images/close.png"),
|
||||
"screen_search/button"
|
||||
));
|
||||
|
||||
|
||||
@@ -102,12 +102,12 @@ void QtSearchBar::refreshStyle()
|
||||
m_homeButton->setFixedHeight(m_searchBox->height() + 5);
|
||||
|
||||
m_searchButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "search_view/images/search.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"search_view/images/search.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_homeButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "search_view/images/home.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"search_view/images/home.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ QtStatusBar::QtStatusBar()
|
||||
m_text.setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
m_text.setSizePolicy(QSizePolicy::Ignored, m_text.sizePolicy().verticalPolicy());
|
||||
addWidget(&m_text, 1);
|
||||
setText("", false, false);
|
||||
setText(L"", false, false);
|
||||
|
||||
connect(&m_text, &QPushButton::clicked, this, &QtStatusBar::showStatus);
|
||||
|
||||
@@ -49,7 +49,7 @@ QtStatusBar::QtStatusBar()
|
||||
connect(&m_errorButton, &QPushButton::clicked, this, &QtStatusBar::showErrors);
|
||||
}
|
||||
|
||||
void QtStatusBar::setText(const std::string& text, bool isError, bool showLoader)
|
||||
void QtStatusBar::setText(const std::wstring& text, bool isError, bool showLoader)
|
||||
{
|
||||
if (isError)
|
||||
{
|
||||
@@ -69,10 +69,10 @@ void QtStatusBar::setText(const std::string& text, bool isError, bool showLoader
|
||||
m_loader.hide();
|
||||
}
|
||||
|
||||
if (text.size())
|
||||
if (!text.empty())
|
||||
{
|
||||
m_textString = text;
|
||||
m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdString(m_textString), Qt::ElideRight, m_text.width()));
|
||||
m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdWString(m_textString), Qt::ElideRight, m_text.width()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void QtStatusBar::setIdeStatus(const std::string& text)
|
||||
|
||||
void QtStatusBar::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdString(m_textString), Qt::ElideRight, m_text.width()));
|
||||
m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdWString(m_textString), Qt::ElideRight, m_text.width()));
|
||||
}
|
||||
|
||||
void QtStatusBar::showStatus()
|
||||
|
||||
@@ -18,7 +18,7 @@ class QtStatusBar
|
||||
public:
|
||||
QtStatusBar();
|
||||
|
||||
void setText(const std::string& text, bool isError, bool showLoader);
|
||||
void setText(const std::wstring& text, bool isError, bool showLoader);
|
||||
void setErrorCount(ErrorCountInfo errorCount);
|
||||
|
||||
void setIdeStatus(const std::string& text);
|
||||
@@ -33,7 +33,7 @@ private slots:
|
||||
private:
|
||||
std::shared_ptr<QMovie> m_movie;
|
||||
|
||||
std::string m_textString;
|
||||
std::wstring m_textString;
|
||||
|
||||
QPushButton m_text;
|
||||
QLabel m_loader;
|
||||
|
||||
@@ -161,17 +161,17 @@ void QtUndoRedo::refreshStyle()
|
||||
m_historyButton->setFixedHeight(height);
|
||||
|
||||
m_undoButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "undoredo_view/images/arrow_left.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"undoredo_view/images/arrow_left.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_redoButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "undoredo_view/images/arrow_right.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"undoredo_view/images/arrow_right.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_historyButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "undoredo_view/images/history.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"undoredo_view/images/history.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
|
||||
@@ -190,12 +190,12 @@ void QtGraphicsView::updateZoom(float delta)
|
||||
void QtGraphicsView::refreshStyle()
|
||||
{
|
||||
m_zoomInButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "graph_view/images/zoom_in.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/zoom_in.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_zoomOutButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "graph_view/images/zoom_out.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/zoom_out.png"),
|
||||
"search/button"
|
||||
));
|
||||
}
|
||||
|
||||
@@ -212,9 +212,9 @@ namespace utility
|
||||
return QPixmap::fromImage(image);
|
||||
}
|
||||
|
||||
QIcon createButtonIcon(const std::string& iconPath, const std::string& colorId)
|
||||
QIcon createButtonIcon(const FilePath& iconPath, const std::string& colorId)
|
||||
{
|
||||
QPixmap pixmap(iconPath.c_str());
|
||||
QPixmap pixmap(QString::fromStdWString(iconPath.wstr()));
|
||||
|
||||
QIcon icon(utility::colorizePixmap(pixmap, ColorScheme::getInstance()->getColor(colorId + "/icon").c_str()));
|
||||
icon.addPixmap(
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace utility
|
||||
std::string getStyleSheet(const FilePath& path);
|
||||
|
||||
QPixmap colorizePixmap(const QPixmap& pixmap, QColor color);
|
||||
QIcon createButtonIcon(const std::string& iconPath, const std::string& colorId);
|
||||
QIcon createButtonIcon(const FilePath& iconPath, const std::string& colorId);
|
||||
|
||||
void copyNewFilesFromDirectory(QString src, QString dst);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ void QtBookmarkView::setCreateButtonState(const CreateButtonState& state)
|
||||
m_createButtonState = state;
|
||||
|
||||
m_createBookmarkButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "bookmark_view/images/edit_bookmark_icon.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/edit_bookmark_icon.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
@@ -100,7 +100,7 @@ void QtBookmarkView::setCreateButtonState(const CreateButtonState& state)
|
||||
m_createBookmarkButton->setEnabled(true);
|
||||
|
||||
m_createBookmarkButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_active.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_active.png"),
|
||||
"search/button"
|
||||
));
|
||||
}
|
||||
@@ -250,7 +250,7 @@ void QtBookmarkView::showBookmarksClicked()
|
||||
void QtBookmarkView::setStyleSheet()
|
||||
{
|
||||
m_widget->setStyleSheet(utility::getStyleSheet(
|
||||
ResourcePaths::getGuiPath().concatenate(FilePath("bookmark_view/bookmark_view.css"))
|
||||
ResourcePaths::getGuiPath().concatenate(L"bookmark_view/bookmark_view.css")
|
||||
).c_str());
|
||||
}
|
||||
|
||||
@@ -262,12 +262,12 @@ void QtBookmarkView::refreshStyle()
|
||||
m_showBookmarksButton->setFixedHeight(height);
|
||||
|
||||
m_createBookmarkButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "bookmark_view/images/edit_bookmark_icon.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/edit_bookmark_icon.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_showBookmarksButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_list_icon.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_list_icon.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ void QtCodeView::setStyleSheet() const
|
||||
{
|
||||
utility::setWidgetBackgroundColor(m_widget, ColorScheme::getInstance()->getColor("code/background"));
|
||||
|
||||
std::string styleSheet = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("code_view/code_view.css")));
|
||||
std::string styleSheet = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"code_view/code_view.css"));
|
||||
|
||||
m_widget->setStyleSheet(styleSheet.c_str());
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ void QtDialogView::showUnknownProgressDialog(const std::string& title, const std
|
||||
|
||||
void QtDialogView::hideUnknownProgressDialog()
|
||||
{
|
||||
MessageStatus("", false, false).dispatch();
|
||||
MessageStatus(L"", false, false).dispatch();
|
||||
|
||||
m_onQtThread2(
|
||||
[=]()
|
||||
@@ -104,7 +104,7 @@ void QtDialogView::hideProgressDialog()
|
||||
m_windowStack.popWindow();
|
||||
}
|
||||
|
||||
MessageStatus("", false, false).dispatch();
|
||||
MessageStatus(L"", false, false).dispatch();
|
||||
|
||||
setUIBlocked(false);
|
||||
}
|
||||
@@ -113,7 +113,6 @@ void QtDialogView::hideProgressDialog()
|
||||
setParentWindow(nullptr);
|
||||
}
|
||||
|
||||
|
||||
void QtDialogView::startIndexingDialog(
|
||||
Project* project, const std::vector<RefreshMode>& enabledModes, const RefreshInfo& info)
|
||||
{
|
||||
@@ -268,11 +267,51 @@ int QtDialogView::confirm(const std::string& message, const std::vector<std::str
|
||||
[=, &result]()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(message.c_str());
|
||||
msgBox.setText(QString::fromStdString(message));
|
||||
|
||||
for (const std::string& option : options)
|
||||
{
|
||||
msgBox.addButton(option.c_str(), QMessageBox::AcceptRole);
|
||||
msgBox.addButton(QString::fromStdString(option), QMessageBox::AcceptRole);
|
||||
}
|
||||
|
||||
msgBox.exec();
|
||||
|
||||
for (int i = 0; i < msgBox.buttons().size(); i++)
|
||||
{
|
||||
if (msgBox.clickedButton() == msgBox.buttons().at(i))
|
||||
{
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_resultReady = true;
|
||||
}
|
||||
);
|
||||
|
||||
while (!m_resultReady)
|
||||
{
|
||||
const int SLEEP_TIME_MS = 25;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME_MS));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int QtDialogView::confirm(const std::wstring& message, const std::vector<std::wstring>& options)
|
||||
{
|
||||
int result = -1;
|
||||
m_resultReady = false;
|
||||
|
||||
m_onQtThread2(
|
||||
[=, &result]()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QString::fromStdWString(message));
|
||||
|
||||
for (const std::wstring& option : options)
|
||||
{
|
||||
msgBox.addButton(QString::fromStdWString(option), QMessageBox::AcceptRole);
|
||||
}
|
||||
|
||||
msgBox.exec();
|
||||
|
||||
@@ -45,7 +45,8 @@ public:
|
||||
|
||||
virtual void hideDialogs(bool unblockUI = true) override;
|
||||
|
||||
int confirm(const std::string& message, const std::vector<std::string>& options) override;
|
||||
virtual int confirm(const std::string& message, const std::vector<std::string>& options) override;
|
||||
virtual int confirm(const std::wstring& message, const std::vector<std::wstring>& options) override;
|
||||
|
||||
void setParentWindow(QtWindow* window);
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ void QtGraphView::refreshView()
|
||||
|
||||
QtGraphicsView* view = getView();
|
||||
|
||||
std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/graph_view.css")));
|
||||
const std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"graph_view/graph_view.css"));
|
||||
view->setStyleSheet(css.c_str());
|
||||
view->setAppZoomFactor(GraphViewStyle::getZoomFactor());
|
||||
view->refreshStyle();
|
||||
@@ -168,12 +168,12 @@ void QtGraphView::refreshView()
|
||||
m_trailWidget->setStyleSheet(css.c_str());
|
||||
|
||||
m_expandButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "graph_view/images/graph.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/graph.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_collapseButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "graph_view/images/graph_arrow.png",
|
||||
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/graph_arrow.png"),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
@@ -729,49 +729,49 @@ void QtGraphView::updateTrailButtons()
|
||||
m_trailDepthLabel->setEnabled(message.trailType);
|
||||
m_trailDepthSlider->setEnabled(message.trailType);
|
||||
|
||||
std::string backwardImagePath;
|
||||
std::string forwardImagePath;
|
||||
std::wstring backwardImagePath;
|
||||
std::wstring forwardImagePath;
|
||||
|
||||
if (message.trailType & Edge::EDGE_CALL)
|
||||
{
|
||||
m_backwardTrailButton->setToolTip("show caller graph");
|
||||
m_forwardTrailButton->setToolTip("show callee graph");
|
||||
|
||||
backwardImagePath = "graph_left.png";
|
||||
forwardImagePath = "graph_right.png";
|
||||
backwardImagePath = L"graph_left.png";
|
||||
forwardImagePath = L"graph_right.png";
|
||||
}
|
||||
else if (message.trailType & Edge::EDGE_INHERITANCE)
|
||||
{
|
||||
m_backwardTrailButton->setToolTip("show base hierarchy");
|
||||
m_forwardTrailButton->setToolTip("show derived hierarchy");
|
||||
|
||||
backwardImagePath = "graph_up.png";
|
||||
forwardImagePath = "graph_down.png";
|
||||
backwardImagePath = L"graph_up.png";
|
||||
forwardImagePath = L"graph_down.png";
|
||||
}
|
||||
else if (message.trailType & Edge::EDGE_INCLUDE)
|
||||
{
|
||||
m_backwardTrailButton->setToolTip("show including files hierarchy");
|
||||
m_forwardTrailButton->setToolTip("show included files hierarchy");
|
||||
|
||||
backwardImagePath = "graph_left.png";
|
||||
forwardImagePath = "graph_right.png";
|
||||
backwardImagePath = L"graph_left.png";
|
||||
forwardImagePath = L"graph_right.png";
|
||||
}
|
||||
else
|
||||
{
|
||||
m_backwardTrailButton->setToolTip("no depth graph available for active symbol");
|
||||
m_forwardTrailButton->setToolTip("no depth graph available for active symbol");
|
||||
|
||||
backwardImagePath = "graph_left.png";
|
||||
forwardImagePath = "graph_right.png";
|
||||
backwardImagePath = L"graph_left.png";
|
||||
forwardImagePath = L"graph_right.png";
|
||||
}
|
||||
|
||||
m_backwardTrailButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "graph_view/images/" + backwardImagePath,
|
||||
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/" + backwardImagePath),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
m_forwardTrailButton->setIcon(utility::createButtonIcon(
|
||||
ResourcePaths::getGuiPath().str() + "graph_view/images/" + forwardImagePath,
|
||||
ResourcePaths::getGuiPath().concatenate(L"graph_view/images/" + forwardImagePath),
|
||||
"search/button"
|
||||
));
|
||||
|
||||
@@ -842,7 +842,7 @@ void QtGraphView::switchToNewGraphData()
|
||||
|
||||
if (m_oldGraph && m_oldGraph->getTrailMode() != Graph::TRAIL_NONE)
|
||||
{
|
||||
MessageStatus("Finished graph display").dispatch();
|
||||
MessageStatus(L"Finished graph display").dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,12 +100,12 @@ void QtMainView::hideStartScreen()
|
||||
);
|
||||
}
|
||||
|
||||
void QtMainView::setTitle(const std::string& title)
|
||||
void QtMainView::setTitle(const std::wstring& title)
|
||||
{
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
{
|
||||
m_window->setWindowTitle(QString::fromStdString(title));
|
||||
m_window->setWindowTitle(QString::fromStdWString(title));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
virtual void refreshView();
|
||||
|
||||
virtual void hideStartScreen();
|
||||
virtual void setTitle(const std::string& title);
|
||||
virtual void setTitle(const std::wstring& title);
|
||||
virtual void activateWindow();
|
||||
|
||||
virtual void updateRecentProjectMenu();
|
||||
|
||||
@@ -36,5 +36,5 @@ void QtRefreshView::refreshView()
|
||||
void QtRefreshView::setStyleSheet()
|
||||
{
|
||||
m_widget->setStyleSheet(utility::getStyleSheet(
|
||||
ResourcePaths::getGuiPath().concatenate(FilePath("refresh_view/refresh_view.css"))).c_str());
|
||||
ResourcePaths::getGuiPath().concatenate(L"refresh_view/refresh_view.css")).c_str());
|
||||
}
|
||||
|
||||
@@ -45,8 +45,11 @@ void QtScreenSearchView::refreshView()
|
||||
m_onQtThread([=]()
|
||||
{
|
||||
m_bar->setStyleSheet(
|
||||
utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(
|
||||
FilePath("screen_search_view/screen_search_view.css"))).c_str()
|
||||
utility::getStyleSheet(
|
||||
ResourcePaths::getGuiPath().concatenate(
|
||||
L"screen_search_view/screen_search_view.css"
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
m_widget->refreshStyle();
|
||||
|
||||
@@ -77,7 +77,7 @@ void QtSearchView::setAutocompletionList(const std::vector<SearchMatch>& autocom
|
||||
|
||||
void QtSearchView::setStyleSheet()
|
||||
{
|
||||
std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("search_view/search_view.css")));
|
||||
const std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"search_view/search_view.css"));
|
||||
|
||||
m_widget->setStyleSheet(css.c_str());
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ void QtStatusBarView::refreshView()
|
||||
{
|
||||
}
|
||||
|
||||
void QtStatusBarView::showMessage(const std::string& message, bool isError, bool showLoader)
|
||||
void QtStatusBarView::showMessage(const std::wstring& message, bool isError, bool showLoader)
|
||||
{
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user