[Notifications] Restore fallback to local URL when no place is found

This got removed in d82513ce88 as I thought a user would
always have a "Root" entry, leading to "Root/foo" paths.

However, if you hide a place, it will naturally not be considered for `closestItem`
resulting in the final `QUrl::toDisplayString` being hit, giving us a not so
nice `file:///` URL.
wilder-5.22
Kai Uwe Broulik 5 years ago
parent 8dc93d1698
commit 5729da0ff0
  1. 6
      libnotificationmanager/job_p.cpp

@ -28,11 +28,11 @@
#include <KFilePlacesModel> #include <KFilePlacesModel>
#include <KService> #include <KService>
#include <KShell>
#include <KLocalizedString> #include <KLocalizedString>
#include <kio/global.h> #include <kio/global.h>
#include "jobviewv2adaptor.h" #include "jobviewv2adaptor.h"
#include "jobviewv3adaptor.h" #include "jobviewv3adaptor.h"
@ -121,6 +121,10 @@ QString JobPrivate::prettyDestUrl() const
return text; return text;
} }
if (url.isLocalFile()) {
return KShell::tildeCollapse(url.toLocalFile());
}
return url.toDisplayString(QUrl::RemoveUserInfo); return url.toDisplayString(QUrl::RemoveUserInfo);
} }

Loading…
Cancel
Save