logic: reduce access to filesystem while indexing

* use canonical filepath cache in cxx indexer
* made constructors of FilePath explicit
* use FilePath at more places instead of string
* forward declares FilePath wherever possible
This commit is contained in:
malte_langkabel
2017-05-04 10:55:16 +02:00
parent 55d3f9c189
commit 054b8fab17
156 changed files with 656 additions and 444 deletions
@@ -428,7 +428,7 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style)
if (style.hasHatching)
{
QtDeviceScaledPixmap pattern((ResourcePaths::getGuiPath() + "graph_view/images/pattern.png").c_str());
QtDeviceScaledPixmap pattern((ResourcePaths::getGuiPath().str() + "graph_view/images/pattern.png").c_str());
pattern.scaleToHeight(12);
QPixmap pixmap = utility::colorizePixmap(pattern.pixmap(), style.color.hatching.c_str());
@@ -47,7 +47,7 @@ QtGraphNodeAccess::QtGraphNodeAccess(AccessKind accessKind)
if (iconFileName.size() > 0)
{
QtDeviceScaledPixmap pixmap(
QString::fromStdString(ResourcePaths::getGuiPath() + "graph_view/images/" + iconFileName + ".png"));
QString::fromStdString(ResourcePaths::getGuiPath().str() + "graph_view/images/" + iconFileName + ".png"));
pixmap.scaleToHeight(m_accessIconSize);
m_accessIcon = new QGraphicsPixmapItem(pixmap.pixmap(), this);
@@ -1,5 +1,6 @@
#include "qt/view/graphElements/QtGraphNodeData.h"
#include "utility/file/FilePath.h"
#include "utility/messaging/type/MessageActivateNodes.h"
#include "utility/messaging/type/MessageDeactivateEdge.h"
#include "utility/messaging/type/MessageFocusIn.h"
@@ -1,10 +1,10 @@
#ifndef QT_GRAPH_NODE_DATA_H
#define QT_GRAPH_NODE_DATA_H
#include "utility/file/FilePath.h"
#include "qt/view/graphElements/QtGraphNode.h"
class FilePath;
class QtGraphNodeData
: public QtGraphNode
{
@@ -26,7 +26,7 @@ QtGraphNodeExpandToggle::QtGraphNodeExpandToggle(bool expanded, int invisibleSub
m_icon->setTransformationMode(Qt::SmoothTransformation);
m_icon->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
QtDeviceScaledPixmap pixmap((ResourcePaths::getGuiPath() + "graph_view/images/arrow.png").c_str());
QtDeviceScaledPixmap pixmap((ResourcePaths::getGuiPath().str() + "graph_view/images/arrow.png").c_str());
pixmap.scaleToHeight(iconHeight);
if (invisibleSubNodeCount)