Skip to content

Commit 103a7e1

Browse files
committed
clang-format
1 parent f4a8a28 commit 103a7e1

23 files changed

+3238
-2386
lines changed

.clang-format

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1-
---
1+
Language: Cpp
22
BasedOnStyle: WebKit
3-
BreakBeforeBraces: Stroustrup
4-
Cpp11BracedListStyle: 'true'
5-
Language: Cpp
6-
Standard: Auto
7-
UseTab: Never
3+
Standard: Cpp11
4+
TabWidth: 4
5+
ColumnLimit: 120
6+
SortIncludes: true
87

9-
...
8+
# Mostly 'Linux' style but with different enums
9+
BreakBeforeBraces: Custom
10+
BraceWrapping:
11+
AfterEnum: true
12+
AfterStruct: true
13+
AfterClass: true
14+
AfterCaseLabel: true
15+
AfterFunction: true
16+
17+
PointerAlignment: Left
18+
AlignAfterOpenBracket: Align
19+
AlignTrailingComments: true
20+
AllowAllParametersOfDeclarationOnNextLine: false
21+
AllowShortFunctionsOnASingleLine: None
22+
AlwaysBreakBeforeMultilineStrings: true
23+
BinPackArguments: false
24+
BinPackParameters: false
25+
BreakBeforeBinaryOperators: None
26+
Cpp11BracedListStyle: true
27+
KeepEmptyLinesAtTheStartOfBlocks: false
28+
NamespaceIndentation: None
29+
SpaceAfterTemplateKeyword: false
30+
AlignConsecutiveDeclarations: true

src/adaptors.cpp

Lines changed: 66 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ QByteArrayList BlockAdaptor::symlinks() const
195195
void BlockAdaptor::AddConfigurationItem(Configuration item, const QVariantMap& options)
196196
{
197197
// handle method call org.freedesktop.UDisks2.Block.AddConfigurationItem
198-
QMetaObject::invokeMethod(parent(), "AddConfigurationItem", Q_ARG(Configuration, item), Q_ARG(QVariantMap, options));
198+
QMetaObject::invokeMethod(
199+
parent(), "AddConfigurationItem", Q_ARG(Configuration, item), Q_ARG(QVariantMap, options));
199200
}
200201

