ui: Fixed activating history item from menu showed wrong symbol (issue #572)
* Refactored SearchMatch: removed delimiter, added tokenName * Refactored MessageActivateTokens: removed tokenNames * Restore from SearchMatches from NameHierarchies of tokens
This commit is contained in:
@@ -23,7 +23,7 @@ QtHistoryItem::QtHistoryItem(const SearchMatch& match, size_t index, bool isCurr
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setAlignment(Qt::AlignTop);
|
||||
|
||||
const std::wstring name = utility::elide(match.nodeType.isFile() ? match.text : match.name, utility::ELIDE_RIGHT, 100);
|
||||
const std::wstring name = utility::elide(match.getFullName(), utility::ELIDE_RIGHT, 100);
|
||||
|
||||
m_name = new QLabel(QString::fromStdWString(name), this);
|
||||
m_name->setAttribute(Qt::WA_MacShowFocusRect, 0);
|
||||
|
||||
@@ -96,5 +96,5 @@ void QtSearchBar::refreshStyle()
|
||||
|
||||
void QtSearchBar::homeButtonClicked()
|
||||
{
|
||||
MessageSearch(std::vector<SearchMatch>(1, SearchMatch::createCommand(SearchMatch::COMMAND_ALL))).dispatch();
|
||||
MessageSearch({ SearchMatch::createCommand(SearchMatch::COMMAND_ALL) }).dispatch();
|
||||
}
|
||||
|
||||
@@ -66,9 +66,7 @@ void QtSmartSearchBox::search()
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<SearchMatch> matches = utility::toVector(m_matches);
|
||||
|
||||
MessageSearch(matches, getMatchAcceptedNodeTypes()).dispatch();
|
||||
MessageSearch(utility::toVector(m_matches), getMatchAcceptedNodeTypes()).dispatch();
|
||||
}
|
||||
|
||||
void QtSmartSearchBox::fullTextSearch()
|
||||
@@ -194,7 +192,8 @@ bool QtSmartSearchBox::event(QEvent *event)
|
||||
}
|
||||
else if (m_highlightedMatch.hasChildren)
|
||||
{
|
||||
setEditText(QString::fromStdWString(m_highlightedMatch.getFullName() + nameDelimiterTypeToString(m_highlightedMatch.delimiter)));
|
||||
setEditText(QString::fromStdWString(
|
||||
m_highlightedMatch.getFullName() + nameDelimiterTypeToString(m_highlightedMatch.tokenName.getDelimiter())));
|
||||
requestAutoCompletions();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -118,6 +118,5 @@ void QtStatusBar::showStatus()
|
||||
|
||||
void QtStatusBar::showErrors()
|
||||
{
|
||||
SearchMatch match = SearchMatch::createCommand(SearchMatch::COMMAND_ERROR);
|
||||
MessageSearch(std::vector<SearchMatch>(1, match)).dispatch();
|
||||
MessageSearch({ SearchMatch::createCommand(SearchMatch::COMMAND_ERROR) }).dispatch();
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ void QtMainWindow::codeReferenceNext()
|
||||
|
||||
void QtMainWindow::overview()
|
||||
{
|
||||
MessageSearch(std::vector<SearchMatch>(1, SearchMatch::createCommand(SearchMatch::COMMAND_ALL))).dispatch();
|
||||
MessageSearch({ SearchMatch::createCommand(SearchMatch::COMMAND_ALL) }).dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::closeWindow()
|
||||
@@ -755,9 +755,7 @@ void QtMainWindow::openHistoryAction()
|
||||
QAction* action = qobject_cast<QAction*>(sender());
|
||||
if (action)
|
||||
{
|
||||
SearchMatch& match = m_history[action->data().toInt()];
|
||||
|
||||
MessageSearch msg({ match });
|
||||
MessageSearch msg({ m_history[action->data().toInt()] });
|
||||
msg.isFromSearch = false;
|
||||
msg.dispatch();
|
||||
}
|
||||
@@ -889,7 +887,7 @@ void QtMainWindow::setupHistoryMenu()
|
||||
for (size_t i = 0; i < m_history.size(); i++)
|
||||
{
|
||||
SearchMatch& match = m_history[i];
|
||||
const std::wstring name = utility::elide(match.nodeType.isFile() ? match.text : match.name, utility::ELIDE_RIGHT, 50);
|
||||
const std::wstring name = utility::elide(match.getFullName(), utility::ELIDE_RIGHT, 50);
|
||||
|
||||
QAction* action = new QAction();
|
||||
action->setText(QString::fromStdWString(name));
|
||||
|
||||
Reference in New Issue
Block a user