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:
@@ -722,6 +722,19 @@ BTranslationUtils::WriteStyledEditFile(BTextView *fromView, BFile *intoFile)
|
|||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
return result;
|
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
|
// Write attributes
|
||||||
// BEOS:TYPE
|
// BEOS:TYPE
|
||||||
// (this is so that the BeOS will recognize this file as a text file)
|
// (this is so that the BeOS will recognize this file as a text file)
|
||||||
|
|||||||
Reference in New Issue
Block a user