<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/124414/">https://git.reviewboard.kde.org/r/124414/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On jūlijs 22nd, 2015, 11:47 a.m. EEST, <b>David Faure</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;">Why not shortcut that "-" hack altogether, and set XDG_DATA_HOME to the second entry in standardLocations(GenericDataLocation)?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">In any case, I don't think --global leads to something useful, but sure, fix the assert ;)</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;">This fix doesn't rely on Qt internals so that if something changes on Qt side it will still work.
But if we'll always replace XDG_DATA_HOME with 2nd entry from GenericDataLocation and then Qt changes ordering it might not work (like XDG_DATA_HOME could be 2nd entry).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Also it's not said that Qt won't change "~/.local/share" to something else so this ? alternative isn't Qt change proof either.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"> <span style="color: #008000; font-weight: bold">QStringList</span> <span style="color: #008000; font-weight: bold">paths</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">QStandardPaths</span><span style="color: #666666">:</span><span style="color: #AA22FF">:standardLocations</span><span style="color: #666666">(</span><span style="color: #008000; font-weight: bold">QStandardPaths</span><span style="color: #666666">:</span><span style="color: #AA22FF">:GenericDataLocation</span><span style="color: #666666">);</span>
<span style="color: #008000; font-weight: bold">for</span> <span style="color: #666666">(</span><span style="color: #008000; font-weight: bold">auto</span> <span style="color: #008000; font-weight: bold">it</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">paths</span><span style="color: #0000FF; font-weight: bold">.constBegin</span><span style="color: #666666">();</span> <span style="color: #008000; font-weight: bold">it</span> <span style="color: #666666">!=</span> <span style="color: #008000; font-weight: bold">paths</span><span style="color: #0000FF; font-weight: bold">.constEnd</span><span style="color: #666666">();</span> <span style="color: #666666">++</span><span style="color: #008000; font-weight: bold">it</span><span style="color: #666666">)</span> {
if (<span style="color: #666666">!</span>it<span style="color: #666666">-></span>endsWith(<span style="color: #BA2121">"/.local/share"</span>)) <span style="border: 1px solid #FF0000">{</span>
qputenv(<span style="color: #BA2121">"XDG_DATA_HOME"</span><span style="color: #666666">,</span> it<span style="color: #666666">-></span>toLocal8Bit());
break;
}
<span style="border: 1px solid #FF0000">}</span>
</pre></div>
</p></pre>
<br />
<p>- Dāvis</p>
<br />
<p>On jūlijs 21st, 2015, 11:51 p.m. EEST, Dāvis Mosāns 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.</div>
<div>By Dāvis Mosāns.</div>
<p style="color: grey;"><i>Updated jūlijs 21, 2015, 11:51 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kservice
</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;">Currently "kbuildsycoca5 --global" does crash because Qt uses XDG_DATA_HOME as first choice for GenericDataLocation
and with "--global" it's set to "-" which is invalid path. kbuildsycoca5 attempts to create "-/kservices5/ksycoca5" which raises ASSERT failure in KConfig.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">ASSERT: "QDir::isAbsolutePath(file)" in file /mnt/AUR/kconfig-git/src/kconfig/src/core/kconfigini.cpp, line 597
#5 0x00007f6128c3c528 in raise () from /usr/lib/libc.so.6
#6 0x00007f6128c3d93a in abort () from /usr/lib/libc.so.6
#7 0x00007f61293c74a9 in qt_message_fatal (context=..., message=<synthetic pointer>) at global/qlogging.cpp:1578
#8 QMessageLogger::fatal (this=this@entry=0x7ffc2f4d2250, msg=msg@entry=0x7f61296345f0 "ASSERT: \"%s\" in file %s, line %d") at global/qlogging.cpp:781
#9 0x00007f61293c05bc in qt_assert (assertion=assertion@entry=0x7f6129cbfea8 "QDir::isAbsolutePath(file)", file=file@entry=0x7f6129cbfdf0 "/mnt/AUR/kconfig-git/src/kconfig/src/core/kconfigini.cpp", line=line@entry=597) at global/qglobal.cpp:2968
#10 0x00007f6129ca299f in KConfigIniBackend::setFilePath (this=0x1ecb360, file=...) at /mnt/AUR/kconfig-git/src/kconfig/src/core/kconfigini.cpp:597
#11 0x00007f6129c8bc5b in KConfigPrivate::changeFileName (this=0x1ed5af0, name=...) at /mnt/AUR/kconfig-git/src/kconfig/src/core/kconfig.cpp:609
#12 0x00007f6129ca9a2e in KDesktopFile::KDesktopFile (this=0x7ffc2f4d23e0, resourceType=QStandardPaths::GenericDataLocation, fileName=...) at /mnt/AUR/kconfig-git/src/kconfig/src/core/kdesktopfile.cpp:54
#13 0x00000000004214e1 in KBuildServiceFactory::createEntry (this=<optimized out>, file=...) at /mnt/AUR/kservice-git/src/kbuildsycoca/kbuildservicefactory.cpp:102
#14 0x0000000000415358 in KBuildSycoca::createEntry (this=this@entry=0x1eb0950, file=..., addToFactory=addToFactory@entry=true) at /mnt/AUR/kservice-git/src/kbuildsycoca/kbuildsycoca.cpp:153
#15 0x0000000000416d21 in KBuildSycoca::build (this=this@entry=0x1eb0950) at /mnt/AUR/kservice-git/src/kbuildsycoca/kbuildsycoca.cpp:273
#16 0x000000000041755d in KBuildSycoca::recreate (this=this@entry=0x1eb0950) at /mnt/AUR/kservice-git/src/kbuildsycoca/kbuildsycoca.cpp:419
#17 0x0000000000411636 in main (argc=3, argv=<optimized out>) at /mnt/AUR/kservice-git/src/kbuildsycoca/kbuildsycoca.cpp:802
</pre></div>
</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;">Seems to be working, atleast doesn't crash anymore.</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>src/kbuildsycoca/kbuildsycoca.cpp <span style="color: grey">(074a7d830f7d3781960e64c16f721fae9edc26f9)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/124414/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>