D11044: Don't try to find an icon for an empty url

2018-03-19 Thread David Faure
dfaure added a comment.


  https://commits.kde.org/kio/e6723cdac2b713081417aa198f3cede8c68b78e0, now 
with unittests.

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh, ngraham


D11044: Don't try to find an icon for an empty url

2018-03-19 Thread David Faure
dfaure added a comment.


  Kai-Uwe was right, this should actually check for scheme.isEmpty(). Otherwise 
typing ~ in kfilewidget (which leads to a relative URL without scheme) hits 
this same assert again. I hate relative URLs... I'll change it.

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh, ngraham


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread Jaime Torres Amate
This revision was automatically updated to reflect the committed changes.
Closed by commit R241:8ba93b82e451: Don't try to find an icon for an empty 
url (authored by jtamate).

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11044?vs=28690&id=28739

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

AFFECTED FILES
  src/core/global.cpp

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread David Faure
dfaure accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread Jaime Torres Amate
jtamate updated this revision to Diff 28690.
jtamate added a comment.


  Checking for empty url at the top of the method.

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11044?vs=28680&id=28690

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

AFFECTED FILES
  src/core/global.cpp

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread Jaime Torres Amate
jtamate added a comment.


  In D11044#218896 , @dfaure wrote:
  
  > Wait, who's calling KIO::iconNameForUrl() with an empty URL? This should be 
an assert or an early-return at the top of that method, not nested into one 
specific if(). Even the very beginning, db.mimeTypeForUrl(url), makes no sense 
for an empty URL.
  
  
  When I just click in network in the save dialog,  
KFileWidgetPrivate::_k_urlEntered just has the following data:
  url= QUrl("remote:/") but filename=locationEditCurrentText() == ""
  
  #11 0x7f96d01cca5b in KProtocolInfo::icon (_protocol=...) at 
/home/jtorres/kdesrc/frameworks/kio/src/core/kprotocolinfo.cpp:251
  #12 0x7f96d01c87c0 in KIO::iconNameForUrl (url=...) at 
/home/jtorres/kdesrc/frameworks/kio/src/core/global.cpp:332
  #13 0x7f96ba0c2cb5 in **KFileWidgetPrivate::_k_urlEntered** 
(this=0x7f96b40091a0, url=...) at 
/home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfilewidget.cpp:1487
  #14 0x7f96ba0ca25d in KFileWidget::qt_static_metacall (_o=0x210a3a0, 
_c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7ffdb629f960) at 
/home/jtorres/kdesrc/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kfilewidget.cpp:176
  #15 0x7f96cbed302a in QMetaObject::activate(QObject*, int, int, void**) 
() from /usr/lib64/libQt5Core.so.5
  #16 0x7f96ba0a6eef in KDirOperator::urlEntered (this=0x218f400, _t1=...) 
at 
/home/jtorres/kdesrc/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kdiroperator.cpp:602
  #17 0x7f96ba09a83d in KDirOperator::setUrl (this=0x218f400, _newurl=..., 
clearforward=true) at 
/home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kdiroperator.cpp:1040
  #18 0x7f96ba0c2bea in KFileWidget::setUrl (this=0x210a3a0, url=..., 
clearforward=true) at 
/home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfilewidget.cpp:1469
  #19 0x7f96ba0c2f52 in KFileWidgetPrivate::_k_enterUrl 
(this=0x7f96b40091a0, url=...) at 
/home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfilewidget.cpp:1523
  #20 0x7f96ba0ca280 in KFileWidget::qt_static_metacall (_o=0x210a3a0, 
_c=QMetaObject::InvokeMetaMethod, _id=10, _a=0x7ffdb629fd10) at 
/home/jtorres/kdesrc/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kfilewidget.cpp:177
  #21 0x7f96cbed302a in QMetaObject::activate(QObject*, int, int, void**) 
() from /usr/lib64/libQt5Core.so.5
  #22 0x7f96ba0e429f in KFilePlacesView::urlChanged (this=0x22c4f40, 
_t1=...) at 
/home/jtorres/kdesrc/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kfileplacesview.cpp:263
  #23 0x7f96ba0e2a3a in KFilePlacesView::Private::setCurrentIndex 
(this=0x2267fb0, index=...) at 
/home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfileplacesview.cpp:1113
  #24 0x7f96ba0e3719 in KFilePlacesView::Private::_k_placeClicked 
(this=0x2267fb0, index=...) at 
/home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfileplacesview.cpp:1330
  #25 0x7f96ba0e3e41 in KFilePlacesView::qt_static_metacall (_o=0x22c4f40, 
_c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7ffdb629ff20) at 
/home/jtorres/kdesrc/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kfileplacesview.cpp:167
  #26 0x7f96cbed302a in QMetaObject::activate(QObject*, int, int, void**) 
() from /usr/lib64/libQt5Core.so.5
  #27 0x7f96cd0e6cd5 in QAbstractItemView::clicked(QModelIndex const&) () 
from /usr/lib64/libQt5Widgets.so.5
  #28 0x7f96cd0e9a4b in QAbstractItemView::mouseReleaseEvent(QMouseEvent*) 
() from /usr/lib64/libQt5Widgets.so.5
  #29 0x7f96cd126cbf in QListView::mouseReleaseEvent(QMouseEvent*) () from 
/usr/lib64/libQt5Widgets.so.5

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread David Faure
dfaure requested changes to this revision.
dfaure added a comment.
This revision now requires changes to proceed.


  Wait, who's calling KIO::iconNameForUrl() with an empty URL? This should be 
an assert or an early-return at the top of that method, not nested into one 
specific if(). Even the very beginning, db.mimeTypeForUrl(url), makes no sense 
for an empty URL.

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread Kai Uwe Broulik
broulik added a comment.


  Shouldn't it check emptiness of the url scheme specifically?

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: broulik, michaelh


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread Jaime Torres Amate
jtamate added a dependency: D11013: Detect incorrect paramenter in findProtocol.

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: michaelh


D11044: Don't try to find an icon for an empty url

2018-03-05 Thread Jaime Torres Amate
jtamate created this revision.
jtamate added reviewers: Frameworks, dfaure.
Restricted Application added a project: Frameworks.
jtamate requested review of this revision.

REVISION SUMMARY
  The message kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to 
find "" 
  was produced when findProtocol was called by KProtocolInfo::icon that was
  called with an empty url.

TEST PLAN
  No more Refilling KProtocolInfoFactory cache in the hope to find "" when 
browsing net or samba shares.

REPOSITORY
  R241 KIO

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

AFFECTED FILES
  src/core/global.cpp

To: jtamate, #frameworks, dfaure
Cc: michaelh