src: miscellaneous fixes

* fixed code view snippet minimize click expanded snippet again
* fixed typedef nodes node grouped within file group
* fixed splitting anonymous namespace bundle increased group nesting instead
* fixed build, tests and clang warnings
This commit is contained in:
Eberhard Graether
2018-06-08 16:12:53 +02:00
parent dcf506e3d7
commit 1a37a9af34
8 changed files with 40 additions and 5 deletions
@@ -272,12 +272,22 @@ void GraphController::handleMessage(MessageFocusOut *message)
void GraphController::handleMessage(MessageGraphNodeBundleSplit* message)
{
std::wstring name;
if (m_dummyNodes.size() == 1 && m_dummyNodes[0]->isGroupNode())
{
name = m_dummyNodes[0]->name;
std::shared_ptr<DummyNode> groupNode = m_dummyNodes[0];
m_dummyNodes = groupNode->subNodes;
}
for (size_t i = 0; i < m_dummyNodes.size(); i++)
{
DummyNode* node = m_dummyNodes[i].get();
if ((node->isBundleNode() || node->isGroupNode()) && node->tokenId == message->bundleId)
{
name = node->name;
if (!name.size())
{
name = node->name;
}
std::vector<std::shared_ptr<DummyNode>> nodes;
if (node->isBundleNode())
@@ -476,6 +476,8 @@ std::map<Id, std::pair<Id, NameHierarchy>> PersistentStorage::getNodeIdToParentF
std::map<Id, std::pair<Id, NameHierarchy>> nodeIdToParentFileMap;
std::shared_ptr<SourceLocationCollection> locations = m_sqliteIndexStorage.getSourceLocationsForElementIds(nodeIds);
// prefer scope locations if available
locations->forEachSourceLocation(
[this, &nodeIdToParentFileMap](SourceLocation* location)
{
@@ -490,6 +492,26 @@ std::map<Id, std::pair<Id, NameHierarchy>> PersistentStorage::getNodeIdToParentF
}
);
// fill in missing ones
locations->forEachSourceLocation(
[this, &nodeIdToParentFileMap](SourceLocation* location)
{
if (!location->isStartLocation())
{
return;
}
for (Id tokenId : location->getTokenIds())
{
if (nodeIdToParentFileMap.find(tokenId) == nodeIdToParentFileMap.end())
{
nodeIdToParentFileMap.emplace(tokenId, std::make_pair(getFileNodeId(location->getFilePath()),
NameHierarchy(location->getFilePath().wstr(), NAME_DELIMITER_FILE)));
}
}
}
);
return nodeIdToParentFileMap;
}
+2
View File
@@ -356,6 +356,8 @@ SettingsMigrator ProjectSettings::getMigrations() const
case LANGUAGE_JAVA:
languageName = "java";
break;
case LANGUAGE_UNKNOWN:
continue;
}
std::string key = SourceGroupSettings::s_keyPrefix + sourceGroupSettings->getId();
+1 -1
View File
@@ -344,7 +344,7 @@ FilePath FilePath::getLowerCase() const
bool FilePath::contains(const FilePath& other) const
{
if (exists() && !isDirectory())
if (!isDirectory())
{
return false;
}
@@ -3,6 +3,7 @@
#include <memory>
#include <set>
#include <string>
#include <vector>
class ApplicationSettings;
@@ -2,7 +2,7 @@
#define CODEBLOCKS_TARGET_H
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "utility/codeblocks/CodeblocksTargetRelationType.h"
@@ -14,6 +14,8 @@ namespace Codeblocks
return 2;
case CODEBLOCKS_TARGET_RELATION_TARGET_AFTER_PROJECT:
return 3;
case CODEBLOCKS_TARGET_RELATION_UNKNOWN:
break;
}
return 99;
}
-2
View File
@@ -387,8 +387,6 @@ void QtCodeFile::findScreenMatches(const std::wstring& query, std::vector<std::p
void QtCodeFile::clickedMinimizeButton()
{
m_navigator->requestScroll(m_filePath, 0, 0, false, QtCodeNavigateable::SCROLL_VISIBLE);
MessageChangeFileView(
m_filePath,
MessageChangeFileView::FILE_MINIMIZED,