mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-11 04:35:44 -08:00
Changed C to Qt file handling. VC warns because fopen may be unsafe.
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -28,7 +30,6 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "window_main.h"
|
#include "window_main.h"
|
||||||
@@ -56,11 +57,11 @@ QString translationPath = QString();
|
|||||||
|
|
||||||
void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
void myMessageOutput(QtMsgType /*type*/, const char *msg)
|
||||||
{
|
{
|
||||||
static FILE *f = NULL;
|
QFile file("qdebug.txt");
|
||||||
if (!f)
|
file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||||
f = fopen("qdebug.txt", "w");
|
QTextStream out(&file);
|
||||||
fprintf(f, "%s\n", msg);
|
out << msg << "\n";
|
||||||
fflush(f);
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void installNewTranslator()
|
void installNewTranslator()
|
||||||
|
|||||||
Reference in New Issue
Block a user