Now uses DataEditor::AttributeRef() where appropriate.
The definition of BEOS_R5_COMPATIBLE is no longer necessary, due to improvements to our build system. For root directories, the attributes are now taken from that directory; previously, only the device was tested for attributes (which doesn't have any in BeOS). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10483 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,16 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ProbeView.h"
|
#include "ProbeView.h"
|
||||||
#include "DataView.h"
|
#include "DataView.h"
|
||||||
#include "DiskProbe.h"
|
#include "DiskProbe.h"
|
||||||
|
|
||||||
#define BEOS_R5_COMPATIBLE
|
|
||||||
// for SetLimits()
|
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <Clipboard.h>
|
#include <Clipboard.h>
|
||||||
@@ -32,6 +29,7 @@
|
|||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <Node.h>
|
#include <Node.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
|
#include <Directory.h>
|
||||||
#include <Volume.h>
|
#include <Volume.h>
|
||||||
#include <fs_attr.h>
|
#include <fs_attr.h>
|
||||||
#include <PrintJob.h>
|
#include <PrintJob.h>
|
||||||
@@ -1143,7 +1141,7 @@ ProbeView::UpdateAttributesMenu(BMenu *menu)
|
|||||||
|
|
||||||
// add new items (sorted)
|
// add new items (sorted)
|
||||||
|
|
||||||
BNode node(&fEditor.Ref());
|
BNode node(&fEditor.AttributeRef());
|
||||||
if (node.InitCheck() == B_OK) {
|
if (node.InitCheck() == B_OK) {
|
||||||
char attribute[B_ATTR_NAME_LENGTH];
|
char attribute[B_ATTR_NAME_LENGTH];
|
||||||
node.RewindAttrs();
|
node.RewindAttrs();
|
||||||
@@ -1166,7 +1164,7 @@ ProbeView::UpdateAttributesMenu(BMenu *menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BMessage *message = new BMessage(B_REFS_RECEIVED);
|
BMessage *message = new BMessage(B_REFS_RECEIVED);
|
||||||
message->AddRef("refs", &fEditor.Ref());
|
message->AddRef("refs", &fEditor.AttributeRef());
|
||||||
message->AddString("attributes", attribute);
|
message->AddString("attributes", attribute);
|
||||||
|
|
||||||
menu->AddItem(new TypeMenuItem(attribute, type, message), i);
|
menu->AddItem(new TypeMenuItem(attribute, type, message), i);
|
||||||
@@ -1306,10 +1304,15 @@ ProbeView::AttachedToWindow()
|
|||||||
// "Attributes" menu (it's only visible if the underlying
|
// "Attributes" menu (it's only visible if the underlying
|
||||||
// file system actually supports attributes)
|
// file system actually supports attributes)
|
||||||
|
|
||||||
|
BDirectory directory;
|
||||||
BVolume volume;
|
BVolume volume;
|
||||||
|
if (directory.SetTo(&fEditor.AttributeRef()) == B_OK && directory.IsRootDirectory())
|
||||||
|
directory.GetVolume(&volume);
|
||||||
|
else
|
||||||
|
fEditor.File().GetVolume(&volume);
|
||||||
|
|
||||||
if (!fEditor.IsAttribute()
|
if (!fEditor.IsAttribute()
|
||||||
&& fEditor.File().GetVolume(&volume) == B_OK
|
&& volume.InitCheck() == B_OK && (volume.KnowsMime() || volume.KnowsAttr())) {
|
||||||
&& (volume.KnowsMime() || volume.KnowsAttr())) {
|
|
||||||
bar->AddItem(menu = new BMenu("Attributes"));
|
bar->AddItem(menu = new BMenu("Attributes"));
|
||||||
UpdateAttributesMenu(menu);
|
UpdateAttributesMenu(menu);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user