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:
@@ -24,18 +24,18 @@ void setupApp(int argc, char *argv[])
|
||||
WCHAR path[MAX_PATH];
|
||||
GetModuleFileNameW(hModule, path, MAX_PATH);
|
||||
|
||||
const std::wstring wPath(path);
|
||||
std::string appPath = std::string(wPath.begin(), wPath.end());
|
||||
std::wstring appPath(path);
|
||||
|
||||
size_t pos = appPath.find_last_of("/");
|
||||
if (pos == std::string::npos)
|
||||
size_t pos = appPath.find_last_of(L"/");
|
||||
if (pos == std::wstring::npos)
|
||||
{
|
||||
pos = appPath.find_last_of("\\");
|
||||
pos = appPath.find_last_of(L"\\");
|
||||
}
|
||||
if (pos != std::string::npos)
|
||||
if (pos != std::wstring::npos)
|
||||
{
|
||||
appPath = appPath.substr(0, pos + 1);
|
||||
}
|
||||
AppPath::setAppPath(FilePath(appPath));
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
QtBookmark::QtBookmark(ControllerProxy<BookmarkController>* controllerProxy)
|
||||
: m_controllerProxy(controllerProxy)
|
||||
, m_treeWidgetItem(NULL)
|
||||
, m_arrowImageName("arrow_line_down.png")
|
||||
, m_arrowImageName(L"arrow_line_down.png")
|
||||
, m_hovered(false)
|
||||
, m_ignoreNextResize(false)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ void QtBookmark::setBookmark(const std::shared_ptr<Bookmark> bookmark)
|
||||
{
|
||||
m_bookmark = bookmark;
|
||||
|
||||
m_activateButton->setText(m_bookmark->getName().c_str());
|
||||
m_activateButton->setText(QString::fromStdWString(m_bookmark->getName()));
|
||||
|
||||
if (m_bookmark->isValid() == false)
|
||||
{
|
||||
@@ -104,7 +104,7 @@ void QtBookmark::setBookmark(const std::shared_ptr<Bookmark> bookmark)
|
||||
|
||||
if (m_bookmark->getComment().length() > 0)
|
||||
{
|
||||
m_comment->setText(m_bookmark->getComment().c_str());
|
||||
m_comment->setText(QString::fromStdWString(m_bookmark->getComment()));
|
||||
m_toggleCommentButton->show();
|
||||
}
|
||||
else
|
||||
@@ -142,13 +142,13 @@ void QtBookmark::commentToggled()
|
||||
|
||||
if (m_comment->isVisible() == false)
|
||||
{
|
||||
m_arrowImageName = "arrow_line_up.png";
|
||||
m_arrowImageName = L"arrow_line_up.png";
|
||||
m_comment->show();
|
||||
m_comment->setMinimumHeight(m_comment->heightForWidth(m_comment->width()));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_arrowImageName = "arrow_line_down.png";
|
||||
m_arrowImageName = L"arrow_line_down.png";
|
||||
m_comment->hide();
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ void QtBookmark::resizeEvent(QResizeEvent* event)
|
||||
return;
|
||||
}
|
||||
|
||||
m_activateButton->setText(m_bookmark->getName().c_str());
|
||||
m_activateButton->setText(QString::fromStdWString(m_bookmark->getName()));
|
||||
QTimer::singleShot(10, this, &QtBookmark::elideButtonText);
|
||||
}
|
||||
|
||||
@@ -226,12 +226,12 @@ void QtBookmark::deleteClicked()
|
||||
void QtBookmark::elideButtonText()
|
||||
{
|
||||
m_activateButton->setText(m_activateButton->fontMetrics().elidedText(
|
||||
m_bookmark->getName().c_str(), Qt::ElideMiddle, m_activateButton->width() - 16));
|
||||
QString::fromStdWString(m_bookmark->getName()), Qt::ElideMiddle, m_activateButton->width() - 16));
|
||||
}
|
||||
|
||||
void QtBookmark::updateArrow()
|
||||
{
|
||||
QPixmap pixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/" + m_arrowImageName).c_str());
|
||||
QPixmap pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/" + m_arrowImageName).wstr()));
|
||||
m_toggleCommentButton->setIcon(QIcon(utility::colorizePixmap(pixmap, m_hovered ? "#707070" : "black")));
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
// (sizeHintChanged signal can't be emitted here...)
|
||||
QTreeWidgetItem* m_treeWidgetItem;
|
||||
|
||||
std::string m_arrowImageName;
|
||||
std::wstring m_arrowImageName;
|
||||
bool m_hovered;
|
||||
|
||||
bool m_ignoreNextResize;
|
||||
|
||||
@@ -54,14 +54,14 @@ QtBookmarkCategory::~QtBookmarkCategory()
|
||||
{
|
||||
}
|
||||
|
||||
void QtBookmarkCategory::setName(const std::string& name)
|
||||
void QtBookmarkCategory::setName(const std::wstring& name)
|
||||
{
|
||||
m_name->setText(name.c_str());
|
||||
m_name->setText(QString::fromStdWString(name));
|
||||
}
|
||||
|
||||
std::string QtBookmarkCategory::getName() const
|
||||
std::wstring QtBookmarkCategory::getName() const
|
||||
{
|
||||
return m_name->text().toStdString();
|
||||
return m_name->text().toStdWString();
|
||||
}
|
||||
|
||||
void QtBookmarkCategory::setId(const Id id)
|
||||
|
||||
@@ -20,8 +20,8 @@ public:
|
||||
QtBookmarkCategory(ControllerProxy<BookmarkController>* controllerProxy);
|
||||
~QtBookmarkCategory();
|
||||
|
||||
void setName(const std::string& name);
|
||||
std::string getName() const;
|
||||
void setName(const std::wstring& name);
|
||||
std::wstring getName() const;
|
||||
|
||||
void setId(const Id id);
|
||||
Id getId() const;
|
||||
|
||||
@@ -579,8 +579,8 @@ void QtCodeArea::mouseMoveEvent(QMouseEvent* event)
|
||||
|
||||
if (m_navigator->hasErrors() && annotations.size() == 1 && annotations[0]->tokenIds.size())
|
||||
{
|
||||
std::string errorMessage = m_navigator->getErrorMessageForId(*annotations[0]->tokenIds.begin());
|
||||
QToolTip::showText(event->globalPos(), QString::fromStdString(errorMessage));
|
||||
std::wstring errorMessage = m_navigator->getErrorMessageForId(*annotations[0]->tokenIds.begin());
|
||||
QToolTip::showText(event->globalPos(), QString::fromStdWString(errorMessage));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ void QtCodeNavigator::setFocusedTokenIds(const std::vector<Id>& focusedTokenIds)
|
||||
m_focusedTokenIds = std::set<Id>(focusedTokenIds.begin(), focusedTokenIds.end());
|
||||
}
|
||||
|
||||
std::string QtCodeNavigator::getErrorMessageForId(Id errorId) const
|
||||
std::wstring QtCodeNavigator::getErrorMessageForId(Id errorId) const
|
||||
{
|
||||
std::map<Id, ErrorInfo>::const_iterator it = m_errorInfos.find(errorId);
|
||||
|
||||
@@ -338,7 +338,7 @@ std::string QtCodeNavigator::getErrorMessageForId(Id errorId) const
|
||||
return it->second.message;
|
||||
}
|
||||
|
||||
return "";
|
||||
return L"";
|
||||
}
|
||||
|
||||
void QtCodeNavigator::setErrorInfos(const std::vector<ErrorInfo>& errorInfos)
|
||||
@@ -362,7 +362,7 @@ size_t QtCodeNavigator::getFatalErrorCountForFile(const FilePath& filePath) cons
|
||||
for (const std::pair<Id, ErrorInfo>& p : m_errorInfos)
|
||||
{
|
||||
const ErrorInfo& error = p.second;
|
||||
if (error.filePath == filePath && error.fatal)
|
||||
if (error.filePath == filePath.wstr() && error.fatal)
|
||||
{
|
||||
fatalErrorCount++;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
const std::set<Id>& getFocusedTokenIds() const;
|
||||
void setFocusedTokenIds(const std::vector<Id>& focusedTokenIds);
|
||||
|
||||
std::string getErrorMessageForId(Id errorId) const;
|
||||
std::wstring getErrorMessageForId(Id errorId) const;
|
||||
void setErrorInfos(const std::vector<ErrorInfo>& errorInfos);
|
||||
|
||||
bool hasErrors() const;
|
||||
|
||||
@@ -194,7 +194,7 @@ bool QtSmartSearchBox::event(QEvent *event)
|
||||
}
|
||||
else if (m_highlightedMatch.hasChildren)
|
||||
{
|
||||
setEditText((m_highlightedMatch.getFullName() + nameDelimiterTypeToString(m_highlightedMatch.delimiter)).c_str());
|
||||
setEditText((m_highlightedMatch.getFullName() + utility::encodeToUtf8(nameDelimiterTypeToString(m_highlightedMatch.delimiter))).c_str());
|
||||
requestAutoCompletions();
|
||||
}
|
||||
else
|
||||
@@ -302,7 +302,7 @@ void QtSmartSearchBox::keyPressEvent(QKeyEvent* event)
|
||||
}
|
||||
else
|
||||
{
|
||||
const NameDelimiterType delimiter = detectDelimiterType(text().toStdString());
|
||||
const NameDelimiterType delimiter = detectDelimiterType(text().toStdWString());
|
||||
std::vector<std::string> names = utility::splitToVector(text().toStdString(), delimiter);
|
||||
if (names.back() == "")
|
||||
{
|
||||
|
||||
@@ -327,7 +327,7 @@ void QtGraphicsView::wheelEvent(QWheelEvent* event)
|
||||
|
||||
void QtGraphicsView::contextMenuEvent(QContextMenuEvent* event)
|
||||
{
|
||||
m_clipboardNodeName = "";
|
||||
m_clipboardNodeName = L"";
|
||||
m_hideNodeId = 0;
|
||||
m_hideEdgeId = 0;
|
||||
m_bookmarkNodeId = 0;
|
||||
@@ -370,7 +370,7 @@ void QtGraphicsView::contextMenuEvent(QContextMenuEvent* event)
|
||||
m_hideEdgeAction->setEnabled(m_hideEdgeId);
|
||||
m_bookmarkNodeAction->setEnabled(m_bookmarkNodeId);
|
||||
|
||||
m_copyNodeNameAction->setEnabled(m_clipboardNodeName.size());
|
||||
m_copyNodeNameAction->setEnabled(!m_clipboardNodeName.empty());
|
||||
|
||||
QtContextMenu menu(event, this);
|
||||
|
||||
@@ -496,7 +496,7 @@ void QtGraphicsView::exportGraph()
|
||||
|
||||
void QtGraphicsView::copyNodeName()
|
||||
{
|
||||
QApplication::clipboard()->setText(m_clipboardNodeName.c_str());
|
||||
QApplication::clipboard()->setText(QString::fromStdWString(m_clipboardNodeName));
|
||||
}
|
||||
|
||||
void QtGraphicsView::hideNode()
|
||||
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
bool m_right;
|
||||
bool m_shift;
|
||||
|
||||
std::string m_clipboardNodeName;
|
||||
std::wstring m_clipboardNodeName;
|
||||
Id m_hideNodeId;
|
||||
Id m_hideEdgeId;
|
||||
Id m_bookmarkNodeId;
|
||||
|
||||
@@ -113,7 +113,7 @@ void QtBookmarkView::setCreateButtonState(const CreateButtonState& state)
|
||||
}
|
||||
|
||||
void QtBookmarkView::displayBookmarkCreator(
|
||||
const std::vector<std::string>& names, const std::vector<BookmarkCategory>& categories, Id nodeId
|
||||
const std::vector<std::wstring>& names, const std::vector<BookmarkCategory>& categories, Id nodeId
|
||||
){
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
@@ -124,7 +124,7 @@ void QtBookmarkView::displayBookmarkCreator(
|
||||
);
|
||||
bookmarkCreator->setupBookmarkCreator();
|
||||
|
||||
std::string displayName = "";
|
||||
std::wstring displayName = L"";
|
||||
|
||||
for (unsigned int i = 0; i < names.size(); i++)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ void QtBookmarkView::displayBookmarkCreator(
|
||||
|
||||
if (i < names.size() - 1)
|
||||
{
|
||||
displayName += "; ";
|
||||
displayName += L"; ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
virtual void setCreateButtonState(const CreateButtonState& state);
|
||||
|
||||
virtual void displayBookmarkCreator(
|
||||
const std::vector<std::string>& names, const std::vector<BookmarkCategory>& categories, Id nodeId);
|
||||
const std::vector<std::wstring>& names, const std::vector<BookmarkCategory>& categories, Id nodeId);
|
||||
virtual void displayBookmarkEditor(
|
||||
std::shared_ptr<Bookmark> bookmark, const std::vector<BookmarkCategory>& categories);
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ void QtDialogView::startIndexingDialog(
|
||||
}
|
||||
|
||||
void QtDialogView::updateIndexingDialog(
|
||||
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, std::string sourcePath)
|
||||
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, const FilePath& sourcePath)
|
||||
{
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
virtual void startIndexingDialog(
|
||||
Project* project, const std::vector<RefreshMode>& enabledModes, const RefreshInfo& info) override;
|
||||
virtual void updateIndexingDialog(
|
||||
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, std::string sourcePath) override;
|
||||
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, const FilePath& sourcePath) override;
|
||||
virtual void finishedIndexingDialog(
|
||||
size_t indexedFileCount, size_t totalIndexedFileCount, size_t completedFileCount, size_t totalFileCount,
|
||||
float time, ErrorCountInfo errorInfo, bool interrupted) override;
|
||||
|
||||
@@ -330,10 +330,10 @@ void QtErrorView::addErrorToTable(const ErrorInfo& error)
|
||||
}
|
||||
m_model->item(rowNumber, COLUMN::TYPE)->setIcon(s_errorIcon);
|
||||
|
||||
m_model->setItem(rowNumber, COLUMN::MESSAGE, new QStandardItem(error.message.c_str()));
|
||||
m_model->setItem(rowNumber, COLUMN::MESSAGE, new QStandardItem(QString::fromStdWString(error.message)));
|
||||
|
||||
m_model->setItem(rowNumber, COLUMN::FILE, new QStandardItem(error.filePath.str().c_str()));
|
||||
m_model->item(rowNumber, COLUMN::FILE)->setToolTip(error.filePath.str().c_str());
|
||||
m_model->setItem(rowNumber, COLUMN::FILE, new QStandardItem(QString::fromStdWString(error.filePath)));
|
||||
m_model->item(rowNumber, COLUMN::FILE)->setToolTip(QString::fromStdWString(error.filePath));
|
||||
|
||||
m_model->setItem(rowNumber, COLUMN::LINE, new QStandardItem(QString::number(error.lineNumber)));
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -131,7 +131,7 @@ void QtBookmarkBrowser::setBookmarks(const std::vector<std::shared_ptr<Bookmark>
|
||||
|
||||
m_bookmarkTree->clear();
|
||||
|
||||
std::map<std::string, BookmarkCategory> categoryNamesOrdered;
|
||||
std::map<std::wstring, BookmarkCategory> categoryNamesOrdered;
|
||||
for (const std::shared_ptr<Bookmark>& bookmark : bookmarks)
|
||||
{
|
||||
categoryNamesOrdered.emplace(bookmark->getCategory().getName(), bookmark->getCategory());
|
||||
@@ -255,7 +255,7 @@ QTreeWidgetItem* QtBookmarkBrowser::findOrCreateTreeCategory(const BookmarkCateg
|
||||
{
|
||||
QTreeWidgetItem* item = m_bookmarkTree->topLevelItem(i);
|
||||
|
||||
if (item->whatsThis(0).toStdString() == category.getName())
|
||||
if (item->whatsThis(0).toStdWString() == category.getName())
|
||||
{
|
||||
return item;
|
||||
}
|
||||
@@ -268,12 +268,12 @@ QTreeWidgetItem* QtBookmarkBrowser::findOrCreateTreeCategory(const BookmarkCateg
|
||||
}
|
||||
else
|
||||
{
|
||||
categoryItem->setName("No Category");
|
||||
categoryItem->setName(L"No Category");
|
||||
}
|
||||
categoryItem->setId(category.getId());
|
||||
|
||||
QTreeWidgetItem* newItem = new QTreeWidgetItem(m_bookmarkTree);
|
||||
newItem->setWhatsThis(0, category.getName().c_str());
|
||||
newItem->setWhatsThis(0, QString::fromStdWString(category.getName()));
|
||||
|
||||
categoryItem->setTreeWidgetItem(newItem);
|
||||
|
||||
|
||||
@@ -111,27 +111,27 @@ void QtBookmarkCreator::refreshStyle()
|
||||
).c_str());
|
||||
}
|
||||
|
||||
void QtBookmarkCreator::setDisplayName(const std::string& name)
|
||||
void QtBookmarkCreator::setDisplayName(const std::wstring& name)
|
||||
{
|
||||
m_displayName->setText(name.c_str());
|
||||
m_displayName->setText(QString::fromStdWString(name));
|
||||
}
|
||||
|
||||
void QtBookmarkCreator::setComment(const std::string& comment)
|
||||
void QtBookmarkCreator::setComment(const std::wstring& comment)
|
||||
{
|
||||
m_commentBox->setText(comment.c_str());
|
||||
m_commentBox->setText(QString::fromStdWString(comment));
|
||||
}
|
||||
|
||||
void QtBookmarkCreator::setBookmarkCategories(const std::vector<BookmarkCategory>& categories)
|
||||
{
|
||||
for (unsigned int i = 0; i < categories.size(); i++)
|
||||
{
|
||||
m_categoryBox->addItem(categories[i].getName().c_str());
|
||||
m_categoryBox->addItem(QString::fromStdWString(categories[i].getName()));
|
||||
}
|
||||
}
|
||||
|
||||
void QtBookmarkCreator::setCurrentBookmarkCategory(const BookmarkCategory& category)
|
||||
{
|
||||
int index = m_categoryBox->findText(category.getName().c_str());
|
||||
int index = m_categoryBox->findText(QString::fromStdWString(category.getName()));
|
||||
|
||||
if (index > -1)
|
||||
{
|
||||
@@ -139,7 +139,7 @@ void QtBookmarkCreator::setCurrentBookmarkCategory(const BookmarkCategory& categ
|
||||
}
|
||||
else
|
||||
{
|
||||
m_categoryBox->addItem(category.getName().c_str());
|
||||
m_categoryBox->addItem(QString::fromStdWString(category.getName()));
|
||||
m_categoryBox->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
@@ -158,9 +158,9 @@ void QtBookmarkCreator::resizeEvent(QResizeEvent* event)
|
||||
|
||||
void QtBookmarkCreator::handleNext()
|
||||
{
|
||||
std::string name = m_displayName->text().toStdString();
|
||||
std::string comment = m_commentBox->toPlainText().toStdString();
|
||||
std::string category = m_categoryBox->currentText().toStdString();
|
||||
std::wstring name = m_displayName->text().toStdWString();
|
||||
std::wstring comment = m_commentBox->toPlainText().toStdWString();
|
||||
std::wstring category = m_categoryBox->currentText().toStdWString();
|
||||
|
||||
if (m_editBookmarkId)
|
||||
{
|
||||
|
||||
@@ -26,8 +26,8 @@ public:
|
||||
|
||||
void refreshStyle();
|
||||
|
||||
void setDisplayName(const std::string& name);
|
||||
void setComment(const std::string& comment);
|
||||
void setDisplayName(const std::wstring& name);
|
||||
void setComment(const std::wstring& comment);
|
||||
|
||||
void setBookmarkCategories(const std::vector<BookmarkCategory>& categories);
|
||||
void setCurrentBookmarkCategory(const BookmarkCategory& category);
|
||||
|
||||
@@ -296,7 +296,7 @@ size_t QtIndexingDialog::getProgress() const
|
||||
return m_progressBar->getProgress();
|
||||
}
|
||||
|
||||
void QtIndexingDialog::updateIndexingProgress(size_t fileCount, size_t totalFileCount, std::string sourcePath)
|
||||
void QtIndexingDialog::updateIndexingProgress(size_t fileCount, size_t totalFileCount, const FilePath& sourcePath)
|
||||
{
|
||||
updateMessage(QString::number(fileCount) + "/" + QString::number(totalFileCount) + " File" + (totalFileCount > 1 ? "s" : ""));
|
||||
|
||||
@@ -306,9 +306,9 @@ void QtIndexingDialog::updateIndexingProgress(size_t fileCount, size_t totalFile
|
||||
progress = fileCount * 100 / totalFileCount;
|
||||
}
|
||||
|
||||
if (sourcePath.size())
|
||||
if (!sourcePath.empty())
|
||||
{
|
||||
m_sourcePath = QString::fromStdString(sourcePath);
|
||||
m_sourcePath = QString::fromStdWString(sourcePath.wstr());
|
||||
}
|
||||
|
||||
updateProgress(progress);
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
std::string getMessage() const;
|
||||
void updateProgress(size_t progress);
|
||||
size_t getProgress() const;
|
||||
void updateIndexingProgress(size_t fileCount, size_t totalFileCount, std::string sourcePath);
|
||||
void updateIndexingProgress(size_t fileCount, size_t totalFileCount, const FilePath& sourcePath);
|
||||
void updateErrorCount(size_t errorCount, size_t fatalCount);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -925,10 +925,10 @@ void QtMainWindow::setupBookmarksMenu()
|
||||
for (size_t i = 0; i < m_bookmarks.size(); i++)
|
||||
{
|
||||
Bookmark* bookmark = m_bookmarks[i].get();
|
||||
std::string name = utility::elide(bookmark->getName(), utility::ELIDE_RIGHT, 50);
|
||||
std::wstring name = utility::elide(bookmark->getName(), utility::ELIDE_RIGHT, 50);
|
||||
|
||||
QAction* action = new QAction();
|
||||
action->setText(name.c_str());
|
||||
action->setText(QString::fromStdWString(name));
|
||||
action->setData(QVariant(int(i)));
|
||||
|
||||
connect(action, &QAction::triggered, this, &QtMainWindow::activateBookmarkAction);
|
||||
|
||||
Reference in New Issue
Block a user