logic: multiple fixes and improvements

* showing project name in main window title
* keep reference count visible when maximizing code file
* show first node in db when no main function is available
* log Storage stats after parse
* fixed macro locations saved multiply
* using NameHierarchy when retrieving ids
This commit is contained in:
Eberhard Graether
2015-10-01 19:03:05 +02:00
parent 8fa9bdde5e
commit 2704d47cd8
28 changed files with 246 additions and 154 deletions
+24 -3
View File
@@ -188,6 +188,17 @@ void SqliteStorage::removeUnusedNameHierarchyElements()
);
}
StorageNode SqliteStorage::getFirstNode() const
{
std::vector<StorageNode> nodes = getAllNodes("LIMIT 1");
if (nodes.size())
{
return nodes[0];
}
return StorageNode(0, 0, 0);
}
std::vector<StorageNode> SqliteStorage::getAllNodes() const
{
std::vector<StorageNode> nodes;
@@ -680,17 +691,27 @@ Id SqliteStorage::getNodeIdBySignature(const std::string& signature) const
int SqliteStorage::getNodeCount() const
{
return m_database.execScalar("SELECT COUNT(*) from node;");
return m_database.execScalar("SELECT COUNT(*) FROM node;");
}
int SqliteStorage::getEdgeCount() const
{
return m_database.execScalar("SELECT COUNT(*) from edge;");
return m_database.execScalar("SELECT COUNT(*) FROM edge;");
}
int SqliteStorage::getFileCount() const
{
return m_database.execScalar("SELECT COUNT(*) FROM file;");
}
int SqliteStorage::getNameHierarchyElementCount() const
{
return m_database.execScalar("SELECT COUNT(*) from name_hierarchy_element;");
return m_database.execScalar("SELECT COUNT(*) FROM name_hierarchy_element;");
}
int SqliteStorage::getSourceLocationCount() const
{
return m_database.execScalar("SELECT COUNT(*) FROM source_location;");
}
void SqliteStorage::clearTables()