mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-24 15:36:33 +00:00
Add QIODevice::Text for text writing, to convert newlines. Refs #1246
This commit is contained in:
@@ -3235,7 +3235,12 @@ void BufferViewer::exportData(const BufferExport ¶ms)
|
||||
|
||||
QFile *f = new QFile(filename);
|
||||
|
||||
if(!f->open(QIODevice::WriteOnly | QFile::Truncate))
|
||||
QIODevice::OpenMode flags = QIODevice::WriteOnly | QFile::Truncate;
|
||||
|
||||
if(params.format == BufferExport::CSV)
|
||||
flags |= QIODevice::Text;
|
||||
|
||||
if(!f->open(flags))
|
||||
{
|
||||
delete f;
|
||||
RDDialog::critical(this, tr("Error exporting file"),
|
||||
|
||||
@@ -211,7 +211,7 @@ void ConstantBufferPreviewer::on_saveCSV_clicked()
|
||||
if(dirinfo.exists())
|
||||
{
|
||||
QFile f(filename, this);
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate))
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||
{
|
||||
QTextStream ts(&f);
|
||||
|
||||
|
||||
@@ -673,7 +673,7 @@ void EventBrowser::on_exportDraws_clicked()
|
||||
if(dirinfo.exists())
|
||||
{
|
||||
QFile f(filename);
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate))
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||
{
|
||||
QTextStream stream(&f);
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ void PerformanceCounterViewer::on_saveCSV_clicked()
|
||||
if(dirinfo.exists())
|
||||
{
|
||||
QFile f(filename, this);
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate))
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||
{
|
||||
QTextStream ts(&f);
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ void PythonShell::on_saveScript_clicked()
|
||||
if(dirinfo.exists())
|
||||
{
|
||||
QFile f(filename);
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate))
|
||||
if(f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||
{
|
||||
f.write(scriptEditor->getText(scriptEditor->textLength() + 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user