fix Asset::list_files
This commit is contained in:
@@ -74,7 +74,7 @@ void App::cloud_upload()
|
|||||||
void App::cloud_upload_all()
|
void App::cloud_upload_all()
|
||||||
{
|
{
|
||||||
std::thread([this] {
|
std::thread([this] {
|
||||||
auto names = Asset::list_files(data_path, false, ".*\\.ppi");
|
auto names = Asset::list_files(data_path, ".*\\.ppi");
|
||||||
|
|
||||||
gl_state gl;
|
gl_state gl;
|
||||||
std::shared_ptr<NodeProgressBar> pb;
|
std::shared_ptr<NodeProgressBar> pb;
|
||||||
|
|||||||
@@ -37,8 +37,9 @@ bool Asset::exist(std::string path)
|
|||||||
return false; // useless return for the stupid xcode
|
return false; // useless return for the stupid xcode
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> Asset::list_files(std::string folder, bool is_asset, const std::string& filter_regex)
|
std::vector<std::string> Asset::list_files(std::string folder, const std::string& filter_regex)
|
||||||
{
|
{
|
||||||
|
bool is_asset = Asset::is_asset(folder);
|
||||||
std::vector<std::string> names;
|
std::vector<std::string> names;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WIN32_FIND_DATAA fd;
|
WIN32_FIND_DATAA fd;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public:
|
|||||||
static AAssetManager* m_am;
|
static AAssetManager* m_am;
|
||||||
AAsset* m_asset = nullptr;
|
AAsset* m_asset = nullptr;
|
||||||
#endif
|
#endif
|
||||||
static std::vector<std::string> list_files(std::string folder, bool is_asset, const std::string& filter_regex);
|
static std::vector<std::string> list_files(std::string folder, const std::string& filter_regex);
|
||||||
static bool exist(std::string path);
|
static bool exist(std::string path);
|
||||||
static bool delete_file(const std::string& path);
|
static bool delete_file(const std::string& path);
|
||||||
static std::string absolute(const std::string& path);
|
static std::string absolute(const std::string& path);
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void NodeDialogBrowse::init_list()
|
|||||||
std::vector<std::tuple<std::string/*file-name*/, std::string/*path*/>> files;
|
std::vector<std::tuple<std::string/*file-name*/, std::string/*path*/>> files;
|
||||||
for (auto sp : search_paths)
|
for (auto sp : search_paths)
|
||||||
{
|
{
|
||||||
auto items = Asset::list_files(sp, false, ".*\\.ppi");
|
auto items = Asset::list_files(sp, ".*\\.ppi");
|
||||||
for (const auto& i : items)
|
for (const auto& i : items)
|
||||||
{
|
{
|
||||||
files.push_back({i, sp + '/' + i});
|
files.push_back({i, sp + '/' + i});
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ void NodeDialogOpen::init_controls()
|
|||||||
root()->update();
|
root()->update();
|
||||||
};
|
};
|
||||||
container = find<Node>("files-list");
|
container = find<Node>("files-list");
|
||||||
auto names = Asset::list_files(App::I.work_path, false, ".*\\.ppi");
|
auto names = Asset::list_files(App::I.work_path, ".*\\.ppi");
|
||||||
for (const auto& n : names)
|
for (const auto& n : names)
|
||||||
{
|
{
|
||||||
auto node = new NodeDialogOpenItem;
|
auto node = new NodeDialogOpenItem;
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ void NodePanelBrush::init()
|
|||||||
restore();
|
restore();
|
||||||
if (m_container->m_children.empty() && !m_dir_name.empty())
|
if (m_container->m_children.empty() && !m_dir_name.empty())
|
||||||
{
|
{
|
||||||
auto icons = Asset::list_files("data/" + m_dir_name, true, ".*\\.png$");
|
auto icons = Asset::list_files("data/" + m_dir_name, ".*\\.png$");
|
||||||
for (auto& i : icons)
|
for (auto& i : icons)
|
||||||
{
|
{
|
||||||
std::string path = "data/" + m_dir_name + "/thumbs/" + i;
|
std::string path = "data/" + m_dir_name + "/thumbs/" + i;
|
||||||
@@ -165,7 +165,7 @@ void NodePanelBrush::init()
|
|||||||
brush->on_click = std::bind(&NodePanelBrush::handle_click, this, std::placeholders::_1);
|
brush->on_click = std::bind(&NodePanelBrush::handle_click, this, std::placeholders::_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto custom_icons = Asset::list_files(App::I.data_path + "/" + m_dir_name, true, ".*\\.png$");
|
auto custom_icons = Asset::list_files(App::I.data_path + "/" + m_dir_name, ".*\\.png$");
|
||||||
for (auto& i : custom_icons)
|
for (auto& i : custom_icons)
|
||||||
{
|
{
|
||||||
std::string path_thumb = App::I.data_path + "/" + m_dir_name + "/thumbs/" + i;
|
std::string path_thumb = App::I.data_path + "/" + m_dir_name + "/thumbs/" + i;
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ void NodePanelStroke::init_controls()
|
|||||||
|
|
||||||
m_pattern_popup = std::make_shared<NodePanelBrush>();
|
m_pattern_popup = std::make_shared<NodePanelBrush>();
|
||||||
m_pattern_popup->m_manager = m_manager;
|
m_pattern_popup->m_manager = m_manager;
|
||||||
m_pattern_popup->m_dir_name = "textures";
|
m_pattern_popup->m_dir_name = "patterns";
|
||||||
m_pattern_popup->init();
|
m_pattern_popup->init();
|
||||||
m_pattern_popup->create();
|
m_pattern_popup->create();
|
||||||
m_pattern_popup->loaded();
|
m_pattern_popup->loaded();
|
||||||
|
|||||||
Reference in New Issue
Block a user