Changed WriteStyledEditFile to be able to write plain text files on volumes that don't support attributes. Contributed by Andrew Bachmann
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5904 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -721,6 +721,19 @@ BTranslationUtils::WriteStyledEditFile(BTextView *fromView, BFile *intoFile)
|
||||
result = intoFile->SetSize(textLength);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
// get the BVolume that this file is on and
|
||||
// check the volume for the attribute support
|
||||
node_ref nref;
|
||||
result = intoFile->GetNodeRef(&nref);
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
BVolume volume(nref.device);
|
||||
result = volume.InitCheck();
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
if (!volume.KnowsAttr())
|
||||
return B_OK;
|
||||
|
||||
// Write attributes
|
||||
// BEOS:TYPE
|
||||
|
||||
Reference in New Issue
Block a user