Skip to content
Snippets Groups Projects
Commit eacf5bb4 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

misc: apply clang-formatting

Change-Id: I9d2ec496aa8d6cc0a41f9096ad153308c3308e8b
parent ae058405
No related branches found
No related tags found
No related merge requests found
Showing
with 134 additions and 139 deletions
......@@ -74,8 +74,7 @@ AccountListModel::data(const QModelIndex &index, int role) const
case Role::Username:
return QVariant(Utils::secondBestNameForAccount(accountInfo));
case Role::Type:
return QVariant(
static_cast<int>(accountInfo.profileInfo.type));
return QVariant(static_cast<int>(accountInfo.profileInfo.type));
case Role::Status:
return QVariant(static_cast<int>(accountInfo.status));
case Role::Picture:
......
......@@ -27,9 +27,10 @@
#include <QString>
#include <QStandardPaths>
const QString defaultDownloadPath =
QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
const QString defaultDownloadPath = QStandardPaths::writableLocation(
QStandardPaths::DownloadLocation);
// clang-format off
#define KEYS \
X(MinimizeOnClose, true) \
X(DownloadPath, defaultDownloadPath) \
......@@ -78,6 +79,7 @@ private:
Settings() = delete;
};
Q_DECLARE_METATYPE(Settings::Key)
// clang-format on
/*
* A singleton object to manage settings access.
......@@ -90,37 +92,30 @@ public:
static AppSettingsManager& instance()
{
static AppSettingsManager *instance_ =
new AppSettingsManager(nullptr);
static AppSettingsManager* instance_ = new AppSettingsManager(nullptr);
return *instance_;
}
static QVariant
getValue(const Settings::Key key)
static QVariant getValue(const Settings::Key key)
{
auto settings = instance().settings_;
auto value = settings->value(Settings::toString(key),
Settings::defaultValue(key));
auto value = settings->value(Settings::toString(key), Settings::defaultValue(key));
if (QString(value.typeName()) == "QString" &&
(value.toString() == "false" || value.toString() == "true"))
if (QString(value.typeName()) == "QString"
&& (value.toString() == "false" || value.toString() == "true"))
return value.toBool();
return value;
}
static void
setValue(const Settings::Key key, const QVariant& value)
static void setValue(const Settings::Key key, const QVariant& value)
{
instance().settings_->setValue(Settings::toString(key), value);
}
static void
initValues()
static void initValues()
{
for (int i = 0;
i < static_cast<int>(Settings::Key::COUNT__);
++i) {
for (int i = 0; i < static_cast<int>(Settings::Key::COUNT__); ++i) {
auto key = static_cast<Settings::Key>(i);
if (!instance().settings_->contains(Settings::toString(key)))
setValue(key, Settings::defaultValue(key));
......@@ -129,7 +124,8 @@ public:
private:
explicit AppSettingsManager(QObject*)
: settings_(new QSettings("jami.net", "Jami", this)) {}
: settings_(new QSettings("jami.net", "Jami", this))
{}
QSettings* settings_;
};
......@@ -64,5 +64,4 @@ protected:
* Select screen area to display.
*/
Q_INVOKABLE void shareScreenArea(int screenNumber, int x, int y, int width, int height);
};
......@@ -319,7 +319,8 @@ CallAdapter::connectCallModel(const QString& accountId)
bestName = Utils::bestNameForContact(contact);
if (participant["videoMuted"] == "true")
data["avatar"] = contact.profileInfo.avatar;
} catch (...) {}
} catch (...) {
}
}
data["bestName"] = bestName;
map.push_back(QVariant(data));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment