Simplify App::isPortable() to avoid using ResourceFinder

This commit is contained in:
David Capello 2014-08-24 00:09:01 -03:00
parent 62c5bdbb8f
commit a9081695e5

View File

@ -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