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

List:       kde-frameworks-devel
Subject:    Re: Review Request 125527: Add mimeTypes() to KPluginMetaData
From:       Jarosław_Staniek <staniek () kde ! org>
Date:       2015-11-28 20:37:16
Message-ID: 20151128203716.23104.81546 () mimi ! kde ! org
[Download RAW message or body]

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



> On Nov. 28, 2015, 8:10 p.m., Jarosław Staniek wrote:
> > Hi, I see one regression. 
> > Before this change I had "MimeType" field. And I've been using this field.
> > 
> > Now I miss miss this field and have "KPlugin/MimeTypes" field. This means plugin \
> > error if KF5 5.16.x is installed. I cannot fix my sources: if I do users of KF5 \
> > <= 5.15.x will get equivalent error.
> 
> Alex Richardson wrote:
> Hmm I hadn't thought of that. Sorry for causing a regression. I assume you are \
> using kcoreaddons_desktop_to_json() to generate the JSON file otherwise this issue \
> shouldn't appear 
> I see a few ways of working around this in the sources:
> 
> - Depend on KF >= 5.16 (easiest but unlikely to be possible)
> - Change MimeType= into X-MyApp-MimeType= and then read that field
> - You could use JSON files directly instead of .desktop files
> - a) add the MimeType string to the root object
> - b) use the 5.16 JSON with a string list and use \
> KPluginMetaData::readStringList(rawData()["KPlugin"], QStringLiteral("MimeTypes")); \
> for KF <= 5.16 
> Jarosław Staniek wrote:
> Thanks for the quick reply with options.
> 
> Yes, I am using kcoreaddons_desktop_to_json().
> 
> The error is at https://build.kde.org/job/kdb%20master%20kf5-qt5/36/PLATFORM=Linux,compiler=gcc/testReport/%28root%29/TestSuite/ConnectionTest/
>  I did not notice before because CI does not send notification for my repos (no \
> idea how to enable them, reported to Sysadmin). 
> Yes, I plan to switch to JSON files entirely, so now I have extra reason.
> 
> Do you think the regression is worth removing or instead some statement can be made \
> in the docs for kcoreaddons_desktop_to_json() about what are the guaranteed \
> contents of the JSON?

PS: KPluginMetaData::mimeTypes() is advertised for use but is it good habit to depend \
on KF 5.16 just for that? Personally I am not using it.


- Jarosław


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


On Oct. 6, 2015, 1:42 p.m., Alex Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125527/
> -----------------------------------------------------------
> 
> (Updated Oct. 6, 2015, 1:42 p.m.)
> 
> 
> Review request for KDE Frameworks, David Faure and Sebastian Kügler.
> 
> 
> Repository: kcoreaddons
> 
> 
> Description
> -------
> 
> When loading a .desktop file this will parse the XDG MimeType= key
> 
> Contrary to KService we don't merge these with ServiceTypes but rather
> have them as a separate property.
> 
> REVIEW: 125261
> 
> KPluginMetaData: Warn when a list entry is not a JSON list
> 
> We still convert single values to a list with one entry but now also
> output a warning.
> 
> REVIEW: 125261
> 
> 
> Diffs
> -----
> 
> autotests/data/fakeplugin.desktop 30ff9a98d4587507620f70e3c271456877ab1812 
> autotests/kpluginmetadatatest.cpp 3af5e1b842b0bc231a5ac001112e141f751d2ff5 
> src/lib/plugin/desktopfileparser.h 98d47ddf0f877c4a25928026b3d5fe169cfc9e75 
> src/lib/plugin/desktopfileparser.cpp 0b03eb154deb58840c91c12658780c0d492b593c 
> src/lib/plugin/kpluginmetadata.h 183b0d0583259f7ed74e97858a68c5c388fd0a9a 
> src/lib/plugin/kpluginmetadata.cpp b13d6dd52827cc03d9473600aa4d2bab8a95a1d4 
> 
> Diff: https://git.reviewboard.kde.org/r/125527/diff/
> 
> 
> Testing
> -------
> 
> This is the same as review 125261 but for some reason I kept getting a internal \
> server error when I tried to update it. 
> 
> Used this for a WIP port of Okular to new Plugin loading. Could also be used by \
> KDevelop instead of the custom X-KDevelop-SupportedMimeTypes property 
> Requires https://git.reviewboard.kde.org/r/125263/ to ensure that there are no \
> regressions 
> 
> Thanks,
> 
> Alex Richardson
> 
> 


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




