Now only replaces the directory's name with the volume name for root directories for the window title.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10474 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-12-16 02:45:44 +00:00
parent d8e0549fd4
commit 87f158f3f5

View File

@ -1,7 +1,7 @@
/*
** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
*/
/*
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#include "FileWindow.h"
@ -13,6 +13,7 @@
#include <MenuBar.h>
#include <MenuItem.h>
#include <Path.h>
#include <Directory.h>
#include <Volume.h>
#include <be_apps/Tracker/RecentItems.h>
@ -28,11 +29,15 @@ FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
BPath path(ref);
SetTitle(path.Path());
} else if (entry.IsDirectory()) {
BVolume volume(stat.st_dev);
if (volume.InitCheck() == B_OK) {
char name[B_FILE_NAME_LENGTH];
if (volume.GetName(name) == B_OK)
SetTitle(name);
BDirectory directory(&entry);
if (directory.InitCheck() == B_OK && directory.IsRootDirectory()) {
// use the volume name for root directories
BVolume volume(stat.st_dev);
if (volume.InitCheck() == B_OK) {
char name[B_FILE_NAME_LENGTH];
if (volume.GetName(name) == B_OK)
SetTitle(name);
}
}
}