summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Util.cpp4
-rw-r--r--src/Util.hpp8
2 files changed, 9 insertions, 3 deletions
diff --git a/src/Util.cpp b/src/Util.cpp
index 4db3773..78dd8d2 100644
--- a/src/Util.cpp
+++ b/src/Util.cpp
@@ -1,8 +1,10 @@
#include "Util.hpp"
namespace Util {
- QString& trimQuotes(QString&& string, bool& trimmed)
+ QString trimQuotes(QString string, bool& trimmed)
{
+ if(string.isEmpty()) return string;
+
trimmed = false;
if(string.length() >= 2 && string.at(0) == '"' && string.at(string.length() - 1) == '"')
{
diff --git a/src/Util.hpp b/src/Util.hpp
index b0d1f78..5826b1b 100644
--- a/src/Util.hpp
+++ b/src/Util.hpp
@@ -1,8 +1,12 @@
#pragma once
#include <QString>
+#include <QMap>
namespace Util {
- QString& trimQuotes(QString&& string, bool& trimmed);
- QString& trimQuotes(const QString& string, bool& trimmed);
+ static const QMap<QChar, QChar> unescapeChars {
+ {'n', '\n'},
+ };
+
+ QString trimQuotes(QString string, bool& trimmed);
}