Added a way to remove the application flags from the BAppFileInfo. The

flags would not tell anything, since B_SINGLE_LAUNCH equals 0.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29636 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-03-21 21:16:23 +00:00
parent be07036291
commit 22920adf3e
2 changed files with 24 additions and 4 deletions

View File

@ -67,6 +67,7 @@ class BAppFileInfo: public BNodeInfo {
status_t GetAppFlags(uint32 *flags) const;
status_t SetAppFlags(uint32 flags);
status_t RemoveAppFlags();
status_t GetSupportedTypes(BMessage *types) const;
status_t SetSupportedTypes(const BMessage *types, bool syncAll);

View File

@ -379,10 +379,29 @@ BAppFileInfo::SetAppFlags(uint32 flags)
error = B_NO_INIT;
if (error == B_OK) {
// write the data
if (error == B_OK) {
error = _WriteData(kAppFlagsAttribute, kAppFlagsResourceID,
B_APP_FLAGS_TYPE, &flags, sizeof(uint32));
}
error = _WriteData(kAppFlagsAttribute, kAppFlagsResourceID,
B_APP_FLAGS_TYPE, &flags, sizeof(uint32));
}
return error;
}
// RemoveAppFlags
/*! \brief Removes the file's application flags.
\return
- \c B_OK: Everything went fine.
- \c B_NO_INIT: The object is not properly initialized.
- other error codes
*/
status_t
BAppFileInfo::RemoveAppFlags()
{
// check initialization
status_t error = B_OK;
if (error == B_OK && InitCheck() != B_OK)
error = B_NO_INIT;
if (error == B_OK) {
// remove the data
error = _RemoveData(kAppFlagsAttribute, B_APP_FLAGS_TYPE);
}
return error;
}