mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Code clean up
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#ifndef UTILS_STRING_H
|
||||
#define UTILS_STRING_H
|
||||
|
||||
#include <QLatin1String>
|
||||
#include <QChar>
|
||||
#include <QVector>
|
||||
|
||||
class QString;
|
||||
@@ -54,13 +54,13 @@ namespace Utils
|
||||
QString wildcardToRegex(const QString &pattern);
|
||||
|
||||
template <typename T>
|
||||
T unquote(const T &str, const QString "es = QLatin1String("\""))
|
||||
T unquote(const T &str, const QString "es = QChar('"'))
|
||||
{
|
||||
if (str.length() < 2) return str;
|
||||
|
||||
for (const auto "e : quotes) {
|
||||
for (const QChar quote : quotes) {
|
||||
if (str.startsWith(quote) && str.endsWith(quote))
|
||||
return str.mid(1, str.length() - 2);
|
||||
return str.mid(1, (str.length() - 2));
|
||||
}
|
||||
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user