Since we now only have a single file to save, we no longer create a sub-directory
"HaikuTerminal" in the user settings directory, but just a file called either "Terminal" (for the Haiku build) or "HaikuTerminal" (for the R5 build). Last commit also made sure the settings target path existed - this is now no longer necessary, and thus, disabled. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13856 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -114,9 +114,12 @@ PrefHandler::GetDefaultPath(BPath& path)
|
|||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path, true) != B_OK)
|
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path, true) != B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
// TODO: maybe just "Terminal"? (but this collides with the R5 Terminal settings file)
|
#ifdef __HAIKU__
|
||||||
|
path.Append("Terminal");
|
||||||
|
#else
|
||||||
path.Append("HaikuTerminal");
|
path.Append("HaikuTerminal");
|
||||||
path.Append("settings");
|
#endif
|
||||||
|
//path.Append("settings");
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -148,9 +151,12 @@ status_t
|
|||||||
PrefHandler::Save(const char *path)
|
PrefHandler::Save(const char *path)
|
||||||
{
|
{
|
||||||
// make sure the target path exists
|
// make sure the target path exists
|
||||||
|
#if 0
|
||||||
|
// TODO: currently not needed as we're reusing the standard directory
|
||||||
BPath directoryPath(path);
|
BPath directoryPath(path);
|
||||||
if (directoryPath.GetParent(&directoryPath) == B_OK)
|
if (directoryPath.GetParent(&directoryPath) == B_OK)
|
||||||
create_directory(directoryPath.Path(), 0755);
|
create_directory(directoryPath.Path(), 0755);
|
||||||
|
#endif
|
||||||
|
|
||||||
BFile file(path, B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE);
|
BFile file(path, B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE);
|
||||||
return fContainer.Flatten(&file);
|
return fContainer.Flatten(&file);
|
||||||
@@ -162,9 +168,11 @@ PrefHandler::SaveAsText(const char *path, const char *mimetype,
|
|||||||
const char *signature)
|
const char *signature)
|
||||||
{
|
{
|
||||||
// make sure the target path exists
|
// make sure the target path exists
|
||||||
|
#if 0
|
||||||
BPath directoryPath(path);
|
BPath directoryPath(path);
|
||||||
if (directoryPath.GetParent(&directoryPath) == B_OK)
|
if (directoryPath.GetParent(&directoryPath) == B_OK)
|
||||||
create_directory(directoryPath.Path(), 0755);
|
create_directory(directoryPath.Path(), 0755);
|
||||||
|
#endif
|
||||||
|
|
||||||
BFile file(path, B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE);
|
BFile file(path, B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE);
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
|
|||||||
Reference in New Issue
Block a user