-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure .owncloudsync.log has the correct encoding #9571
Conversation
9a7400d
to
576e17d
Compare
Results for GUI-tests https://drone.owncloud.com/owncloud/client/11357/6/1 |
|
||
// we use a text stream to ensure the encoding is ok | ||
// when outputiing info we use QDebug to ensure we can use the debug operatos | ||
_out.reset(new QTextStream(_file.data())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By changing this from QDebug to QTextStream, don't you loose the formatting of standard types (QDateTime) that QDebug has? QDebug also takes an IODevice in the constructor which you could set an encoding before passing it on to QDebug.
For me this is a risky and not not really needed refactoring tbh. We really should not accidentially change any formatting of the file as people might parse it etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats why I still use QDebug in the 3 functions.
I only switched to QDebug 6 month ago, but utf8 never worked on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QIODevice
and subclasses do not provide any kind of encoding feature, only QTextStream
provides this. However, a QTextStream
is not a QIODevice
, and cannot it be wrapped by one (actually, it works the other way round, you can open a QTextStream
for a QIODevice
).
So, yes, would be nice to have, but it's not possible in Qt at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, yes. Sorry.
Co-authored-by: Fabian Müller <80399010+fmoc@users.noreply.github.com>
Co-authored-by: Fabian Müller <80399010+fmoc@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! |
No description provided.