mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Code clean up
This commit is contained in:
parent
4539c679d9
commit
307ca61c86
3 changed files with 14 additions and 14 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue