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)
38 add(QString::fromUtf8(path.data(), path.length()));
79 SCORE_CONCRETE(
"5231ea8b-da66-4c6f-9e34-d9a79cbc494a")
81 QSet<QString> acceptedFiles()
const noexcept override {
return {
"qml"}; }
83 static inline const QRegularExpression scoreImport{
"import Score [0-9].[0-9]"};
92 QModelIndex node = model.find(key);
93 if(node == QModelIndex{})
96 categories.init(node, ctx);
99 void addPath(std::string_view path)
override
101 QFileInfo file{QString::fromUtf8(path.data(), path.length())};
103 pdata.prettyName = file.completeBaseName();
105 pdata.customData = [&] {
106 QFile f(file.absoluteFilePath());
107 f.open(QIODevice::ReadOnly);
108 return f.readAll().trimmed();
112 auto matches = scoreImport.match(pdata.customData);
115 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