本文整理汇总了C++中TrackerSettings::AskBeforeDeleteFile方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackerSettings::AskBeforeDeleteFile方法的具体用法?C++ TrackerSettings::AskBeforeDeleteFile怎么用?C++ TrackerSettings::AskBeforeDeleteFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackerSettings
的用法示例。
在下文中一共展示了TrackerSettings::AskBeforeDeleteFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TrashSettingsView::RecordRevertSettings()
{
TrackerSettings settings;
fDontMoveFilesToTrash = settings.DontMoveFilesToTrash();
fAskBeforeDeleteFile = settings.AskBeforeDeleteFile();
}
示例2: _SCRIPTING_ONLY
bool
BPoseView::DeleteProperty(BMessage *_SCRIPTING_ONLY(specifier),
int32 _SCRIPTING_ONLY(form), const char *_SCRIPTING_ONLY(property),
BMessage *_SCRIPTING_ONLY(reply))
{
#if _SUPPORTS_FEATURE_SCRIPTING
status_t error = B_OK;
bool handled = false;
if (strcmp(property, kPropertySelection) == 0) {
// deleting on a selection is handled as removing a part of the selection
// not to be confused with deleting a selected item
if (form == (int32)B_ENTRY_SPECIFIER) {
entry_ref ref;
// select poses specified by entries
for (int32 index = 0; specifier->FindRef("refs", index, &ref)
== B_OK; index++) {
int32 poseIndex;
BPose *pose = FindPose(&ref, form, &poseIndex);
if (!pose) {
error = B_ENTRY_NOT_FOUND;
break;
}
RemovePoseFromSelection(pose);
}
handled = true;
} else if (form == B_INDEX_SPECIFIER) {
// move all poses specified by index to Trash
int32 specifyingIndex;
for (int32 index = 0; specifier->FindInt32("index", index,
&specifyingIndex) == B_OK; index++) {
BPose *pose = PoseAtIndex(specifyingIndex);
if (!pose) {
error = B_BAD_INDEX;
break;
}
RemovePoseFromSelection(pose);
}
handled = true;
} else
return false;
} else if (strcmp(property, kPropertyEntry) == 0) {
// deleting entries is handled by moving entries to trash
// build a list of entries, specified by the specifier
BObjectList<entry_ref> *entryList = new BObjectList<entry_ref>();
// list will be deleted for us by the trashing thread
if (form == (int32)B_ENTRY_SPECIFIER) {
// move all poses specified by entry_ref to Trash
entry_ref ref;
for (int32 index = 0; specifier->FindRef("refs", index, &ref)
== B_OK; index++)
entryList->AddItem(new entry_ref(ref));
} else if (form == (int32)B_INDEX_SPECIFIER) {
// move all poses specified by index to Trash
int32 specifyingIndex;
for (int32 index = 0; specifier->FindInt32("index", index, &specifyingIndex)
== B_OK; index++) {
BPose *pose = PoseAtIndex(specifyingIndex);
if (!pose) {
error = B_BAD_INDEX;
break;
}
entryList->AddItem(new entry_ref(*pose->TargetModel()->EntryRef()));
}
} else
return false;
if (error == B_OK) {
TrackerSettings settings;
if (!settings.DontMoveFilesToTrash()) {
// move the list we build into trash, don't make the trashing task
// select the next item
MoveListToTrash(entryList, false, false);
} else
Delete(entryList, false, settings.AskBeforeDeleteFile());
}
handled = true;
}
if (error != B_OK)
reply->AddInt32("error", error);
return handled;
#else
return false;
#endif
//.........这里部分代码省略.........