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:
@@ -67,6 +67,7 @@ class BAppFileInfo: public BNodeInfo {
|
|||||||
|
|
||||||
status_t GetAppFlags(uint32 *flags) const;
|
status_t GetAppFlags(uint32 *flags) const;
|
||||||
status_t SetAppFlags(uint32 flags);
|
status_t SetAppFlags(uint32 flags);
|
||||||
|
status_t RemoveAppFlags();
|
||||||
|
|
||||||
status_t GetSupportedTypes(BMessage *types) const;
|
status_t GetSupportedTypes(BMessage *types) const;
|
||||||
status_t SetSupportedTypes(const BMessage *types, bool syncAll);
|
status_t SetSupportedTypes(const BMessage *types, bool syncAll);
|
||||||
|
|||||||
@@ -379,10 +379,29 @@ BAppFileInfo::SetAppFlags(uint32 flags)
|
|||||||
error = B_NO_INIT;
|
error = B_NO_INIT;
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
// write the data
|
// write the data
|
||||||
if (error == B_OK) {
|
error = _WriteData(kAppFlagsAttribute, kAppFlagsResourceID,
|
||||||
error = _WriteData(kAppFlagsAttribute, kAppFlagsResourceID,
|
B_APP_FLAGS_TYPE, &flags, sizeof(uint32));
|
||||||
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;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user