[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: Review Request 124980: Add org.kde.plasma.private.sessions with a SessionModel
From: Martin_Gräßlin <mgraesslin () kde ! org>
Date: 2015-08-31 11:37:40
Message-ID: 20150831113740.8333.32038 () mimi ! kde ! org
[Download RAW message or body]
--===============4633808765424792291==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
> On Aug. 31, 2015, 8:25 a.m., Martin Gräßlin wrote:
> > components/sessionsprivate/sessionsmodel.h, line 56
> > <https://git.reviewboard.kde.org/r/124980/diff/1/?file=399560#file399560line56>
> >
> > suggestion: enum class, and then drop the Role from each name. Usage will be e.g. Roles::Icon
>
> Kai Uwe Broulik wrote:
> I don't think that'll work given QAbstractItemModel passes roles around as int and you cannot \
> implicitly convert an enum class to int?
not implicitly, but explicitly should work.
> On Aug. 31, 2015, 8:25 a.m., Martin Gräßlin wrote:
> > components/sessionsprivate/sessionsmodel.h, line 85
> > <https://git.reviewboard.kde.org/r/124980/diff/1/?file=399560#file399560line85>
> >
> > Playing Milian: cetero censeo QList delendam esset.
> >
> > -> use QVector ;-)
>
> Kai Uwe Broulik wrote:
> I though QList was only evil if sizeof T is <= void* ?
Please see https://marcmutz.wordpress.com/effective-qt/containers/ - section on QVector and QList. Random \
quote: "Guideline: Avoid QList<T> where T is not declared as either Q_MOVABLE_TYPE or Q_PRIMITIVE_TYPE or \
where sizeof(T) != sizeof(void*) (remember to check both 32 and 64-bit platforms)."
I think you hit all conditions here on when to avoid.
- Martin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124980/#review84618
-----------------------------------------------------------
On Aug. 29, 2015, 4:14 p.m., Kai Uwe Broulik wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124980/
> -----------------------------------------------------------
>
> (Updated Aug. 29, 2015, 4:14 p.m.)
>
>
> Review request for Plasma and Martin Gräßlin.
>
>
> Repository: plasma-workspace
>
>
> Description
> -------
>
> This way it can be used in the lock screen, user switcher, and a user switcher plasmoid I'm planning.
>
> Compared to the one in the lock screen it can also get the user's full name and avatar, and some other \
> information.
> Perhaps we could also try to have it wait for the screen to actually lock before switching sessions?
>
>
> Diffs
> -----
>
> components/CMakeLists.txt 21fc61c
> components/sessionsprivate/CMakeLists.txt PRE-CREATION
> components/sessionsprivate/qmldir PRE-CREATION
> components/sessionsprivate/sessionsmodel.h PRE-CREATION
> components/sessionsprivate/sessionsmodel.cpp PRE-CREATION
> components/sessionsprivate/sessionsprivateplugin.h PRE-CREATION
> components/sessionsprivate/sessionsprivateplugin.cpp PRE-CREATION
>
> Diff: https://git.reviewboard.kde.org/r/124980/diff/
>
>
> Testing
> -------
>
> Lists my sessions, allows to switch between them and start new ones. Locking when creating a new \
> session is missing.
>
> Thanks,
>
> Kai Uwe Broulik
>
>
--===============4633808765424792291==
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/124980/">https://git.reviewboard.kde.org/r/124980/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On August 31st, 2015, 8:25 a.m. CEST, <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: \
collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: \
4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/124980/diff/1/?file=399560#file399560line56" style="color: black; \
font-weight: bold; text-decoration: underline;">components/sessionsprivate/sessionsmodel.h</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; \
margin: 0; "></pre></td> <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px \
solid #C0C0C0;" align="right"><font size="2">56</font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">enum</span> <span \
class="n">Roles</span> <span class="p">{</span></pre></td> </tr>
</tbody>
</table>
<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;">suggestion: enum class, and then drop the Role from each name. Usage will \
be e.g. Roles::Icon</p></pre> </blockquote>
<p>On August 31st, 2015, 12:14 p.m. CEST, <b>Kai Uwe Broulik</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;">I don't think that'll work given QAbstractItemModel passes roles around as \
int and you cannot implicitly convert an enum class to int?</p></pre> </blockquote>
</blockquote>
<pre style="margin-left: 1em; 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;">not implicitly, but explicitly should work.</p></pre> <br \
/>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On August 31st, 2015, 8:25 a.m. CEST, <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: \
collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: \
4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/124980/diff/1/?file=399560#file399560line85" style="color: black; \
font-weight: bold; text-decoration: underline;">components/sessionsprivate/sessionsmodel.h</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; \
margin: 0; "></pre></td> <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px \
solid #C0C0C0;" align="right"><font size="2">85</font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">QList</span><span \
class="o"><</span><span class="n">SessionEntry</span><span class="o">></span> <span \
class="n">m_data</span><span class="p">;</span></pre></td> </tr>
</tbody>
</table>
<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;">Playing Milian: cetero censeo QList delendam esset.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">-> use QVector \
;-)</p></pre> </blockquote>
<p>On August 31st, 2015, 12:14 p.m. CEST, <b>Kai Uwe Broulik</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;">I though QList was only evil if sizeof T is <= void* ?</p></pre> \
</blockquote>
</blockquote>
<pre style="margin-left: 1em; 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;">Please see \
https://marcmutz.wordpress.com/effective-qt/containers/ - section on QVector and QList. Random quote: \
"Guideline: Avoid QList<T> where T is not declared as either Q_MOVABLE_TYPE or Q_PRIMITIVE_TYPE or \
where sizeof(T) != sizeof(void*) (remember to check both 32 and 64-bit platforms)."</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I think \
you hit all conditions here on when to avoid.</p></pre> <br />
<p>- Martin</p>
<br />
<p>On August 29th, 2015, 4:14 p.m. CEST, Kai Uwe Broulik 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 Plasma and Martin Gräßlin.</div>
<div>By Kai Uwe Broulik.</div>
<p style="color: grey;"><i>Updated Aug. 29, 2015, 4:14 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-workspace
</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;">This way it can be used in the lock screen, \
user switcher, and a user switcher plasmoid I'm planning.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Compared to the one in the lock screen it \
can also get the user's full name and avatar, and some other information.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Perhaps we could also try \
to have it wait for the screen to actually lock before switching sessions?</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;">Lists my sessions, allows to switch between \
them and start new ones. Locking when creating a new session is missing.</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>components/CMakeLists.txt <span style="color: grey">(21fc61c)</span></li>
<li>components/sessionsprivate/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>
<li>components/sessionsprivate/qmldir <span style="color: grey">(PRE-CREATION)</span></li>
<li>components/sessionsprivate/sessionsmodel.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>components/sessionsprivate/sessionsmodel.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>components/sessionsprivate/sessionsprivateplugin.h <span style="color: \
grey">(PRE-CREATION)</span></li>
<li>components/sessionsprivate/sessionsprivateplugin.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/124980/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============4633808765424792291==--
[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