summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorLuciano Iam <lucianito@gmail.com>2020-04-11 09:58:42 +0200
committerRobin Gareus <robin@gareus.org>2020-04-11 22:30:41 +0200
commit9aef43181855256b7b6690aa2422769198c3aecf (patch)
treed6ea7b259b79074f870c4c31327fe2db058251bb /libs
parentad363d12a2b38f491011dcd6cd4adcf277089867 (diff)
WebSockets: move diskPath property to surfaces group object
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/websockets/manifest.cc3
-rw-r--r--libs/surfaces/websockets/resources.cc18
2 files changed, 15 insertions, 6 deletions
diff --git a/libs/surfaces/websockets/manifest.cc b/libs/surfaces/websockets/manifest.cc
index 3279f408b0..85407a231d 100644
--- a/libs/surfaces/websockets/manifest.cc
+++ b/libs/surfaces/websockets/manifest.cc
@@ -73,8 +73,7 @@ SurfaceManifest::to_json ()
std::stringstream ss;
ss << "{"
- << "\"diskPath\":\"" << _path << "\""
- << ",\"path\":\"" << Glib::path_get_basename (_path) << "\""
+ << "\"path\":\"" << Glib::path_get_basename (_path) << "\""
<< ",\"name\":\"" << _name << "\""
<< ",\"description\":\"" << _description << "\""
<< "}";
diff --git a/libs/surfaces/websockets/resources.cc b/libs/surfaces/websockets/resources.cc
index 428128638a..67fc12017f 100644
--- a/libs/surfaces/websockets/resources.cc
+++ b/libs/surfaces/websockets/resources.cc
@@ -80,9 +80,14 @@ ServerResources::scan ()
{
std::stringstream ss;
- ss << "[{\"path\":\"" << builtin_dir_name << "\",\"surfaces\":[";
+ std::string builtin_dir_str = builtin_dir ();
+ SurfaceManifestVector builtin = read_manifests (builtin_dir_str);
- SurfaceManifestVector builtin = read_manifests (builtin_dir ());
+ ss << "[{"
+ << "\"diskPath\":\"" << builtin_dir_str << "\""
+ << ",\"path\":\"" << builtin_dir_name << "\""
+ << ",\"surfaces\":"
+ << "[";
for (SurfaceManifestVector::iterator it = builtin.begin (); it != builtin.end (); ) {
ss << it->to_json ();
@@ -91,9 +96,14 @@ ServerResources::scan ()
}
}
- ss << "]},{\"path\":\"" << user_dir_name << "\",\"surfaces\":[";
+ std::string user_dir_str = user_dir ();
+ SurfaceManifestVector user = read_manifests (user_dir_str);
- SurfaceManifestVector user = read_manifests (user_dir ());
+ ss << "]},{"
+ << "\"diskPath\":\"" << user_dir_str << "\""
+ << ",\"path\":\"" << user_dir_name << "\""
+ << ",\"surfaces\":"
+ << "[";
for (SurfaceManifestVector::iterator it = user.begin (); it != user.end (); ) {
ss << it->to_json ();