1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore(formatting): disable clang-format for certain code sections

This commit is contained in:
sudden6 2017-06-01 09:41:47 +02:00
parent d87f222c5c
commit a1181e10f2
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
3 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,7 @@ enum TextStyle
static const QString HTML_CHARACTER_CODE = QStringLiteral("&#%1"); static const QString HTML_CHARACTER_CODE = QStringLiteral("&#%1");
// clang-format off
static const QVector<char> MARKDOWN_SYMBOLS { static const QVector<char> MARKDOWN_SYMBOLS {
'*', '*',
'/', '/',
@ -97,6 +98,7 @@ static const QVector<QRegularExpression> urlPatterns {
QRegularExpression("\\b(mailto|tox):[^ \\n]+@[^ \\n]+") QRegularExpression("\\b(mailto|tox):[^ \\n]+@[^ \\n]+")
}; };
// clang-format on
/** /**
* @class TextFormatter * @class TextFormatter
* *

View File

@ -93,6 +93,7 @@ CameraSource::CameraSource()
: deviceName{"none"} : deviceName{"none"}
, device{nullptr} , device{nullptr}
, mode(VideoMode()) , mode(VideoMode())
// clang-format off
, cctx{nullptr} , cctx{nullptr}
#if LIBAVCODEC_VERSION_INT < 3747941 #if LIBAVCODEC_VERSION_INT < 3747941
, cctxOrig{nullptr} , cctxOrig{nullptr}
@ -107,6 +108,8 @@ CameraSource::CameraSource()
avdevice_register_all(); avdevice_register_all();
} }
// clang-format on
/** /**
* @brief Returns the singleton instance. * @brief Returns the singleton instance.
*/ */

View File

@ -57,6 +57,7 @@ Time getTime(const QDate& date)
} }
QDate today = QDate::currentDate(); QDate today = QDate::currentDate();
// clang-format off
const QMap<Time, QDate> dates { const QMap<Time, QDate> dates {
{ Time::Today, today.addDays(0) }, { Time::Today, today.addDays(0) },
{ Time::Yesterday, today.addDays(-1) }, { Time::Yesterday, today.addDays(-1) },
@ -68,6 +69,7 @@ Time getTime(const QDate& date)
{ Time::Month4Ago, today.addMonths(-5) }, { Time::Month4Ago, today.addMonths(-5) },
{ Time::Month5Ago, today.addMonths(-6) }, { Time::Month5Ago, today.addMonths(-6) },
}; };
// clang-format on
for (Time time : dates.keys()) { for (Time time : dates.keys()) {
if (dates[time] <= date) { if (dates[time] <= date) {
@ -193,6 +195,7 @@ void FriendListWidget::setMode(Mode mode)
QLocale ql(Settings::getInstance().getTranslation()); QLocale ql(Settings::getInstance().getTranslation());
QDate today = QDate::currentDate(); QDate today = QDate::currentDate();
#define COMMENT "Category for sorting friends by activity" #define COMMENT "Category for sorting friends by activity"
// clang-format off
const QMap<Time, QString> names { const QMap<Time, QString> names {
{ Time::Today, tr("Today", COMMENT) }, { Time::Today, tr("Today", COMMENT) },
{ Time::Yesterday, tr("Yesterday", COMMENT) }, { Time::Yesterday, tr("Yesterday", COMMENT) },
@ -206,6 +209,7 @@ void FriendListWidget::setMode(Mode mode)
{ Time::Month4Ago, ql.monthName(today.addMonths(-4).month()) }, { Time::Month4Ago, ql.monthName(today.addMonths(-4).month()) },
{ Time::Month5Ago, ql.monthName(today.addMonths(-5).month()) }, { Time::Month5Ago, ql.monthName(today.addMonths(-5).month()) },
}; };
// clang-format on
#undef COMMENT #undef COMMENT
activityLayout = new QVBoxLayout(); activityLayout = new QVBoxLayout();