save brushes settings
This commit is contained in:
11
src/app.cpp
11
src/app.cpp
@@ -143,6 +143,10 @@ void App::initLog()
|
||||
{
|
||||
LOG("error creating thumbs path: %s", [[err localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
}
|
||||
if (![[NSFileManager defaultManager] createDirectoryAtPath:[docpath stringByAppendingString:@"/settings"] withIntermediateDirectories:YES attributes:nil error:&err])
|
||||
{
|
||||
LOG("error creating settings path: %s", [[err localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
}
|
||||
#elif defined(__OSX__)
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSPicturesDirectory, NSUserDomainMask, YES);
|
||||
NSString* docpath = [(NSString*)[paths objectAtIndex:0] stringByAppendingString:@"/PanoPainter"];
|
||||
@@ -170,6 +174,10 @@ void App::initLog()
|
||||
{
|
||||
LOG("error creating thumbs path: %s", [[err localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
}
|
||||
if (![[NSFileManager defaultManager] createDirectoryAtPath:[docpath stringByAppendingString:@"/settings"] withIntermediateDirectories:YES attributes:nil error:&err])
|
||||
{
|
||||
LOG("error creating settings path: %s", [[err localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
//CHAR my_documents[MAX_PATH];
|
||||
//HRESULT result = SHGetFolderPathA(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, my_documents);
|
||||
@@ -209,6 +217,9 @@ void App::initLog()
|
||||
|
||||
if (!PathFileExistsA((data_path + "\\brushes\\thumbs").c_str()))
|
||||
CreateDirectoryA((data_path + "\\brushes\\thumbs").c_str(), NULL);
|
||||
|
||||
if (!PathFileExistsA((data_path + "\\settings").c_str()))
|
||||
CreateDirectoryA((data_path + "\\settings").c_str(), NULL);
|
||||
#endif
|
||||
|
||||
// TODO: save this path somewhere in the settings, don't overwrite every start
|
||||
|
||||
Reference in New Issue
Block a user