mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Cache user.aseprite-brushes path
This commit is contained in:
parent
70e2abaf69
commit
5b3600e261
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2020 Igara Studio S.A.
|
||||
// Copyright (C) 2020-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -180,7 +180,7 @@ AppBrushes::AppBrushes()
|
||||
m_standard.push_back(BrushRef(new Brush(kLineBrushType, 7, 44)));
|
||||
|
||||
try {
|
||||
std::string fn = userBrushesFilename();
|
||||
std::string fn = m_userBrushesFilename = userBrushesFilename();
|
||||
if (base::is_file(fn))
|
||||
load(fn);
|
||||
}
|
||||
@ -191,7 +191,8 @@ AppBrushes::AppBrushes()
|
||||
|
||||
AppBrushes::~AppBrushes()
|
||||
{
|
||||
save(userBrushesFilename());
|
||||
if (!m_userBrushesFilename.empty())
|
||||
save(m_userBrushesFilename);
|
||||
}
|
||||
|
||||
AppBrushes::slot_id AppBrushes::addBrushSlot(const BrushSlot& brush)
|
||||
|
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -12,6 +13,7 @@
|
||||
#include "doc/brushes.h"
|
||||
#include "obs/signal.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace app {
|
||||
@ -49,6 +51,7 @@ namespace app {
|
||||
|
||||
doc::Brushes m_standard;
|
||||
BrushSlots m_slots;
|
||||
std::string m_userBrushesFilename;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
Loading…
x
Reference in New Issue
Block a user