D21164: Replace QUrl::fromUserInput by lighter heuristic

2019-05-13 Thread Kai Uwe Broulik
This revision was automatically updated to reflect the committed changes.
Closed by commit R120:d38d7df3e170: Replace QUrl::fromUserInput by lighter 
heuristic (authored by broulik).

CHANGED PRIOR TO COMMIT
  https://phabricator.kde.org/D21164?vs=57988=58004#toc

REPOSITORY
  R120 Plasma Workspace

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21164?vs=57988=58004

REVISION DETAIL
  https://phabricator.kde.org/D21164

AFFECTED FILES
  libnotificationmanager/job_p.cpp
  libnotificationmanager/job_p.h

To: broulik, #plasma, apol
Cc: apol, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D21164: Replace QUrl::fromUserInput by lighter heuristic

2019-05-13 Thread Aleix Pol Gonzalez
apol accepted this revision.
apol added a comment.
This revision is now accepted and ready to land.


  Oh right, it's the other way around.
  
  Well.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D21164

To: broulik, #plasma, apol
Cc: apol, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D21164: Replace QUrl::fromUserInput by lighter heuristic

2019-05-13 Thread Kai Uwe Broulik
broulik updated this revision to Diff 57988.
broulik edited the summary of this revision.

REPOSITORY
  R120 Plasma Workspace

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21164?vs=57941=57988

REVISION DETAIL
  https://phabricator.kde.org/D21164

AFFECTED FILES
  libnotificationmanager/job_p.cpp

To: broulik, #plasma
Cc: apol, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D21164: Replace QUrl::fromUserInput by lighter heuristic

2019-05-12 Thread Kai Uwe Broulik
broulik added a comment.


  In D21164#464287 , @apol wrote:
  
  > https://doc.qt.io/qt-5/qurl.html#UrlFormattingOption-enum
  >
  > How about using QUrl::toDisplayString(QUrl::PreferLocalFile)?
  
  
  That won't make a difference as it always creates a `QFileInfo`: 
https://code.woboq.org/qt5/qtbase/src/corelib/io/qurl.cpp.html#_ZN4QUrl13fromUserInputERK7QStringS2_6QFlagsINS_25UserInputResolutionOptionEE

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D21164

To: broulik, #plasma
Cc: apol, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D21164: Replace QUrl::fromUserInput by lighter heuristic

2019-05-12 Thread Aleix Pol Gonzalez
apol added a comment.


  https://doc.qt.io/qt-5/qurl.html#UrlFormattingOption-enum
  
  How about using QUrl::toDisplayString(QUrl::PreferLocalFile)?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D21164

To: broulik, #plasma
Cc: apol, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D21164: Replace QUrl::fromUserInput by lighter heuristic

2019-05-12 Thread Kai Uwe Broulik
broulik created this revision.
broulik added a reviewer: Plasma.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.

REVISION SUMMARY
  I just found that `QUrl::fromLocalFile()` actually calls `QFileInfo::exists` 
on the URL which is not something you want to be doing constantly and 
especially not for remote locations.
  The code is really just trying to figure out a URL from the source or 
destination labels of the job which are usually either a full URL or just a 
local path. If it's not, then it's probably not very interesting to us anyway.

TEST PLAN
  - No longer have plasmashell creeping to a halt when copying stuff from my 
phone (using sshfs mounted by kdeconnect, ie a "local" path but actually 
remote) to my PC
  
  This code is really just trying to guess whether the descriptions of the job 
have any sort of path / filename in it, so replace it by a lighter guessing 
logic.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D21164

AFFECTED FILES
  libnotificationmanager/job_p.cpp
  libnotificationmanager/job_p.h

To: broulik, #plasma
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart