D28105: Send keyboard map from a read only source

Vlad Zahorodnii noreply at phabricator.kde.org
Tue Mar 17 18:25:17 GMT 2020


zzag added inline comments.

INLINE COMMENTS

> xkb.cpp:297
>  
> -    QTemporaryFile *tmp = new QTemporaryFile(this);
> +    QScopedPointer<QTemporaryFile> tmp(new QTemporaryFile);
>      if (!tmp->open()) {

Would it be okay if the QTemporaryFile is allocated on the stack? e.g.

  QTemporaryFile keymapFile;

(asking out of curiosity)

> xkb.cpp:313
> +
> +    QFile *readOnlyTemp = new QFile(tmp->fileName(), this);
> +    if (!readOnlyTemp->open(QFileDevice::ReadOnly)) {

Noob question: why do we need another QFile object?

I'm just trying to understand why we can't do something along these lines

  tmp->setPermissions(QFileDevice::ReadOwner);
  m_seat->setKeymap(tmp->handle(), size);

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D28105

To: davidedmundson, #kwin
Cc: zzag, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20200317/a46c47e6/attachment-0001.html>


More information about the kwin mailing list