mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-04 05:50:15 +00:00
Simplify App::isPortable() to avoid using ResourceFinder
This commit is contained in:
parent
62c5bdbb8f
commit
a9081695e5
@ -62,6 +62,8 @@
|
|||||||
#include "app/util/render.h"
|
#include "app/util/render.h"
|
||||||
#include "app/webserver.h"
|
#include "app/webserver.h"
|
||||||
#include "base/exception.h"
|
#include "base/exception.h"
|
||||||
|
#include "base/fs.h"
|
||||||
|
#include "base/path.h"
|
||||||
#include "base/unique_ptr.h"
|
#include "base/unique_ptr.h"
|
||||||
#include "doc/document_observer.h"
|
#include "doc/document_observer.h"
|
||||||
#include "raster/image.h"
|
#include "raster/image.h"
|
||||||
@ -335,10 +337,15 @@ App::~App()
|
|||||||
|
|
||||||
bool App::isPortable()
|
bool App::isPortable()
|
||||||
{
|
{
|
||||||
std::string ini_file = get_config_file();
|
static bool* is_portable = NULL;
|
||||||
app::ResourceFinder rf;
|
if (!is_portable) {
|
||||||
rf.includeBinDir("aseprite.ini");
|
is_portable =
|
||||||
return (ini_file == rf.defaultFilename());
|
new bool(
|
||||||
|
base::is_file(base::join_path(
|
||||||
|
base::get_file_path(base::get_app_path()),
|
||||||
|
"aseprite.ini")));
|
||||||
|
}
|
||||||
|
return *is_portable;
|
||||||
}
|
}
|
||||||
|
|
||||||
tools::ToolBox* App::getToolBox() const
|
tools::ToolBox* App::getToolBox() const
|
||||||
|
Loading…
Reference in New Issue
Block a user