From 707c912e120bb029af351aa0f9da5861962a4b83 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 15 Dec 2018 18:11:20 -0500 Subject: [PATCH] Tracker: Remove "launch broken link" cruft. As the comment says, this was a pre-R5 (!) hack for Be's CIFS driver. --- src/kits/tracker/FSUtils.cpp | 9 --------- src/kits/tracker/FSUtils.h | 1 - src/kits/tracker/Model.cpp | 21 -------------------- src/kits/tracker/Model.h | 5 ----- src/kits/tracker/Tracker.cpp | 38 ++++++++---------------------------- 5 files changed, 8 insertions(+), 66 deletions(-) diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp index 23467f16b8..b2bd4c6933 100644 --- a/src/kits/tracker/FSUtils.cpp +++ b/src/kits/tracker/FSUtils.cpp @@ -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(refs)); - return B_OK; -} - // external launch calls; need to be robust, work if Tracker is not running diff --git a/src/kits/tracker/FSUtils.h b/src/kits/tracker/FSUtils.h index 5700d5bf1a..4a68a5e4ba 100644 --- a/src/kits/tracker/FSUtils.h +++ b/src/kits/tracker/FSUtils.h @@ -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); diff --git a/src/kits/tracker/Model.cpp b/src/kits/tracker/Model.cpp index c1db78ac75..ac96602860 100644 --- a/src/kits/tracker/Model.cpp +++ b/src/kits/tracker/Model.cpp @@ -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 diff --git a/src/kits/tracker/Model.h b/src/kits/tracker/Model.h index 380c3c7647..56a2196e39 100644 --- a/src/kits/tracker/Model.h +++ b/src/kits/tracker/Model.h @@ -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; diff --git a/src/kits/tracker/Tracker.cpp b/src/kits/tracker/Tracker.cpp index e5426cef32..93390c3186 100644 --- a/src/kits/tracker/Tracker.cpp +++ b/src/kits/tracker/Tracker.cpp @@ -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); } }