|
|
3a14799 |
From: Gilles Caulier <caulier.gilles@gmail.com>
|
|
|
3a14799 |
Date: Fri, 06 Jan 2012 10:23:48 +0000
|
|
|
3a14799 |
Subject: Apply patch #67483 from Jeremiah Willcock to compile fine digiKam boost graph interface with libboost 1.48
|
|
|
3a14799 |
X-Git-Url: http://quickgit.kde.org/?p=digikam.git&a=commitdiff&h=d18ea6da2d3e2359f4113e83c3fd40c18a29ddab
|
|
|
3a14799 |
---
|
|
|
3a14799 |
Apply patch #67483 from Jeremiah Willcock to compile fine digiKam boost graph interface with libboost 1.48
|
|
|
3a14799 |
BUGS: 287772
|
|
|
3a14799 |
CCBUGS: 267777
|
|
|
3a14799 |
---
|
|
|
3a14799 |
|
|
|
3a14799 |
|
|
|
58c193f |
--- a/libs/database/imagehistory/imagehistorygraph_boost.h
|
|
|
58c193f |
+++ b/libs/database/imagehistory/imagehistorygraph_boost.h
|
|
|
3a14799 |
@@ -1198,7 +1198,7 @@ protected:
|
|
|
58c193f |
{
|
|
|
58c193f |
boost::dag_shortest_paths(graph, v,
|
|
|
58c193f |
// we provide a constant weight of 1
|
|
|
58c193f |
- weight_map(boost::ref_property_map<edge_t,int>(weight)).
|
|
|
58c193f |
+ weight_map(boost::ref_property_map<typename boost::graph_traits<GraphType>::edge_descriptor,int>(weight)).
|
|
|
58c193f |
// Store distance and predecessors in QMaps, wrapped to serve as property maps
|
|
|
58c193f |
distance_map(VertexIntMapAdaptor(distances)).
|
|
|
58c193f |
predecessor_map(VertexVertexMapAdaptor(predecessors))
|
|
|
3a14799 |
@@ -1218,7 +1218,7 @@ protected:
|
|
|
58c193f |
{
|
|
|
58c193f |
boost::dag_shortest_paths(graph, v,
|
|
|
58c193f |
// we provide a constant weight of 1
|
|
|
58c193f |
- weight_map(boost::ref_property_map<edge_t,int>(weight)).
|
|
|
58c193f |
+ weight_map(boost::ref_property_map<typename boost::graph_traits<GraphType>::edge_descriptor,int>(weight)).
|
|
|
58c193f |
// Invert the default compare method: With greater, we get the longest path
|
|
|
58c193f |
distance_compare(std::greater<int>()).
|
|
|
58c193f |
// will be returned if a node is unreachable
|
|
|
3a14799 |
@@ -1384,14 +1384,15 @@ protected:
|
|
|
3a14799 |
template <class GraphType, typename VertexLessThan>
|
|
|
3a14799 |
class lessThanMapEdgeToTarget
|
|
|
3a14799 |
{
|
|
|
3a14799 |
+ typedef typename boost::graph_traits<GraphType>::edge_descriptor edge_descriptor;
|
|
|
3a14799 |
public:
|
|
|
3a14799 |
lessThanMapEdgeToTarget(const GraphType& g, VertexLessThan vertexLessThan)
|
|
|
58c193f |
: g(g), vertexLessThan(vertexLessThan) {}
|
|
|
58c193f |
const GraphType& g;
|
|
|
58c193f |
VertexLessThan vertexLessThan;
|
|
|
58c193f |
- bool operator()(const Edge& a, const Edge& b)
|
|
|
3a14799 |
+ bool operator()(const edge_descriptor& a, const edge_descriptor& b)
|
|
|
58c193f |
{
|
|
|
58c193f |
- return vertexLessThan(boost::target(a.toEdge(), g), boost::target(b.toEdge(), g));
|
|
|
58c193f |
+ return vertexLessThan(boost::target(a, g), boost::target(b, g));
|
|
|
58c193f |
}
|
|
|
58c193f |
};
|
|
|
58c193f |
|
|
|
3a14799 |
@@ -1402,20 +1403,21 @@ protected:
|
|
|
58c193f |
{
|
|
|
58c193f |
typedef std::pair<Vertex, QList<Edge> > VertexInfo;
|
|
|
58c193f |
|
|
|
58c193f |
- QList<Edge> outEdges;
|
|
|
3a14799 |
+ typedef typename boost::graph_traits<IncidenceGraph>::edge_descriptor edge_descriptor;
|
|
|
3a14799 |
+ QList<edge_descriptor> outEdges;
|
|
|
58c193f |
std::vector<VertexInfo> stack;
|
|
|
58c193f |
|
|
|
58c193f |
boost::put(color, u, boost::gray_color);
|
|
|
58c193f |
vis.discover_vertex(u, g);
|
|
|
58c193f |
|
|
|
58c193f |
- outEdges = toEdgeList(boost::out_edges(u, g));
|
|
|
3a14799 |
+ outEdges = toList<edge_descriptor>(boost::out_edges(u, g));
|
|
|
58c193f |
// Sort edges. The lessThan we have takes vertices, so we use a lessThan which
|
|
|
58c193f |
// maps the given edges to their targets, and calls our vertex lessThan.
|
|
|
58c193f |
qSort(outEdges.begin(), outEdges.end(), lessThanMapEdgeToTarget<IncidenceGraph, LessThan>(g, lessThan));
|
|
|
58c193f |
|
|
|
58c193f |
- foreach(const Edge& e, outEdges)
|
|
|
3a14799 |
+ foreach(const edge_descriptor& e, outEdges)
|
|
|
58c193f |
{
|
|
|
58c193f |
- Vertex v = boost::target(e.toEdge(), g);
|
|
|
3a14799 |
+ Vertex v = boost::target(e, g);
|
|
|
58c193f |
vis.examine_edge(e, g);
|
|
|
58c193f |
boost::default_color_type v_color = boost::get(color, v);
|
|
|
58c193f |
if (v_color == boost::white_color)
|
|
|
3a14799 |
|