15 SCORE_CONCRETE(
"6e72e377-efdd-4e3c-9900-922b618e7d70")
20 QSet<QString> acceptedFiles()
const noexcept override {
return {
"mjs"}; }
22 bool add(
const QString& path)
25 if(!f.open(QIODevice::ReadOnly))
31 panel->importModule(path);
35 void addPath(std::string_view path)
override
37 if(path.find(
"companion-bundled-modules") != std::string_view::npos)
39 if(path.find(
"node_modules") != std::string_view::npos)
42 add(QString::fromUtf8(path.data(), path.length()));
83 SCORE_CONCRETE(
"5231ea8b-da66-4c6f-9e34-d9a79cbc494a")
85 QSet<QString> acceptedFiles()
const noexcept override {
return {
"qml"}; }
87 static inline const QRegularExpression scoreImport{
"import Score [0-9].[0-9]"};
96 QModelIndex node = model.find(key);
97 if(node == QModelIndex{})
100 categories.init(node, ctx);
103 void addPath(std::string_view path)
override
105 QFileInfo file{QString::fromUtf8(path.data(), path.length())};
107 pdata.prettyName = file.completeBaseName();
109 pdata.customData = [&] {
110 QFile f(file.absoluteFilePath());
111 f.open(QIODevice::ReadOnly);
112 return f.readAll().trimmed();
116 auto matches = scoreImport.match(pdata.customData);
119 categories.add(file, std::move(pdata));
Definition DocumentContext.hpp:18
Specializes ApplicationContext with the QMainWindow.
Definition GUIApplicationContext.hpp:15
T & panel() const
Access to a specific PanelDelegate.
Definition GUIApplicationContext.hpp:36