Browse Source

refactor(startup): clang-format changes to edited files

reviewable/pr5711/r5
jenli669 6 years ago
parent
commit
72b39adb75
No known key found for this signature in database
GPG Key ID: 8267F9F7C2BF7E5E
  1. 4
      src/model/profile/profileinfo.cpp
  2. 3
      src/persistence/profile.h
  3. 11
      src/persistence/settings.cpp

4
src/model/profile/profileinfo.cpp

@ -342,8 +342,8 @@ IProfileInfo::SetAvatarResult ProfileInfo::byteArrayToPng(QByteArray inData, QBy
} }
if (format == "png") { if (format == "png") {
// FIXME: re-encode the png even though inData is already valid. This strips the metadata since // FIXME: re-encode the png even though inData is already valid. This strips the metadata
// we don't have a good png metadata stripping method currently. // since we don't have a good png metadata stripping method currently.
outPng = picToPng(image); outPng = picToPng(image);
} else { } else {
outPng = picToPng(image); outPng = picToPng(image);

3
src/persistence/profile.h

@ -97,7 +97,8 @@ private slots:
void onAvatarOfferReceived(uint32_t friendId, uint32_t fileId, const QByteArray& avatarHash); void onAvatarOfferReceived(uint32_t friendId, uint32_t fileId, const QByteArray& avatarHash);
private: private:
Profile(QString name, const QString& password, bool newProfile, const QByteArray& toxsave, std::unique_ptr<ToxEncrypt> passKey); Profile(QString name, const QString& password, bool newProfile, const QByteArray& toxsave,
std::unique_ptr<ToxEncrypt> passKey);
static QStringList getFilesByExt(QString extension); static QStringList getFilesByExt(QString extension);
QString avatarPath(const ToxPk& owner, bool forceUnencrypted = false); QString avatarPath(const ToxPk& owner, bool forceUnencrypted = false);
bool saveToxSave(QByteArray data); bool saveToxSave(QByteArray data);

11
src/persistence/settings.cpp

@ -143,9 +143,11 @@ void Settings::loadGlobal()
} }
autoAwayTime = s.value("autoAwayTime", 10).toInt(); autoAwayTime = s.value("autoAwayTime", 10).toInt();
checkUpdates = s.value("checkUpdates", true).toBool(); checkUpdates = s.value("checkUpdates", true).toBool();
notifySound = s.value("notifySound", true).toBool(); // note: notifySound and busySound UI elements are now under UI settings // note: notifySound and busySound UI elements are now under UI settings
// page, but kept under General in settings file to be backwards compatible
notifySound = s.value("notifySound", true).toBool();
notifyHide = s.value("notifyHide", false).toBool(); notifyHide = s.value("notifyHide", false).toBool();
busySound = s.value("busySound", false).toBool(); // page, but kept under General in settings file to be backwards compatible busySound = s.value("busySound", false).toBool();
autoSaveEnabled = s.value("autoSaveEnabled", false).toBool(); autoSaveEnabled = s.value("autoSaveEnabled", false).toBool();
globalAutoAcceptDir = s.value("globalAutoAcceptDir", globalAutoAcceptDir = s.value("globalAutoAcceptDir",
QStandardPaths::locate(QStandardPaths::HomeLocation, QString(), QStandardPaths::locate(QStandardPaths::HomeLocation, QString(),
@ -338,7 +340,7 @@ void Settings::loadPersonal(QString profileName, const ToxEncrypt* passKey)
fp.circleID = ps.value("circle", -1).toInt(); fp.circleID = ps.value("circle", -1).toInt();
if (getEnableLogging()) if (getEnableLogging())
fp.activity = ps.value("activity", QDateTime()).toDateTime(); fp.activity = ps.value("activity", QDateTime()).toDateTime();
friendLst.insert(ToxId(fp.addr).getPublicKey().getByteArray(), fp); friendLst.insert(ToxId(fp.addr).getPublicKey().getByteArray(), fp);
} }
ps.endArray(); ps.endArray();
@ -365,7 +367,8 @@ void Settings::loadPersonal(QString profileName, const ToxEncrypt* passKey)
ps.beginGroup("GUI"); ps.beginGroup("GUI");
{ {
compactLayout = ps.value("compactLayout", true).toBool(); compactLayout = ps.value("compactLayout", true).toBool();
sortingMode = static_cast<FriendListSortingMode>(ps.value("friendSortingMethod", static_cast<int>(FriendListSortingMode::Name)).toInt()); sortingMode = static_cast<FriendListSortingMode>(
ps.value("friendSortingMethod", static_cast<int>(FriendListSortingMode::Name)).toInt());
} }
ps.endGroup(); ps.endGroup();

Loading…
Cancel
Save