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

refactor(files): clang-format generated whitespace changes

This commit is contained in:
Mick Sayson 2018-10-05 23:05:51 -07:00
parent f7df1191bc
commit 939f2c865a
4 changed files with 39 additions and 27 deletions

View File

@ -272,9 +272,9 @@ void Settings::loadGlobal()
enableTestSound = s.value("enableTestSound", true).toBool();
audioBitrate = s.value("audioBitrate", 64).toInt();
enableBackend2 = false;
#ifdef USE_FILTERAUDIO
#ifdef USE_FILTERAUDIO
enableBackend2 = s.value("enableBackend2", false).toBool();
#endif
#endif
}
s.endGroup();

View File

@ -43,8 +43,11 @@ namespace Db {
enum class syncType;
}
class Settings : public QObject, public ICoreSettings, public IFriendSettings,
public IAudioSettings, public IVideoSettings
class Settings : public QObject,
public ICoreSettings,
public IFriendSettings,
public IAudioSettings,
public IVideoSettings
{
Q_OBJECT
@ -91,8 +94,8 @@ class Settings : public QObject, public ICoreSettings, public IFriendSettings,
Q_PROPERTY(QString dateFormat READ getDateFormat WRITE setDateFormat NOTIFY dateFormatChanged FINAL)
Q_PROPERTY(bool statusChangeNotificationEnabled READ getStatusChangeNotificationEnabled WRITE
setStatusChangeNotificationEnabled NOTIFY statusChangeNotificationEnabledChanged FINAL)
Q_PROPERTY(bool spellCheckingEnabled READ getSpellCheckingEnabled WRITE
setSpellCheckingEnabled NOTIFY spellCheckingEnabledChanged FINAL)
Q_PROPERTY(bool spellCheckingEnabled READ getSpellCheckingEnabled WRITE setSpellCheckingEnabled
NOTIFY spellCheckingEnabledChanged FINAL)
// Privacy
Q_PROPERTY(bool typingNotification READ getTypingNotification WRITE setTypingNotification NOTIFY
@ -105,8 +108,8 @@ class Settings : public QObject, public ICoreSettings, public IFriendSettings,
audioInDevEnabledChanged FINAL)
Q_PROPERTY(qreal audioInGainDecibel READ getAudioInGainDecibel WRITE setAudioInGainDecibel
NOTIFY audioInGainDecibelChanged FINAL)
Q_PROPERTY(qreal audioThreshold READ getAudioThreshold WRITE setAudioThreshold
NOTIFY audioThresholdChanged FINAL)
Q_PROPERTY(qreal audioThreshold READ getAudioThreshold WRITE setAudioThreshold NOTIFY
audioThresholdChanged FINAL)
Q_PROPERTY(QString outDev READ getOutDev WRITE setOutDev NOTIFY outDevChanged FINAL)
Q_PROPERTY(bool audioOutDevEnabled READ getAudioOutDevEnabled WRITE setAudioOutDevEnabled NOTIFY
audioOutDevEnabledChanged FINAL)
@ -352,8 +355,14 @@ public:
void setAudioThreshold(qreal percent) override;
int getOutVolume() const override;
int getOutVolumeMin() const override { return 0; }
int getOutVolumeMax() const override { return 100; }
int getOutVolumeMin() const override
{
return 0;
}
int getOutVolumeMax() const override
{
return 100;
}
void setOutVolume(int volume) override;
int getAudioBitrate() const override;
@ -491,8 +500,8 @@ public:
void saveFriendSettings(const ToxPk& id) override;
void removeFriendSettings(const ToxPk& id) override;
SIGNAL_IMPL(Settings, autoAcceptCallChanged,
const ToxPk& id, IFriendSettings::AutoAcceptCallFlags accept)
SIGNAL_IMPL(Settings, autoAcceptCallChanged, const ToxPk& id,
IFriendSettings::AutoAcceptCallFlags accept)
SIGNAL_IMPL(Settings, autoGroupInviteChanged, const ToxPk& id, bool accept)
SIGNAL_IMPL(Settings, autoAcceptDirChanged, const ToxPk& id, const QString& dir)
SIGNAL_IMPL(Settings, contactNoteChanged, const ToxPk& id, const QString& note)
@ -508,10 +517,10 @@ public:
bool getDontGroupWindows() const;
void setDontGroupWindows(bool value);
bool getGroupchatPosition() const;
void setGroupchatPosition(bool value);
bool getShowIdenticons() const;
void setShowIdenticons(bool value);

View File

@ -234,7 +234,7 @@ void ChatForm::onSendTriggered()
}
void ChatForm::onFileNameChanged(const ToxPk& friendPk)
{
if(friendPk != f->getPublicKey()) {
if (friendPk != f->getPublicKey()) {
return;
}
@ -266,8 +266,8 @@ void ChatForm::onTextEditChanged()
void ChatForm::onAttachClicked()
{
QStringList paths =
QFileDialog::getOpenFileNames(Q_NULLPTR, tr("Send a file"), QDir::homePath(), nullptr, nullptr);
QStringList paths = QFileDialog::getOpenFileNames(Q_NULLPTR, tr("Send a file"),
QDir::homePath(), nullptr, nullptr);
if (paths.isEmpty()) {
return;
@ -512,8 +512,8 @@ void ChatForm::searchInBegin(const QString& phrase, const ParameterSearch& param
if (isFirst || isAfter) {
if (isFirst || (isAfter && parameter.date < getFirstDate())) {
const QString pk = f->getPublicKey().toString();
if ((isFirst || parameter.date >= history->getStartDateChatHistory(pk).date()) &&
loadHistory(phrase, parameter)) {
if ((isFirst || parameter.date >= history->getStartDateChatHistory(pk).date())
&& loadHistory(phrase, parameter)) {
return;
}
@ -523,7 +523,8 @@ void ChatForm::searchInBegin(const QString& phrase, const ParameterSearch& param
} else {
if (parameter.period == PeriodSearch::BeforeDate && parameter.date < getFirstDate()) {
const QString pk = f->getPublicKey().toString();
if (parameter.date >= history->getStartDateChatHistory(pk).date() && loadHistory(phrase, parameter)) {
if (parameter.date >= history->getStartDateChatHistory(pk).date()
&& loadHistory(phrase, parameter)) {
return;
}
}
@ -558,7 +559,8 @@ void ChatForm::onSearchUp(const QString& phrase, const ParameterSearch& paramete
if (!isSearch) {
const QString pk = f->getPublicKey().toString();
const QDateTime newBaseDate = history->getDateWhereFindPhrase(pk, earliestMessage, phrase, parameter);
const QDateTime newBaseDate =
history->getDateWhereFindPhrase(pk, earliestMessage, phrase, parameter);
if (!newBaseDate.isValid()) {
emit messageNotFoundShow(SearchDirection::Up);
@ -651,7 +653,7 @@ void ChatForm::onReceiptReceived(quint32 friendId, int receipt)
}
}
void ChatForm::onAvatarChanged(const ToxPk &friendPk, const QPixmap& pic)
void ChatForm::onAvatarChanged(const ToxPk& friendPk, const QPixmap& pic)
{
if (friendPk != f->getPublicKey()) {
return;
@ -1061,7 +1063,7 @@ void ChatForm::SendMessageStr(QString msg)
}
ChatMessage::Ptr ma = createSelfMessage(part, timestamp, isAction, false);
if (history && Settings::getInstance().getEnableLogging()) {
auto* offMsgEngine = getOfflineMsgEngine();
QString selfPk = Core::getInstance()->getSelfId().toString();
@ -1086,7 +1088,8 @@ void ChatForm::SendMessageStr(QString msg)
bool ChatForm::loadHistory(const QString& phrase, const ParameterSearch& parameter)
{
const QString pk = f->getPublicKey().toString();
const QDateTime newBaseDate = history->getDateWhereFindPhrase(pk, earliestMessage, phrase, parameter);
const QDateTime newBaseDate =
history->getDateWhereFindPhrase(pk, earliestMessage, phrase, parameter);
if (newBaseDate.isValid() && getFirstDate().isValid() && newBaseDate.date() < getFirstDate()) {
searchAfterLoadHistory = true;
@ -1136,7 +1139,8 @@ void ChatForm::onExportChat()
ToxPk authorPk(ToxId(it.sender).getPublicKey());
QString author = getMsgAuthorDispName(authorPk, it.dispName);
buffer = buffer % QString{datestamp % '\t' % timestamp % '\t' % author % '\t' % it.message % '\n'};
buffer = buffer
% QString{datestamp % '\t' % timestamp % '\t' % author % '\t' % it.message % '\n'};
}
file.write(buffer.toUtf8());
file.close();

View File

@ -151,8 +151,7 @@ GeneralForm::GeneralForm(SettingsWidget* myParent)
bodyUI->autoacceptFiles->setChecked(s.getAutoSaveEnabled());
#ifndef QTOX_PLATFORM_EXT
bodyUI->autoAwayLabel->setEnabled(
false); // these don't seem to change the appearance of the widgets,
bodyUI->autoAwayLabel->setEnabled(false); // these don't seem to change the appearance of the widgets,
bodyUI->autoAwaySpinBox->setEnabled(false); // though they are unusable
#endif