[Qt-interest] why QTemporaryFile::open is not allowing specify flags?

Malyushytsky, Alex alex at wai.com
Fri Oct 8 04:13:16 CEST 2010


>> Firstly, temporary files aren't meant to be used/edited by the user.

There is no reason to assume temporary file context will not be read or even modified by user directly or indirectly.
Logically temporary file is just a 'temporary' file and user may be accessed within it life cycle.

For example log file may be a temporary file by design.
In my case this file contains input to other computation tool which will be started and monitored by my application.
And advanced user of such tool may want to see and modify it in editor of his choice after this information is generated but before this tool is invoked.

There is no assumptions can or should be done about nature of the file. 
The only special feature about this class - it is guarantee file not to survive longer than application ( QTemporaryFile object ) which opens it.


>> Secondly, doesn't setTextModeEnabled() solve the problem?

It does fix the need to override QTemporaryFile which I missed, 
but does not explain why it can't be done anymore with open.


Regards,
    Alex





-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Constantin Makshin
Sent: Wednesday, October 06, 2010 10:37 PM
To: Qt Interest
Subject: Re: [Qt-interest] why QTemporaryFile::open is not allowing specify flags?

Firstly, temporary files aren't meant to be used/edited by the user.

Secondly, doesn't setTextModeEnabled() solve the problem?

On Thursday 07 October 2010 06:41:38 Malyushytsky, Alex wrote:
> Is there any specific reason to prevent user specify flags in QTemporaryFile::open() (make derived function protected) ?
> Correct me if I am wrong, but I see no way to specify QIODevice::Text flag now, which means my files are not human readable on Windows due to the absence of Windows style line break.
> 
> Isn't it strange I need to override just in order to access inherited functionality?
> 
> Regards,
> 
> Alex Malyushytsky
> 
> Research Engineer - Weidlinger Associates Inc.
> office: 650 230 0210,
> direct: 650 230 0349
> web: http://www.wai.com
> 
> 
> ---------------------------------------------------------------------------------------------------
> Weidlinger Associates, Inc. made the following annotations.
> 
> “This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”
> 
> “Please consider our environment before printing this email.”
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list