mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
utils: Remove text file Get/Set methods from Platform
No longer needed, and using Qt isn't good anyway
This commit is contained in:
parent
bdf812dc09
commit
42e7eb6c34
@ -21,7 +21,6 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
#include <QCommandLineParser>
|
||||
#include <QNetworkInterface>
|
||||
#include <QHostAddress>
|
||||
#include <QFile>
|
||||
#include <obs-frontend-api.h>
|
||||
|
||||
#include "Platform.h"
|
||||
@ -126,27 +125,3 @@ void Utils::Platform::SendTrayNotification(QSystemTrayIcon::MessageIcon icon, QS
|
||||
},
|
||||
(void *)notification, false);
|
||||
}
|
||||
|
||||
bool Utils::Platform::GetTextFileContent(std::string fileName, std::string &content)
|
||||
{
|
||||
QFile f(QString::fromStdString(fileName));
|
||||
if (!f.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return false;
|
||||
|
||||
content = f.readAll().toStdString();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Utils::Platform::SetTextFileContent(std::string fileName, std::string content, bool createNew)
|
||||
{
|
||||
if (!createNew && !QFile::exists(QString::fromStdString(fileName)))
|
||||
return false;
|
||||
|
||||
QFile f(QString::fromStdString(fileName));
|
||||
if (!f.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
return false;
|
||||
|
||||
QTextStream out(&f);
|
||||
out << content.c_str();
|
||||
return true;
|
||||
}
|
||||
|
@ -29,7 +29,5 @@ namespace Utils {
|
||||
QString GetCommandLineArgument(QString arg);
|
||||
bool GetCommandLineFlagSet(QString arg);
|
||||
void SendTrayNotification(QSystemTrayIcon::MessageIcon icon, QString title, QString body);
|
||||
bool GetTextFileContent(std::string fileName, std::string &content);
|
||||
bool SetTextFileContent(std::string filePath, std::string content, bool createNew = true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user