--===============8290751599391504188== Content-Type: multipart/alternative; boundary="===============4633808765424792291==" --===============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 > > > > > > 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 > > > > > > 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 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
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/124980/

On August 31st, 2015, 8:25 a.m. CEST, Martin Gräßlin wrote:

components/sessionsprivate/sessionsmodel.h (Diff revision 1)
56
    enum Roles {

suggestion: enum class, and then drop the Role from each name. Usage will be e.g. Roles::Icon

On August 31st, 2015, 12:14 p.m. CEST, 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 August 31st, 2015, 8:25 a.m. CEST, Martin Gräßlin wrote:

components/sessionsprivate/sessionsmodel.h (Diff revision 1)
85
    QList<SessionEntry> m_data;

Playing Milian: cetero censeo QList delendam esset.

-> use QVector ;-)

On August 31st, 2015, 12:14 p.m. CEST, 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


On August 29th, 2015, 4:14 p.m. CEST, Kai Uwe Broulik wrote:

Review request for Plasma and Martin Gräßlin.
By Kai Uwe Broulik.

Updated Aug. 29, 2015, 4:14 p.m.

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?

Testing

Lists my sessions, allows to switch between them and start new ones. Locking when creating a new session is missing.

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)

View Diff

--===============4633808765424792291==-- --===============8290751599391504188== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KUGxhc21hLWRl dmVsIG1haWxpbmcgbGlzdApQbGFzbWEtZGV2ZWxAa2RlLm9yZwpodHRwczovL21haWwua2RlLm9y Zy9tYWlsbWFuL2xpc3RpbmZvL3BsYXNtYS1kZXZlbAo= --===============8290751599391504188==--