Remoto - VFS: VFS_applications.cpp Source File
Remoto - VFS
VFS_applications.cpp
Go to the documentation of this file.
1 
2 #include "VFS_applications.h"
3 #include "utilities/rutils.h"
4 
18 , _name(name)
19 {
20 }
21 
22 
24 {
25 }
26 
28 {
29  if (r->_path=="")
30  {
32 
33  if (r->_success)
34  {
35  QJsonObject a;
36  a["type"] = "openLayout";
37  //a["options"] = o;
38 
39  r->_metadata["action"] = a;
40 
41  QJsonObject l = rutils::jsonResource(":/VFS_applications/VFS_applicationsLayout.json");
42  l["icon"] = "@icon@";
43  QJsonObject t;
44  t["openLayout"] = l;
45 
46  r->_metadata["template"] = t;
47  r->_metadata["where"] = "nearest";
48 
49  QJsonObject c;
50  c["applicationName"] = _name;
51  //c["contextsDir"] = _contextsPath;
52  //c["contextsDir"] = "@sourcepath@/@sourcefile@/contexts";
53 
54  r->_metadata["context"] = c;
55  }
56 
57  return;
58  }
59 
60  r->_reason = QString("%1::metadata bad path: %2").arg(className()).arg(r->_path);
61  r->_success = false;
62 }
A common base class for all things that want to act like an application or include ACL support.
virtual void metadata(VFS_request *r)
Fetch the metadata of this node.
Q_INVOKABLE VFS_applications(QString name="Applications")
Construct a VFS_applications object.
virtual ~VFS_applications()
QString _name
The name of this applications group. This is returned as an 'applicationName' metadata entry.
virtual void metadata(VFS_request *r)
Fetch the metadata of this node.
Definition: VFS_node.cpp:797
QString className()
Return the class name of a node.
Definition: VFS_node.cpp:2039
The base class for all requests between nodes.
Definition: VFS_node.h:54
QString _reason
if something (probably bad) happened, this is the reason
Definition: VFS_node.h:108
QString _path
the target path remnant... the remaining path element once the request has found its target
Definition: VFS_node.h:95
bool _success
if the request was successfully completed
Definition: VFS_node.h:107
QJsonObject _metadata
the request payload
Definition: VFS_node.h:101
setter name
a setter DOCME
QJsonObject jsonResource(QString resource, bool *ok=nullptr)
Fetch the contents of a Qt resource as a QJsonObject.
Definition: rutils.cpp:90