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

Jaime Torres Amate noreply at phabricator.kde.org
Mon Mar 5 10:40:23 UTC 2018


jtamate added a comment.


  In D11044#218896 <https://phabricator.kde.org/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 0x00007f96d01cca5b in KProtocolInfo::icon (_protocol=...) at /home/jtorres/kdesrc/frameworks/kio/src/core/kprotocolinfo.cpp:251
  #12 0x00007f96d01c87c0 in KIO::iconNameForUrl (url=...) at /home/jtorres/kdesrc/frameworks/kio/src/core/global.cpp:332
  #13 0x00007f96ba0c2cb5 in **KFileWidgetPrivate::_k_urlEntered** (this=0x7f96b40091a0, url=...) at /home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfilewidget.cpp:1487
  #14 0x00007f96ba0ca25d 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 0x00007f96cbed302a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
  #16 0x00007f96ba0a6eef in KDirOperator::urlEntered (this=0x218f400, _t1=...) at /home/jtorres/kdesrc/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kdiroperator.cpp:602
  #17 0x00007f96ba09a83d in KDirOperator::setUrl (this=0x218f400, _newurl=..., clearforward=true) at /home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kdiroperator.cpp:1040
  #18 0x00007f96ba0c2bea in KFileWidget::setUrl (this=0x210a3a0, url=..., clearforward=true) at /home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfilewidget.cpp:1469
  #19 0x00007f96ba0c2f52 in KFileWidgetPrivate::_k_enterUrl (this=0x7f96b40091a0, url=...) at /home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfilewidget.cpp:1523
  #20 0x00007f96ba0ca280 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 0x00007f96cbed302a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
  #22 0x00007f96ba0e429f in KFilePlacesView::urlChanged (this=0x22c4f40, _t1=...) at /home/jtorres/kdesrc/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kfileplacesview.cpp:263
  #23 0x00007f96ba0e2a3a in KFilePlacesView::Private::setCurrentIndex (this=0x2267fb0, index=...) at /home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfileplacesview.cpp:1113
  #24 0x00007f96ba0e3719 in KFilePlacesView::Private::_k_placeClicked (this=0x2267fb0, index=...) at /home/jtorres/kdesrc/frameworks/kio/src/filewidgets/kfileplacesview.cpp:1330
  #25 0x00007f96ba0e3e41 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 0x00007f96cbed302a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
  #27 0x00007f96cd0e6cd5 in QAbstractItemView::clicked(QModelIndex const&) () from /usr/lib64/libQt5Widgets.so.5
  #28 0x00007f96cd0e9a4b in QAbstractItemView::mouseReleaseEvent(QMouseEvent*) () from /usr/lib64/libQt5Widgets.so.5
  #29 0x00007f96cd126cbf 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180305/1dd2a1b2/attachment.html>


More information about the Kde-frameworks-devel mailing list