完成部分http功能
This commit is contained in:
@@ -81,6 +81,7 @@ void FileConfigDecode::setAutoCopy(bool value)
|
||||
|
||||
void FileConfigDecode::fileWrite(QString path, QString address, quint16 port, bool autosetup, bool rename, bool timerename, bool autocopy)
|
||||
{
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QSettings* config = new QSettings(path, QSettings::IniFormat);
|
||||
config->setIniCodec(QTextCodec::codecForName("utf-8"));
|
||||
QString section = QString("config");
|
||||
@@ -93,6 +94,20 @@ void FileConfigDecode::fileWrite(QString path, QString address, quint16 port, bo
|
||||
config->setValue("autocopy", autocopy);
|
||||
config->endGroup();
|
||||
delete config;
|
||||
#else
|
||||
QSettings* config = new QSettings(path, QSettings::IniFormat);
|
||||
|
||||
QString section = QString("config");
|
||||
config->beginGroup(section);
|
||||
config->setValue("address", address);
|
||||
config->setValue("port", port);
|
||||
config->setValue("autosetup", autosetup);
|
||||
config->setValue("rename", rename);
|
||||
config->setValue("timerename", timerename);
|
||||
config->setValue("autocopy", autocopy);
|
||||
config->endGroup();
|
||||
delete config;
|
||||
#endif
|
||||
}
|
||||
|
||||
void FileConfigDecode::initFile()
|
||||
@@ -103,7 +118,6 @@ void FileConfigDecode::initFile()
|
||||
QFile file(addFilePath);
|
||||
if (file.exists()) {
|
||||
QSettings* config = new QSettings(addFilePath, QSettings::IniFormat);
|
||||
config->setIniCodec(QTextCodec::codecForName("utf-8"));
|
||||
QString section = "config/";
|
||||
|
||||
this->address = config->value(section + "address").toString();
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <QFile>
|
||||
#include <QSettings>
|
||||
#include <QFileInfo>
|
||||
#if (QT_VERSION <= QT_VERSION_CHECK(6, 0, 0))
|
||||
#include <QTextCodec>
|
||||
#endif
|
||||
|
||||
class FileConfigDecode
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user