mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Fix extensions wrongly being detected as "built-in" (#4625)
This commit is contained in:
parent
5798e27993
commit
d62d279a34
@ -391,9 +391,8 @@ void AppMenus::reload()
|
|||||||
#ifdef ENABLE_SCRIPTING
|
#ifdef ENABLE_SCRIPTING
|
||||||
// Load scripts
|
// Load scripts
|
||||||
ResourceFinder rf;
|
ResourceFinder rf;
|
||||||
rf.includeUserDir("scripts/.");
|
rf.includeUserDir("scripts");
|
||||||
std::string scriptsDir = rf.getFirstOrCreateDefault();
|
std::string scriptsDir = rf.getFirstOrCreateDefault();
|
||||||
scriptsDir = base::get_file_path(scriptsDir);
|
|
||||||
if (base::is_directory(scriptsDir)) {
|
if (base::is_directory(scriptsDir)) {
|
||||||
loadScriptsSubmenu(scriptsMenu->getSubmenu(), scriptsDir, true);
|
loadScriptsSubmenu(scriptsMenu->getSubmenu(), scriptsDir, true);
|
||||||
}
|
}
|
||||||
|
@ -794,7 +794,7 @@ Extensions::Extensions()
|
|||||||
// Create and get the user extensions directory
|
// Create and get the user extensions directory
|
||||||
{
|
{
|
||||||
ResourceFinder rf2;
|
ResourceFinder rf2;
|
||||||
rf2.includeUserDir("extensions/.");
|
rf2.includeUserDir("extensions");
|
||||||
m_userExtensionsPath = rf2.getFirstOrCreateDefault();
|
m_userExtensionsPath = rf2.getFirstOrCreateDefault();
|
||||||
m_userExtensionsPath = base::normalize_path(m_userExtensionsPath);
|
m_userExtensionsPath = base::normalize_path(m_userExtensionsPath);
|
||||||
if (!m_userExtensionsPath.empty() &&
|
if (!m_userExtensionsPath.empty() &&
|
||||||
@ -811,10 +811,12 @@ Extensions::Extensions()
|
|||||||
// Load extensions from data/ directory on all possible locations
|
// Load extensions from data/ directory on all possible locations
|
||||||
// (installed folder and user folder)
|
// (installed folder and user folder)
|
||||||
while (rf.next()) {
|
while (rf.next()) {
|
||||||
auto extensionsDir = rf.filename();
|
const auto& extensionsDir = rf.filename();
|
||||||
|
|
||||||
if (base::is_directory(extensionsDir)) {
|
if (!base::is_directory(extensionsDir))
|
||||||
for (auto fn : base::list_files(extensionsDir)) {
|
continue;
|
||||||
|
|
||||||
|
for (auto& fn : base::list_files(extensionsDir)) {
|
||||||
const auto dir = base::join_path(extensionsDir, fn);
|
const auto dir = base::join_path(extensionsDir, fn);
|
||||||
if (!base::is_directory(dir))
|
if (!base::is_directory(dir))
|
||||||
continue;
|
continue;
|
||||||
@ -840,7 +842,6 @@ Extensions::Extensions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Extensions::~Extensions()
|
Extensions::~Extensions()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user