logic: implemented handling of non-ascii characters in screen search
This commit is contained in:
@@ -271,7 +271,7 @@ void QtGraphNode::showNodeRecursive()
|
||||
}
|
||||
}
|
||||
|
||||
void QtGraphNode::matchNameRecursive(const std::string& query, std::vector<QtGraphNode*>* matchedNodes)
|
||||
void QtGraphNode::matchNameRecursive(const std::wstring& query, std::vector<QtGraphNode*>* matchedNodes)
|
||||
{
|
||||
matchName(query, matchedNodes);
|
||||
|
||||
@@ -473,10 +473,10 @@ void QtGraphNode::notifyEdgesAfterMove()
|
||||
}
|
||||
}
|
||||
|
||||
void QtGraphNode::matchName(const std::string& query, std::vector<QtGraphNode*>* matchedNodes)
|
||||
void QtGraphNode::matchName(const std::wstring& query, std::vector<QtGraphNode*>* matchedNodes)
|
||||
{
|
||||
m_isActiveMatch = false;
|
||||
std::string name = utility::encodeToUtf8(getName());
|
||||
const std::wstring name = getName();
|
||||
size_t pos = utility::toLowerCase(name).find(query);
|
||||
|
||||
if (pos != std::string::npos)
|
||||
@@ -490,9 +490,9 @@ void QtGraphNode::matchName(const std::string& query, std::vector<QtGraphNode*>*
|
||||
m_matchRect->show();
|
||||
m_matchText->show();
|
||||
|
||||
std::string matchName(name.length(), ' ');
|
||||
std::wstring matchName(name.length(), L' ');
|
||||
matchName.replace(pos, query.length(), name.substr(pos, query.length()));
|
||||
m_matchText->setText(matchName.c_str());
|
||||
m_matchText->setText(QString::fromStdWString(matchName));
|
||||
|
||||
matchedNodes->push_back(this);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
void showNodeRecursive();
|
||||
|
||||
void matchNameRecursive(const std::string& query, std::vector<QtGraphNode*>* matchedNodes);
|
||||
void matchNameRecursive(const std::wstring& query, std::vector<QtGraphNode*>* matchedNodes);
|
||||
void removeNameMatch();
|
||||
void setActiveMatch(bool active);
|
||||
|
||||
@@ -107,7 +107,7 @@ protected:
|
||||
|
||||
void notifyEdgesAfterMove();
|
||||
|
||||
virtual void matchName(const std::string& query, std::vector<QtGraphNode*>* matchedNodes);
|
||||
virtual void matchName(const std::wstring& query, std::vector<QtGraphNode*>* matchedNodes);
|
||||
|
||||
void setStyle(const GraphViewStyle::NodeStyle& style);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
void hideLabel();
|
||||
|
||||
protected:
|
||||
virtual void matchName(const std::string& query, std::vector<QtGraphNode*>* matchedNodes) override {}
|
||||
virtual void matchName(const std::wstring& query, std::vector<QtGraphNode*>* matchedNodes) override {}
|
||||
|
||||
private:
|
||||
AccessKind m_accessKind;
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
virtual void updateStyle();
|
||||
|
||||
protected:
|
||||
virtual void matchName(const std::string& query, std::vector<QtGraphNode*>* matchedNodes) {}
|
||||
virtual void matchName(const std::wstring& query, std::vector<QtGraphNode*>* matchedNodes) {}
|
||||
|
||||
private:
|
||||
QGraphicsPixmapItem* m_icon;
|
||||
|
||||
@@ -26,7 +26,7 @@ protected:
|
||||
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
|
||||
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
|
||||
|
||||
virtual void matchName(const std::string& query, std::vector<QtGraphNode*>* matchedNodes) {}
|
||||
virtual void matchName(const std::wstring& query, std::vector<QtGraphNode*>* matchedNodes) {}
|
||||
|
||||
private:
|
||||
const NameHierarchy m_qualifierName;
|
||||
|
||||
Reference in New Issue
Block a user