[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-05-12 9:32:15
Message-ID: 20150512093215.8613.48403 () mimi ! kde ! org
[Download RAW message or body]

--===============5262109013940834283==
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 May 12, 2015, 9:32 a.m.)


Status
------

This change has been marked as submitted.


Review request for Plasma.


Changes
-------

Submitted with commit 49a1a2827639b3099a2f16fc3c8eef6130e4d95d by Marco Martin to branch master.


Bugs: 346002
    None


Description
-------

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


--===============5262109013940834283==
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="#e0e0e0" width="100%" cellpadding="12" style="border: 1px gray solid; border-radius: 6px; \
-moz-border-radius: 6px; -webkit-border-radius: 6px;">  <tr>
  <td>
   <h1 style="margin: 0; padding: 0; font-size: 10pt;">This change has been marked as submitted.</h1>
  </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 May 12, 2015, 9:32 a.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Submitted with commit \
49a1a2827639b3099a2f16fc3c8eef6130e4d95d by Marco Martin to branch master.</pre>  </td>
 </tr>
</table>





<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 </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>


--===============5262109013940834283==--


[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