2 * Copyright 2002-2010, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
11 #include "DataTranslationsSettings.h"
15 #include <Application.h>
17 #include <FindDirectory.h>
22 static DataTranslationsSettings sDataTranslationsSettings
;
25 DataTranslationsSettings::DataTranslationsSettings()
28 if (find_directory(B_USER_SETTINGS_DIRECTORY
, &path
) != B_OK
)
31 fCorner
= BPoint(-1, -1);
33 path
.Append("system/DataTranslations settings");
34 BFile
file(path
.Path(), B_READ_ONLY
);
37 if (file
.InitCheck() == B_OK
38 && settings
.Unflatten(&file
) == B_OK
) {
40 if (settings
.FindPoint("window corner", &corner
) == B_OK
)
46 DataTranslationsSettings::~DataTranslationsSettings()
49 if (find_directory(B_USER_SETTINGS_DIRECTORY
, &path
) < B_OK
)
53 settings
.AddPoint("window corner", fCorner
);
55 path
.Append("system/DataTranslations settings");
56 BFile
file(path
.Path(), B_WRITE_ONLY
| B_CREATE_FILE
| B_ERASE_FILE
);
57 if (file
.InitCheck() == B_OK
)
58 settings
.Flatten(&file
);
63 DataTranslationsSettings::SetWindowCorner(BPoint corner
)
69 DataTranslationsSettings
*
70 DataTranslationsSettings::Instance()
72 return &sDataTranslationsSettings
;