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:
mlangkabel
2018-01-30 11:00:23 +01:00
parent 143cf6a02d
commit 0dda63f7ae
157 changed files with 1230 additions and 945 deletions
+6 -9
View File
@@ -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();
}