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