[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request 123426: Kickoff is not mounting removable devices and shows "Invalid URL"
From:       "Konrad Materka" <materka () gmail ! com>
Date:       2015-04-19 9:52:48
Message-ID: 20150419095248.5926.62830 () mimi ! kde ! org
[Download RAW message or body]

--===============3658361392164058006==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123426/
-----------------------------------------------------------

(Updated Kwi 19, 2015, 9:52 rano)


Review request for Plasma.


Bugs: 346002
    None


Description (updated)
-------

Fixed version of /r/123350/

Why VisualDelegateModel? It may be workaround/hack/you name it but it was the only \
way I found acceptable. You need to pass QModelIndex to openItem and I don't know how \
to get it using plain ListView and SystemModel. VisualDelegateModel has a convenience \
method modelIndex which is already used in KickoffItem.qml (but only if \
ApplicationsView tab is active). I changed BaseView to use VisualDelegateModel to \
have modelIndex method and to be more consistent with ApplicaitonView. 

"this change seems uneeded; we're using modelIndex fine in the old code, see line 40 \
in KickoffItem.qml  in the old code. (unless maybe that didn't work ?)
My understanding is setting the model to a QAIM, internally just creates a VDM \
anyway."

It didn't work. modelIndex is used only if flag hasModelChildren is set to true. That \
can happen only for ApplicationView, as only there children exist. Also \
ApplicationView uses VisualDataModel explicitly, so method modelIndex is available. \
In SystemView model is set directly, VisualDataModel is not created implicitly (or \
even if it is it is not accessible). In other words listItem.ListView.view.model \
returns SystemModel object which is QAbstractProxyModel/QAbstractItemModel \
implementation. SystemModel does not have any slot that would be usefull in this \
case. Passing "model" variable is not an option. It would be a good idea as it \
contains all data related to current item but this is internal QML/Qt Quick class.

In KDE 4 it was not a problem as it was easy to get QModelIndex from event (lines 860 \
- 878): https://projects.kde.org/projects/kde/kde-workspace/repository/entry/plasma/desktop/applets/kickoff/ui/launcher.cpp?rev=KDE%2F4.9



Diffs
-----


Diff: https://git.reviewboard.kde.org/r/123426/diff/


Testing
-------

I was able to reproduce bug using latest GIT code.
Screenshots, first shows not mounted removable device, second is error message (in \
Polish): https://www.dropbox.com/s/8vcokx17kmn3onw/zrzut%20ekranu1.png?dl=0&s=sl
https://www.dropbox.com/s/sqkci1z1fhb3h3p/zrzut%20ekranu2.png?dl=0&s=sl

In console I can find this message:
Opening item with URL ""

It looks that KFilePlacesModel->url(index) returns empty string for not mounted \
devices. I have 5.9.0 version of libkf5kiocore5 installed.

Patch fixed mounting. I also tested all tabs, all items works as expected.


File Attachments
----------------

Use VisualDataModel->modelIndex in openItem
  https://git.reviewboard.kde.org/media/uploaded/files/2015/04/19/4a0d0c4d-0f76-429b-8c4a-6f9ba9856816__Bug-346002.patch



Thanks,

Konrad Materka


--===============3658361392164058006==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/123426/">https://git.reviewboard.kde.org/r/123426/</a>
  </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for Plasma.</div>
<div>By Konrad Materka.</div>


<p style="color: grey;"><i>Updated Kwi 19, 2015, 9:52 rano</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="None">346002</a>


</div>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description  \
(updated)</h1>  <table width="100%" bgcolor="#ffffff" cellspacing="0" \
cellpadding="10" style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Fixed version of /r/123350/</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Why \
VisualDelegateModel? It may be workaround/hack/you name it but it was the only way I \
found acceptable. You need to pass QModelIndex to openItem and I don't know how to \
get it using plain ListView and SystemModel. VisualDelegateModel has a convenience \
method modelIndex which is already used in KickoffItem.qml (but only if \
ApplicationsView tab is active). I changed BaseView to use VisualDelegateModel to \
have modelIndex method and to be more consistent with ApplicaitonView. </p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">"this change seems uneeded; we're using modelIndex fine in the old code, \
see line 40 in KickoffItem.qml  in the old code. (unless maybe that didn't work ?)
My understanding is setting the model to a QAIM, internally just creates a VDM \
anyway."</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">It didn't work. modelIndex is used only if flag \
hasModelChildren is set to true. That can happen only for ApplicationView, as only \
there children exist. Also ApplicationView uses VisualDataModel explicitly, so method \
modelIndex is available. In SystemView model is set directly, VisualDataModel is not \
created implicitly (or even if it is it is not accessible). In other words \
listItem.ListView.view.model returns SystemModel object which is \
QAbstractProxyModel/QAbstractItemModel implementation. SystemModel does not have any \
slot that would be usefull in this case. Passing "model" variable is not an option. \
It would be a good idea as it contains all data related to current item but this is \
internal QML/Qt Quick class.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">In KDE 4 it was not a problem as it was \
easy to get QModelIndex from event (lines 860 - 878): \
https://projects.kde.org/projects/kde/kde-workspace/repository/entry/plasma/desktop/applets/kickoff/ui/launcher.cpp?rev=KDE%2F4.9</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">I was able to reproduce bug using latest GIT code. \
Screenshots, first shows not mounted removable device, second is error message (in \
Polish): https://www.dropbox.com/s/8vcokx17kmn3onw/zrzut%20ekranu1.png?dl=0&amp;s=sl
https://www.dropbox.com/s/sqkci1z1fhb3h3p/zrzut%20ekranu2.png?dl=0&amp;s=sl</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">In console I can find this message: Opening item with \
URL ""</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">It looks that KFilePlacesModel-&gt;url(index) returns \
empty string for not mounted devices. I have 5.9.0 version of libkf5kiocore5 \
installed.</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Patch fixed mounting. I also tested all tabs, all \
items works as expected.</p></pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

</ul>

<p><a href="https://git.reviewboard.kde.org/r/123426/diff/" style="margin-left: \
3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments \
</h1>


 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2015/04/19/4a0d0c4d-0f76-429b-8c4a-6f9ba9856816__Bug-346002.patch">Use \
VisualDataModel-&gt;modelIndex in openItem</a></li>

</ul>




  </td>
 </tr>
</table>



  </div>
 </body>
</html>


--===============3658361392164058006==--


[Attachment #3 (text/plain)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic