Tracker: style fixes to VirtualDirectoryManager

This commit is contained in:
John Scipione
2014-06-20 21:30:05 -04:00
parent 09d0d8f9dc
commit d8d0539a08
2 changed files with 17 additions and 16 deletions
+13 -10
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2013, Haiku, Inc. * Copyright 2013 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -29,13 +29,12 @@
namespace BPrivate { namespace BPrivate {
static const size_t kMaxVirtualDirectoryFileSize = 10 * 1024; static const size_t kMaxVirtualDirectoryFileSize = 10 * 1024;
static const char* const kTemporaryDefinitionFileBaseDirectoryPath static const char* const kTemporaryDefinitionFileBaseDirectoryPath
= "/tmp/tracker/virtual-directories"; = "/tmp/tracker/virtual-directories";
// #pragma mark - Info // #pragma mark - VirtualDirectoryManager::Info
class VirtualDirectoryManager::Info { class VirtualDirectoryManager::Info {
@@ -170,7 +169,7 @@ private:
}; };
// #pragma mark - RootInfo // #pragma mark - VirtualDirectoryManager::RootInfo
class VirtualDirectoryManager::RootInfo { class VirtualDirectoryManager::RootInfo {
@@ -430,15 +429,16 @@ VirtualDirectoryManager::TranslateDirectoryEntry(
NotOwningEntryRef entryRef(buffer->d_pdev, buffer->d_pino, buffer->d_name); NotOwningEntryRef entryRef(buffer->d_pdev, buffer->d_pino, buffer->d_name);
node_ref nodeRef(buffer->d_dev, buffer->d_ino); node_ref nodeRef(buffer->d_dev, buffer->d_ino);
status_t error = TranslateDirectoryEntry(definitionFileRef, entryRef, status_t result = TranslateDirectoryEntry(definitionFileRef, entryRef,
nodeRef); nodeRef);
if (error != B_OK) if (result != B_OK)
return error; return result;
buffer->d_pdev = entryRef.device; buffer->d_pdev = entryRef.device;
buffer->d_pino = entryRef.directory; buffer->d_pino = entryRef.directory;
buffer->d_dev = nodeRef.device; buffer->d_dev = nodeRef.device;
buffer->d_ino = nodeRef.node; buffer->d_ino = nodeRef.node;
return B_OK; return B_OK;
} }
@@ -534,6 +534,7 @@ VirtualDirectoryManager::TranslateDirectoryEntry(
_nodeRef = info->DefinitionFileNodeRef(); _nodeRef = info->DefinitionFileNodeRef();
_entryRef.device = entryRef.device; _entryRef.device = entryRef.device;
_entryRef.directory = entryRef.directory; _entryRef.directory = entryRef.directory;
return B_OK; return B_OK;
} }
@@ -630,8 +631,8 @@ void
VirtualDirectoryManager::_UpdateTree(RootInfo* root) VirtualDirectoryManager::_UpdateTree(RootInfo* root)
{ {
bool changed = false; bool changed = false;
status_t error = root->ReadDefinition(&changed); status_t result = root->ReadDefinition(&changed);
if (error != B_OK) { if (result != B_OK) {
DirectoryRemoved(root->Info()->DefinitionFileNodeRef()); DirectoryRemoved(root->Info()->DefinitionFileNodeRef());
return; return;
} }
@@ -758,6 +759,7 @@ VirtualDirectoryManager::_ResolveUnknownDefinitionFile(
} }
_info = info; _info = info;
return B_OK; return B_OK;
} }
@@ -783,6 +785,7 @@ VirtualDirectoryManager::_CreateRootInfo(const node_ref& definitionFileNodeRef,
rootDeleter.Detach(); rootDeleter.Detach();
_info = root->Info(); _info = root->Info();
return B_OK; return B_OK;
} }
@@ -813,9 +816,9 @@ VirtualDirectoryManager::_ReadSubDirectoryDefinitionFileInfo(
_rootDefinitionFileEntryRef = entry_ref(device, directory, name); _rootDefinitionFileEntryRef = entry_ref(device, directory, name);
_subDirPath = subDirPath; _subDirPath = subDirPath;
return !_subDirPath.IsEmpty() && _rootDefinitionFileEntryRef.name != NULL return !_subDirPath.IsEmpty() && _rootDefinitionFileEntryRef.name != NULL
? B_OK : B_NO_MEMORY; ? B_OK : B_NO_MEMORY;
} }
} // namespace BPrivate } // namespace BPrivate
+4 -6
View File
@@ -1,12 +1,12 @@
/* /*
* Copyright 2013, Haiku, Inc. * Copyright 2013 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Ingo Weinhold, [email protected] * Ingo Weinhold, [email protected]
*/ */
#ifndef VIRTUAL_DIRECTORY_MANAGER_H #ifndef _VIRTUAL_DIRECTORY_MANAGER_H
#define VIRTUAL_DIRECTORY_MANAGER_H #define _VIRTUAL_DIRECTORY_MANAGER_H
#include <dirent.h> #include <dirent.h>
@@ -22,7 +22,6 @@ class BStringList;
namespace BPrivate { namespace BPrivate {
class Model; class Model;
@@ -110,8 +109,7 @@ private:
NodeRefInfoMap fInfos; NodeRefInfoMap fInfos;
}; };
} // namespace BPrivate } // namespace BPrivate
#endif // VIRTUAL_DIRECTORY_MANAGER_H #endif // _VIRTUAL_DIRECTORY_MANAGER_H