本文整理汇总了C++中Model::GetEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::GetEntry方法的具体用法?C++ Model::GetEntry怎么用?C++ Model::GetEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::GetEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateMessage
uint32
FSClipboardAddPoses(const node_ref *directory, PoseList *list, uint32 moveMode,
bool clearClipboard)
{
uint32 refsAdded = 0;
int32 listCount = list->CountItems();
if (listCount == 0 || !be_clipboard->Lock())
return 0;
// update message to be send to all listeners
BMessage updateMessage(kFSClipboardChanges);
updateMessage.AddInt32("device", directory->device);
updateMessage.AddInt64("directory", directory->node);
updateMessage.AddBool("clearClipboard", clearClipboard);
TClipboardNodeRef clipNode;
clipNode.moveMode = moveMode;
if (clearClipboard)
be_clipboard->Clear();
BMessage *clip = be_clipboard->Data();
if (clip != NULL) {
for (int32 index = 0; index < listCount; index++) {
char refName[64], modeName[64];
BPose *pose = (BPose *)list->ItemAt(index);
Model *model = pose->TargetModel();
const node_ref *node = model->NodeRef();
BEntry entry;
model->GetEntry(&entry);
if (model->IsVolume()
|| model->IsRoot()
|| FSIsTrashDir(&entry)
|| FSIsDeskDir(&entry))
continue;
MakeRefName(refName, node);
MakeModeNameFromRefName(modeName, refName);
if (clearClipboard) {
if (clip->AddInt32(modeName, (int32)moveMode) == B_OK)
if (clip->AddRef(refName, model->EntryRef()) == B_OK) {
pose->SetClipboardMode(moveMode);
clipNode.node = *node;
updateMessage.AddData("tcnode", T_CLIPBOARD_NODE, &clipNode,
sizeof(TClipboardNodeRef), true, listCount);
refsAdded++;
} else
clip->RemoveName(modeName);
} else {
if (clip->ReplaceInt32(modeName, (int32)moveMode) == B_OK) {
// replace old mode if entry already exists in clipboard
if (clip->ReplaceRef(refName, model->EntryRef()) == B_OK) {
pose->SetClipboardMode(moveMode);
clipNode.node = *node;
updateMessage.AddData("tcnode", T_CLIPBOARD_NODE, &clipNode,
sizeof(TClipboardNodeRef), true, listCount);
refsAdded++;
} else {
clip->RemoveName(modeName);
clipNode.node = *node;
clipNode.moveMode = kDelete; // note removing node
updateMessage.AddData("tcnode", T_CLIPBOARD_NODE, &clipNode,
sizeof(TClipboardNodeRef), true, listCount);
clipNode.moveMode = moveMode; // set it back to current value
}
} else {
// add it if it doesn't exist
if (clip->AddRef(refName, model->EntryRef()) == B_OK
&& clip->AddInt32(modeName, (int32)moveMode) == B_OK) {
pose->SetClipboardMode(moveMode);
clipNode.node = *node;
updateMessage.AddData("tcnode", T_CLIPBOARD_NODE, &clipNode,
sizeof(TClipboardNodeRef), true, listCount);
refsAdded++;
} else {
clip->RemoveName(modeName);
clip->RemoveName(refName);
// here notifying delete isn't needed as node didn't
// exist in clipboard
}
}
}
}
be_clipboard->Commit();
}
be_clipboard->Unlock();
BMessenger(kTrackerSignature).SendMessage(&updateMessage);
// Tracker will notify all listeners
//.........这里部分代码省略.........