Tracker: Remove "launch broken link" cruft.

As the comment says, this was a pre-R5 (!) hack for Be's CIFS driver.
This commit is contained in:
Augustin Cavalier 2018-12-15 18:11:20 -05:00
parent a99aa113de
commit 707c912e12
5 changed files with 8 additions and 66 deletions

View File

@ -3759,15 +3759,6 @@ TrackerLaunch(const BMessage* refs, bool async, bool openWithOK)
return B_OK;
}
status_t
LaunchBrokenLink(const char* signature, const BMessage* refs)
{
// This call is to support a hacky workaround for double-clicking
// broken refs for cifs
be_roster->Launch(signature, const_cast<BMessage*>(refs));
return B_OK;
}
// external launch calls; need to be robust, work if Tracker is not running

View File

@ -249,7 +249,6 @@ status_t TrackerLaunch(const BMessage* refs, bool async,
bool okToRunOpenWith = true);
status_t TrackerLaunch(const entry_ref* appRef, const BMessage* refs,
bool async, bool okToRunOpenWith = true);
status_t LaunchBrokenLink(const char*, const BMessage*);
status_t FSFindTrackerSettingsDir(BPath*, bool autoCreate = true);

View File

@ -825,27 +825,6 @@ Model::SetLinkTo(Model* model)
}
void
Model::GetPreferredAppForBrokenSymLink(BString &result)
{
if (!IsSymLink() || LinkTo()) {
result = "";
return;
}
BModelOpener opener(this);
BNodeInfo info(fNode);
status_t error
= info.GetPreferredApp(result.LockBuffer(B_MIME_TYPE_LENGTH));
result.UnlockBuffer();
if (error != B_OK) {
// Tracker will have to do
result = kTrackerSignature;
}
}
// #pragma mark - Node monitor updating methods

View File

@ -126,11 +126,6 @@ public:
// only not-null if not default for type and not self for app
void SetPreferredAppSignature(const char*);
void GetPreferredAppForBrokenSymLink(BString &result);
// special purpose call - if a symlink is unresolvable, it makes
// sense to be able to get at it's preferred handler which may be
// different from the Tracker. Used by the network neighborhood.
// type getters
bool IsFile() const;
bool IsDirectory() const;

View File

@ -817,30 +817,15 @@ TTracker::OpenRef(const entry_ref* ref, const node_ref* nodeToClose,
BEntry entry(ref, true);
status_t result = entry.InitCheck();
bool brokenLinkWithSpecificHandler = false;
BString brokenLinkPreferredApp;
if (result != B_OK) {
model = new Model(ref, false);
if (model->IsSymLink() && !model->LinkTo()) {
model->GetPreferredAppForBrokenSymLink(brokenLinkPreferredApp);
if (brokenLinkPreferredApp.Length()
&& brokenLinkPreferredApp != kTrackerSignature) {
brokenLinkWithSpecificHandler = true;
}
}
BAlert* alert = new BAlert("",
B_TRANSLATE("There was an error resolving the link."),
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
if (!brokenLinkWithSpecificHandler) {
delete model;
BAlert* alert = new BAlert("",
B_TRANSLATE("There was an error resolving the link."),
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return result;
}
return result;
} else
model = new Model(&entry);
@ -896,14 +881,7 @@ TTracker::OpenRef(const entry_ref* ref, const node_ref* nodeToClose,
refsReceived.what = B_REFS_RECEIVED;
}
refsReceived.AddRef("refs", ref);
if (brokenLinkWithSpecificHandler) {
// This cruft is to support a hacky workaround for
// double-clicking broken refs for cifs; should get fixed
// in R5
LaunchBrokenLink(brokenLinkPreferredApp.String(),
&refsReceived);
} else
TrackerLaunch(&refsReceived, true);
TrackerLaunch(&refsReceived, true);
}
}