fix: stop eating memory and added header guards

This commit is contained in:
Qv2ray-dev 2020-03-21 20:33:37 +08:00
parent b6ea1d9a96
commit 09bbf7651d
7 changed files with 7 additions and 4 deletions

View File

@ -50,7 +50,7 @@ namespace Qv2ray::common
} }
// //
template<typename TYPE> template<typename TYPE>
QString StructToJsonString(const TYPE t) QString StructToJsonString(const TYPE &t)
{ {
return QString::fromStdString(x2struct::X::tojson(t, "", 4, ' ')); return QString::fromStdString(x2struct::X::tojson(t, "", 4, ' '));
} }

View File

@ -1,6 +1,6 @@
#pragma once
#include "base/Qv2rayBase.hpp" #include "base/Qv2rayBase.hpp"
#include "core/CoreSafeTypes.hpp" #include "core/CoreSafeTypes.hpp"
namespace Qv2ray::core::connection namespace Qv2ray::core::connection
{ {
namespace ConnectionIO namespace ConnectionIO

View File

@ -1,3 +1,4 @@
#pragma once
#include "base/Qv2rayBase.hpp" #include "base/Qv2rayBase.hpp"
namespace Qv2ray::core::connection namespace Qv2ray::core::connection

View File

@ -1,3 +1,4 @@
#pragma once
#include "base/Qv2rayBase.hpp" #include "base/Qv2rayBase.hpp"
#include "core/CoreSafeTypes.hpp" #include "core/CoreSafeTypes.hpp"

View File

@ -1,3 +1,4 @@
#pragma once
#include "base/Qv2rayBase.hpp" #include "base/Qv2rayBase.hpp"
namespace Qv2ray::core::config namespace Qv2ray::core::config

View File

@ -806,7 +806,7 @@ void PreferencesWindow::on_nsBarFontSizeSB_valueChanged(double arg1)
SET_LINE_LIST_TEXT SET_LINE_LIST_TEXT
} }
QString PreferencesWindow::GetBarLineDescription(QvBarLine barLine) QString PreferencesWindow::GetBarLineDescription(const QvBarLine &barLine)
{ {
QString result = "Empty"; QString result = "Empty";
result = NetSpeedPluginMessages[barLine.ContentType]; result = NetSpeedPluginMessages[barLine.ContentType];

View File

@ -172,7 +172,7 @@ class PreferencesWindow
void SetAutoStartButtonsState(bool isAutoStart); void SetAutoStartButtonsState(bool isAutoStart);
// Set ui parameters for a line; // Set ui parameters for a line;
void ShowLineParameters(QvBarLine &line); void ShowLineParameters(QvBarLine &line);
QString GetBarLineDescription(QvBarLine line); QString GetBarLineDescription(const QvBarLine &barLine);
// //
int CurrentBarLineId; int CurrentBarLineId;
int CurrentBarPageId; int CurrentBarPageId;