logic: use wstring in symbol and bookmark names

* use wstring in symbol and bookmark names
* fixed setting apppath in windows includes
* regard utf8 encoding in shared indexer commands
* regard utf8 encoding in shared indexer status
This commit is contained in:
mlangkabel
2018-02-05 17:17:33 +01:00
parent c99e79364f
commit 9e041c1f0a
155 changed files with 1955 additions and 1864 deletions
@@ -302,7 +302,7 @@ void QtGraphEdge::focusIn()
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_AGGREGATION);
TooltipInfo info;
info.title = Edge::getReadableTypeString(type);
info.title = utility::encodeToUtf8(Edge::getReadableTypeString(type));
if (type == Edge::EDGE_AGGREGATION && m_direction == TokenComponentAggregation::DIRECTION_NONE)
{
@@ -182,14 +182,14 @@ void QtGraphNode::setMultipleActive(bool multipleActive)
m_multipleActive = multipleActive;
}
std::string QtGraphNode::getName() const
std::wstring QtGraphNode::getName() const
{
return m_text->text().toStdString();
return m_text->text().toStdWString();
}
void QtGraphNode::setName(const std::string& name)
void QtGraphNode::setName(const std::wstring& name)
{
m_text->setText(QString::fromStdString(name));
m_text->setText(QString::fromStdWString(name));
}
void QtGraphNode::addComponent(const std::shared_ptr<QtGraphNodeComponent>& component)
@@ -458,7 +458,7 @@ void QtGraphNode::notifyEdgesAfterMove()
void QtGraphNode::matchName(const std::string& query, std::vector<QtGraphNode*>* matchedNodes)
{
m_isActiveMatch = false;
std::string name = getName();
std::string name = utility::encodeToUtf8(getName());
size_t pos = utility::toLowerCase(name).find(query);
if (pos != std::string::npos)
@@ -64,8 +64,8 @@ public:
void setIsActive(bool isActive);
void setMultipleActive(bool multipleActive);
std::string getName() const;
void setName(const std::string& name);
std::wstring getName() const;
void setName(const std::wstring& name);
void addComponent(const std::shared_ptr<QtGraphNodeComponent>& component);
@@ -17,28 +17,28 @@ QtGraphNodeAccess::QtGraphNodeAccess(AccessKind accessKind)
, m_accessIcon(nullptr)
, m_accessIconSize(16)
{
std::string accessString = TokenComponentAccess::getAccessString(m_accessKind);
std::wstring accessString = TokenComponentAccess::getAccessString(m_accessKind);
this->setName(accessString);
m_text->hide();
std::string iconFileName;
std::wstring iconFileName;
switch (m_accessKind)
{
case ACCESS_PUBLIC:
iconFileName = "public";
iconFileName = L"public";
break;
case ACCESS_PROTECTED:
iconFileName = "protected";
iconFileName = L"protected";
break;
case ACCESS_PRIVATE:
iconFileName = "private";
iconFileName = L"private";
break;
case ACCESS_DEFAULT:
iconFileName = "default";
iconFileName = L"default";
break;
case ACCESS_TEMPLATE_PARAMETER:
case ACCESS_TYPE_PARAMETER:
iconFileName = "template";
iconFileName = L"template";
break;
default:
break;
@@ -47,7 +47,7 @@ QtGraphNodeAccess::QtGraphNodeAccess(AccessKind accessKind)
if (iconFileName.size() > 0)
{
QtDeviceScaledPixmap pixmap(
QString::fromStdString(ResourcePaths::getGuiPath().str() + "graph_view/images/" + iconFileName + ".png"));
QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"graph_view/images/" + iconFileName + L".png").wstr()));
pixmap.scaleToHeight(m_accessIconSize);
m_accessIcon = new QGraphicsPixmapItem(pixmap.pixmap(), this);
@@ -9,7 +9,7 @@
#include "component/view/GraphViewStyle.h"
#include "qt/graphics/QtCountCircleItem.h"
QtGraphNodeBundle::QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, std::string name)
QtGraphNodeBundle::QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, std::wstring name)
: QtGraphNode()
, m_tokenId(tokenId)
, m_type(type)
@@ -42,7 +42,7 @@ void QtGraphNodeBundle::onClick()
{
MessageGraphNodeBundleSplit(
m_tokenId,
!m_type.isUnknownSymbol() && getName() != "Anonymous Namespaces",
!m_type.isUnknownSymbol() && getName() != L"Anonymous Namespaces", // TODO: move to language package
!m_type.isUnknownSymbol()
).dispatch();
}
@@ -11,7 +11,7 @@ class QtGraphNodeBundle
{
Q_OBJECT
public:
QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, std::string name);
QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, std::wstring name);
virtual ~QtGraphNodeBundle();
// QtGraphNode implementation
@@ -9,7 +9,7 @@
#include "data/graph/token_component/TokenComponentFilePath.h"
QtGraphNodeData::QtGraphNodeData(const Node* data, const std::string& name, bool hasParent, bool childVisible, bool hasQualifier)
QtGraphNodeData::QtGraphNodeData(const Node* data, const std::wstring& name, bool hasParent, bool childVisible, bool hasQualifier)
: m_data(data)
, m_childVisible(childVisible)
, m_hasQualifier(hasQualifier)
@@ -59,7 +59,7 @@ void QtGraphNodeData::onClick()
FilePath path = getFilePath();
MessageActivateNodes message;
message.addNode(m_data->getId(), path.empty() ? m_data->getNameHierarchy() : NameHierarchy(path.str(), NAME_DELIMITER_FILE));
message.addNode(m_data->getId(), path.empty() ? m_data->getNameHierarchy() : NameHierarchy(path.wstr(), NAME_DELIMITER_FILE));
message.dispatch();
}
@@ -10,7 +10,7 @@ class QtGraphNodeData
{
Q_OBJECT
public:
QtGraphNodeData(const Node* data, const std::string& name, bool hasParent, bool childVisible, bool hasQualifier);
QtGraphNodeData(const Node* data, const std::wstring& name, bool hasParent, bool childVisible, bool hasQualifier);
virtual ~QtGraphNodeData();
const Node* getData() const;
@@ -27,7 +27,7 @@ QtGraphNodeQualifier::QtGraphNodeQualifier(const NameHierarchy& name)
m_name = new QGraphicsSimpleTextItem(this);
m_name->setFont(font);
m_name->setText(QString::fromStdString(name.getQualifiedName()));
m_name->setText(QString::fromStdWString(name.getQualifiedName()));
}
QtGraphNodeQualifier::~QtGraphNodeQualifier()
@@ -1,6 +1,6 @@
#include "qt/view/graphElements/QtGraphNodeText.h"
QtGraphNodeText::QtGraphNodeText(const std::string& name)
QtGraphNodeText::QtGraphNodeText(const std::wstring& name)
{
setName(name);
}
@@ -8,7 +8,7 @@ class QtGraphNodeText
{
Q_OBJECT
public:
QtGraphNodeText(const std::string& name);
QtGraphNodeText(const std::wstring& name);
virtual ~QtGraphNodeText();
// QtGraphNode implementation