201202
void BlockAdaptor::Format(const QString& type, const QVariantMap& options)
@@ -208,38 +209,45 @@ ConfigurationList BlockAdaptor::GetSecretConfiguration(const QVariantMap& option
208209
{
209210
// handle method call org.freedesktop.UDisks2.Block.GetSecretConfiguration
210211
ConfigurationList configuration;
211-
QMetaObject::invokeMethod(parent(), "GetSecretConfiguration", Q_RETURN_ARG(ConfigurationList, configuration), Q_ARG(QVariantMap, options));
212+
QMetaObject::invokeMethod(parent(),
213+
"GetSecretConfiguration",
214+
Q_RETURN_ARG(ConfigurationList, configuration),
215+
Q_ARG(QVariantMap, options));
212216
return configuration;
213217
}
214218

215219
QDBusUnixFileDescriptor BlockAdaptor::OpenForBackup(const QVariantMap& options)
216220
{
217221
// handle method call org.freedesktop.UDisks2.Block.OpenForBackup
218222
QDBusUnixFileDescriptor fd;
219-
QMetaObject::invokeMethod(parent(), "OpenForBackup", Q_RETURN_ARG(QDBusUnixFileDescriptor, fd), Q_ARG(QVariantMap, options));
223+
QMetaObject::invokeMethod(
224+
parent(), "OpenForBackup", Q_RETURN_ARG(QDBusUnixFileDescriptor, fd), Q_ARG(QVariantMap, options));
220225
return fd;
221226
}
222227

223228
QDBusUnixFileDescriptor BlockAdaptor::OpenForBenchmark(const QVariantMap& options)
224229
{
225230
// handle method call org.freedesktop.UDisks2.Block.OpenForBenchmark
226231
QDBusUnixFileDescriptor fd;
227-
QMetaObject::invokeMethod(parent(), "OpenForBenchmark", Q_RETURN_ARG(QDBusUnixFileDescriptor, fd), Q_ARG(QVariantMap, options));
232+
QMetaObject::invokeMethod(
233+
parent(), "OpenForBenchmark", Q_RETURN_ARG(QDBusUnixFileDescriptor, fd), Q_ARG(QVariantMap, options));
228234
return fd;
229235
}
230236

231237
QDBusUnixFileDescriptor BlockAdaptor::OpenForRestore(const QVariantMap& options)
232238
{
233239
// handle method call org.freedesktop.UDisks2.Block.OpenForRestore
234240
QDBusUnixFileDescriptor fd;
235-
QMetaObject::invokeMethod(parent(), "OpenForRestore", Q_RETURN_ARG(QDBusUnixFileDescriptor, fd), Q_ARG(QVariantMap, options));
241+
QMetaObject::invokeMethod(
242+
parent(), "OpenForRestore", Q_RETURN_ARG(QDBusUnixFileDescriptor, fd), Q_ARG(QVariantMap, options));
236243
return fd;
237244
}
238245

239246
void BlockAdaptor::RemoveConfigurationItem(Configuration item, const QVariantMap& options)
240247
{
241248
// handle method call org.freedesktop.UDisks2.Block.RemoveConfigurationItem
242-
QMetaObject::invokeMethod(parent(), "RemoveConfigurationItem", Q_ARG(Configuration, item), Q_ARG(QVariantMap, options));
249+
QMetaObject::invokeMethod(
250+
parent(), "RemoveConfigurationItem", Q_ARG(Configuration, item), Q_ARG(QVariantMap, options));
243251
}
244252

245253
void BlockAdaptor::Rescan(const QVariantMap& options)
@@ -251,7 +259,11 @@ void BlockAdaptor::Rescan(const QVariantMap& options)
251259
void BlockAdaptor::UpdateConfigurationItem(Configuration old_item, Configuration new_item, const QVariantMap& options)
252260
{
253261
// handle method call org.freedesktop.UDisks2.Block.UpdateConfigurationItem
254-
QMetaObject::invokeMethod(parent(), "UpdateConfigurationItem", Q_ARG(Configuration, old_item), Q_ARG(Configuration, new_item), Q_ARG(QVariantMap, options));
262+
QMetaObject::invokeMethod(parent(),
263+
"UpdateConfigurationItem",
264+
Q_ARG(Configuration, old_item),
265+
Q_ARG(Configuration, new_item),
266+
Q_ARG(QVariantMap, options));
255267
}
256268

257269
/*
@@ -658,7 +670,8 @@ QVariantList AtaAdaptor::SmartGetAttributes(const QVariantMap& options)
658670
{
659671
// handle method call org.freedesktop.UDisks2.Drive.Ata.SmartGetAttributes
660672
QVariantList attributes;
661-
QMetaObject::invokeMethod(parent(), "SmartGetAttributes", Q_RETURN_ARG(QVariantList, attributes), Q_ARG(QVariantMap, options));
673+
QMetaObject::invokeMethod(
674+
parent(), "SmartGetAttributes", Q_RETURN_ARG(QVariantList, attributes), Q_ARG(QVariantMap, options));
662675
return attributes;
663676
}
664677

@@ -702,10 +715,16 @@ EncryptedAdaptor::~EncryptedAdaptor()
702715
// destructor
703716
}
704717

705-
void EncryptedAdaptor::ChangePassphrase(const QString& passphrase, const QString& new_passphrase, const QVariantMap& options)
718+
void EncryptedAdaptor::ChangePassphrase(const QString& passphrase,
719+
const QString& new_passphrase,
720+
const QVariantMap& options)
706721
{
707722
// handle method call org.freedesktop.UDisks2.Encrypted.ChangePassphrase
708-
QMetaObject::invokeMethod(parent(), "ChangePassphrase", Q_ARG(QString, passphrase), Q_ARG(QString, new_passphrase), Q_ARG(QVariantMap, options));
723+
QMetaObject::invokeMethod(parent(),
724+
"ChangePassphrase",
725+
Q_ARG(QString, passphrase),
726+
Q_ARG(QString, new_passphrase),
727+
Q_ARG(QVariantMap, options));
709728
}
710729

711730
void EncryptedAdaptor::Lock(const QVariantMap& options)
@@ -718,7 +737,11 @@ QDBusObjectPath EncryptedAdaptor::Unlock(const QString& passphrase, const QVaria
718737
{
719738
// handle method call org.freedesktop.UDisks2.Encrypted.Unlock
720739
QDBusObjectPath cleartext_device;
721-
QMetaObject::invokeMethod(parent(), "Unlock", Q_RETURN_ARG(QDBusObjectPath, cleartext_device), Q_ARG(QString, passphrase), Q_ARG(QVariantMap, options));
740+
QMetaObject::invokeMethod(parent(),
741+
"Unlock",
742+
Q_RETURN_ARG(QDBusObjectPath, cleartext_device),
743+
Q_ARG(QString, passphrase),
744+
Q_ARG(QVariantMap, options));
722745
return cleartext_device;
723746
}
724747

@@ -801,7 +824,7 @@ qulonglong JobAdaptor::expectedEndTime() const
801824
QList<QDBusObjectPath> JobAdaptor::objects() const
802825
{
803826
// get the value of property Objects
804-
return qvariant_cast<QList<QDBusObjectPath> >(parent()->property("Objects"));
827+
return qvariant_cast<QList<QDBusObjectPath>>(parent()->property("Objects"));
805828
}
806829

807830
QString JobAdaptor::operation() const
@@ -1048,15 +1071,30 @@ QDBusObjectPath ManagerAdaptor::LoopSetup(const QDBusUnixFileDescriptor& fd, con
10481071
{
10491072
// handle method call org.freedesktop.UDisks2.Manager.LoopSetup
10501073
QDBusObjectPath resulting_device;
1051-
QMetaObject::invokeMethod(parent(), "LoopSetup", Q_RETURN_ARG(QDBusObjectPath, resulting_device), Q_ARG(QDBusUnixFileDescriptor, fd), Q_ARG(QVariantMap, options));
1074+
QMetaObject::invokeMethod(parent(),
1075+
"LoopSetup",
1076+
Q_RETURN_ARG(QDBusObjectPath, resulting_device),
1077+
Q_ARG(QDBusUnixFileDescriptor, fd),
1078+
Q_ARG(QVariantMap, options));
10521079
return resulting_device;
10531080
}
10541081

1055-
QDBusObjectPath ManagerAdaptor::MDRaidCreate(const QList<QDBusObjectPath>& blocks, const QString& level, const QString& name, qulonglong chunk, const QVariantMap& options)
1082+
QDBusObjectPath ManagerAdaptor::MDRaidCreate(const QList<QDBusObjectPath>& blocks,
1083+
const QString& level,
1084+
const QString& name,
1085+
qulonglong chunk,
1086+
const QVariantMap& options)
10561087
{
10571088
// handle method call org.freedesktop.UDisks2.Manager.MDRaidCreate
10581089
QDBusObjectPath resulting_array;
1059-
QMetaObject::invokeMethod(parent(), "MDRaidCreate", Q_RETURN_ARG(QDBusObjectPath, resulting_array), Q_ARG(QList<QDBusObjectPath>, blocks), Q_ARG(QString, level), Q_ARG(QString, name), Q_ARG(qulonglong, chunk), Q_ARG(QVariantMap, options));
1090+
QMetaObject::invokeMethod(parent(),
1091+
"MDRaidCreate",
1092+
Q_RETURN_ARG(QDBusObjectPath, resulting_array),
1093+
Q_ARG(QList<QDBusObjectPath>, blocks),
1094+
Q_ARG(QString, level),
1095+
Q_ARG(QString, name),
1096+
Q_ARG(qulonglong, chunk),
1097+
Q_ARG(QVariantMap, options));
10601098
return resulting_array;
10611099
}
10621100

@@ -1182,11 +1220,22 @@ QString PartitionTableAdaptor::type() const
11821220
return qvariant_cast<QString>(parent()->property("PartitionTable_Type"));
11831221
}
11841222

1185-
QDBusObjectPath PartitionTableAdaptor::CreatePartition(qulonglong offset, qulonglong size, const QString& type, const QString& name, const QVariantMap& options)
1223+
QDBusObjectPath PartitionTableAdaptor::CreatePartition(qulonglong offset,
1224+
qulonglong size,
1225+
const QString& type,
1226+
const QString& name,
1227+
const QVariantMap& options)
11861228
{
11871229
// handle method call org.freedesktop.UDisks2.PartitionTable.CreatePartition
11881230
QDBusObjectPath created_partition;
1189-
QMetaObject::invokeMethod(parent(), "CreatePartition", Q_RETURN_ARG(QDBusObjectPath, created_partition), Q_ARG(qulonglong, offset), Q_ARG(qulonglong, size), Q_ARG(QString, type), Q_ARG(QString, name), Q_ARG(QVariantMap, options));
1231+
QMetaObject::invokeMethod(parent(),
1232+
"CreatePartition",
1233+
Q_RETURN_ARG(QDBusObjectPath, created_partition),
1234+
Q_ARG(qulonglong, offset),
1235+
Q_ARG(qulonglong, size),
1236+
Q_ARG(QString, type),
1237+
Q_ARG(QString, name),
1238+
Q_ARG(QVariantMap, options));
11901239
return created_partition;
11911240
}
11921241

0 commit comments

Comments
 (0)