D28105: Send keyboard map from a read only source

Vlad Zahorodnii <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.