<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/125527/">https://git.reviewboard.kde.org/r/125527/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On November 28th, 2015, 8:10 p.m. CET, \
<b>Jarosław Staniek</b> wrote:</p>  <blockquote style="margin-left: 1em; \
border-left: 2px solid #d0d0d0; padding-left: 10px;">  <pre style="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;">Hi, I see one \
regression.  Before this change I had "MimeType" field. And I've been using this \
field.</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Now I miss miss this field and have \
"KPlugin/MimeTypes" field. This means plugin error if KF5 5.16.x is installed. I \
cannot fix my sources: if I do users of KF5 &lt;= 5.15.x will get equivalent \
error.</p></pre>  </blockquote>




 <p>On November 28th, 2015, 8:46 p.m. CET, <b>Alex Richardson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="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;">Hmm I \
hadn't thought of that. Sorry for causing a regression. I assume you are using \
kcoreaddons_desktop_to_json() to generate the JSON file otherwise this issue \
shouldn't appear</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">I see a few ways of working around this \
in the sources:</p> <ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 \
1em;line-height: inherit;white-space: normal;"> <li style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: normal;">Depend on KF &gt;= 5.16 \
(easiest but unlikely to be possible)</li> <li style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: normal;">Change MimeType= into \
X-MyApp-MimeType= and then read that field</li> <li style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: normal;">You could use JSON files \
directly instead of .desktop files<ul style="padding: 0;text-rendering: \
inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;"> <li \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
normal;">a) add the MimeType string to the root object</li> <li style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">b) use \
the 5.16 JSON with a string list and use \
KPluginMetaData::readStringList(rawData()["KPlugin"], QStringLiteral("MimeTypes")); \
for KF &lt;= 5.16</li> </ul>
</li>
</ul></pre>
 </blockquote>





 <p>On November 28th, 2015, 8:55 p.m. CET, <b>Jarosław Staniek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="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;">Thanks for the quick reply with options.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Yes, \
I am using kcoreaddons_desktop_to_json().</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">The error is at \
https://build.kde.org/job/kdb%20master%20kf5-qt5/36/PLATFORM=Linux,compiler=gcc/testReport/%28root%29/TestSuite/ConnectionTest/
 I did not notice before because CI does not send notification for my repos (no idea \
how to enable them, reported to Sysadmin).</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Yes, I plan to switch \
to JSON files entirely, so now I have extra reason.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Do \
you think the regression is worth removing or instead some statement can be made in \
the docs for kcoreaddons_desktop_to_json() about what are the guaranteed contents of \
the JSON?</p></pre>  </blockquote>








</blockquote>

<pre style="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;">PS: \
KPluginMetaData::mimeTypes() is advertised for use but is it good habit to depend on \
KF 5.16 just for that? Personally I am not using it.</p></pre>
<br />










<p>- Jarosław</p>


<br />
<p>On October 6th, 2015, 1:42 p.m. CEST, Alex Richardson wrote:</p>








<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 KDE Frameworks, David Faure and Sebastian Kügler.</div>
<div>By Alex Richardson.</div>


<p style="color: grey;"><i>Updated Oct. 6, 2015, 1:42 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kcoreaddons
</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;">When loading a .desktop file this will parse the XDG MimeType= key

Contrary to KService we don&#39;t merge these with ServiceTypes but rather
have them as a separate property.

REVIEW: 125261

KPluginMetaData: Warn when a list entry is not a JSON list

We still convert single values to a list with one entry but now also
output a warning.

REVIEW: 125261</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;">This is the same as review 125261 but for some reason \
I kept getting a internal server error when I tried to update it.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Used this for a WIP port of Okular to new Plugin loading. Could also be \
used by KDevelop instead of the custom X-KDevelop-SupportedMimeTypes property</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Requires https://git.reviewboard.kde.org/r/125263/ to ensure that there are \
no regressions</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;">

 <li>autotests/data/fakeplugin.desktop <span style="color: \
grey">(30ff9a98d4587507620f70e3c271456877ab1812)</span></li>

 <li>autotests/kpluginmetadatatest.cpp <span style="color: \
grey">(3af5e1b842b0bc231a5ac001112e141f751d2ff5)</span></li>

 <li>src/lib/plugin/desktopfileparser.h <span style="color: \
grey">(98d47ddf0f877c4a25928026b3d5fe169cfc9e75)</span></li>

 <li>src/lib/plugin/desktopfileparser.cpp <span style="color: \
grey">(0b03eb154deb58840c91c12658780c0d492b593c)</span></li>

 <li>src/lib/plugin/kpluginmetadata.h <span style="color: \
grey">(183b0d0583259f7ed74e97858a68c5c388fd0a9a)</span></li>

 <li>src/lib/plugin/kpluginmetadata.cpp <span style="color: \
grey">(b13d6dd52827cc03d9473600aa4d2bab8a95a1d4)</span></li>

</ul>

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






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







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


--===============6076336155126970332==--


[Attachment #3 (text/plain)]

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


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

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