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:
parent
f7df1191bc
commit
939f2c865a
|
@ -272,9 +272,9 @@ void Settings::loadGlobal()
|
||||||
enableTestSound = s.value("enableTestSound", true).toBool();
|
enableTestSound = s.value("enableTestSound", true).toBool();
|
||||||
audioBitrate = s.value("audioBitrate", 64).toInt();
|
audioBitrate = s.value("audioBitrate", 64).toInt();
|
||||||
enableBackend2 = false;
|
enableBackend2 = false;
|
||||||
#ifdef USE_FILTERAUDIO
|
#ifdef USE_FILTERAUDIO
|
||||||
enableBackend2 = s.value("enableBackend2", false).toBool();
|
enableBackend2 = s.value("enableBackend2", false).toBool();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,11 @@ namespace Db {
|
||||||
enum class syncType;
|
enum class syncType;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Settings : public QObject, public ICoreSettings, public IFriendSettings,
|
class Settings : public QObject,
|
||||||
public IAudioSettings, public IVideoSettings
|
public ICoreSettings,
|
||||||
|
public IFriendSettings,
|
||||||
|
public IAudioSettings,
|
||||||
|
public IVideoSettings
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
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(QString dateFormat READ getDateFormat WRITE setDateFormat NOTIFY dateFormatChanged FINAL)
|
||||||
Q_PROPERTY(bool statusChangeNotificationEnabled READ getStatusChangeNotificationEnabled WRITE
|
Q_PROPERTY(bool statusChangeNotificationEnabled READ getStatusChangeNotificationEnabled WRITE
|
||||||
setStatusChangeNotificationEnabled NOTIFY statusChangeNotificationEnabledChanged FINAL)
|
setStatusChangeNotificationEnabled NOTIFY statusChangeNotificationEnabledChanged FINAL)
|
||||||
Q_PROPERTY(bool spellCheckingEnabled READ getSpellCheckingEnabled WRITE
|
Q_PROPERTY(bool spellCheckingEnabled READ getSpellCheckingEnabled WRITE setSpellCheckingEnabled
|
||||||
setSpellCheckingEnabled NOTIFY spellCheckingEnabledChanged FINAL)
|
NOTIFY spellCheckingEnabledChanged FINAL)
|
||||||
|
|
||||||
// Privacy
|
// Privacy
|
||||||
Q_PROPERTY(bool typingNotification READ getTypingNotification WRITE setTypingNotification NOTIFY
|
Q_PROPERTY(bool typingNotification READ getTypingNotification WRITE setTypingNotification NOTIFY
|
||||||
|
@ -105,8 +108,8 @@ class Settings : public QObject, public ICoreSettings, public IFriendSettings,
|
||||||
audioInDevEnabledChanged FINAL)
|
audioInDevEnabledChanged FINAL)
|
||||||
Q_PROPERTY(qreal audioInGainDecibel READ getAudioInGainDecibel WRITE setAudioInGainDecibel
|
Q_PROPERTY(qreal audioInGainDecibel READ getAudioInGainDecibel WRITE setAudioInGainDecibel
|
||||||
NOTIFY audioInGainDecibelChanged FINAL)
|
NOTIFY audioInGainDecibelChanged FINAL)
|
||||||
Q_PROPERTY(qreal audioThreshold READ getAudioThreshold WRITE setAudioThreshold
|
Q_PROPERTY(qreal audioThreshold READ getAudioThreshold WRITE setAudioThreshold NOTIFY
|
||||||
NOTIFY audioThresholdChanged FINAL)
|
audioThresholdChanged FINAL)
|
||||||
Q_PROPERTY(QString outDev READ getOutDev WRITE setOutDev NOTIFY outDevChanged FINAL)
|
Q_PROPERTY(QString outDev READ getOutDev WRITE setOutDev NOTIFY outDevChanged FINAL)
|
||||||
Q_PROPERTY(bool audioOutDevEnabled READ getAudioOutDevEnabled WRITE setAudioOutDevEnabled NOTIFY
|
Q_PROPERTY(bool audioOutDevEnabled READ getAudioOutDevEnabled WRITE setAudioOutDevEnabled NOTIFY
|
||||||
audioOutDevEnabledChanged FINAL)
|
audioOutDevEnabledChanged FINAL)
|
||||||
|
@ -352,8 +355,14 @@ public:
|
||||||
void setAudioThreshold(qreal percent) override;
|
void setAudioThreshold(qreal percent) override;
|
||||||
|
|
||||||
int getOutVolume() const override;
|
int getOutVolume() const override;
|
||||||
int getOutVolumeMin() const override { return 0; }
|
int getOutVolumeMin() const override
|
||||||
int getOutVolumeMax() const override { return 100; }
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int getOutVolumeMax() const override
|
||||||
|
{
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
void setOutVolume(int volume) override;
|
void setOutVolume(int volume) override;
|
||||||
|
|
||||||
int getAudioBitrate() const override;
|
int getAudioBitrate() const override;
|
||||||
|
@ -491,8 +500,8 @@ public:
|
||||||
void saveFriendSettings(const ToxPk& id) override;
|
void saveFriendSettings(const ToxPk& id) override;
|
||||||
void removeFriendSettings(const ToxPk& id) override;
|
void removeFriendSettings(const ToxPk& id) override;
|
||||||
|
|
||||||
SIGNAL_IMPL(Settings, autoAcceptCallChanged,
|
SIGNAL_IMPL(Settings, autoAcceptCallChanged, const ToxPk& id,
|
||||||
const ToxPk& id, IFriendSettings::AutoAcceptCallFlags accept)
|
IFriendSettings::AutoAcceptCallFlags accept)
|
||||||
SIGNAL_IMPL(Settings, autoGroupInviteChanged, const ToxPk& id, bool accept)
|
SIGNAL_IMPL(Settings, autoGroupInviteChanged, const ToxPk& id, bool accept)
|
||||||
SIGNAL_IMPL(Settings, autoAcceptDirChanged, const ToxPk& id, const QString& dir)
|
SIGNAL_IMPL(Settings, autoAcceptDirChanged, const ToxPk& id, const QString& dir)
|
||||||
SIGNAL_IMPL(Settings, contactNoteChanged, const ToxPk& id, const QString& note)
|
SIGNAL_IMPL(Settings, contactNoteChanged, const ToxPk& id, const QString& note)
|
||||||
|
@ -508,10 +517,10 @@ public:
|
||||||
|
|
||||||
bool getDontGroupWindows() const;
|
bool getDontGroupWindows() const;
|
||||||
void setDontGroupWindows(bool value);
|
void setDontGroupWindows(bool value);
|
||||||
|
|
||||||
bool getGroupchatPosition() const;
|
bool getGroupchatPosition() const;
|
||||||
void setGroupchatPosition(bool value);
|
void setGroupchatPosition(bool value);
|
||||||
|
|
||||||
bool getShowIdenticons() const;
|
bool getShowIdenticons() const;
|
||||||
void setShowIdenticons(bool value);
|
void setShowIdenticons(bool value);
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ void ChatForm::onSendTriggered()
|
||||||
}
|
}
|
||||||
void ChatForm::onFileNameChanged(const ToxPk& friendPk)
|
void ChatForm::onFileNameChanged(const ToxPk& friendPk)
|
||||||
{
|
{
|
||||||
if(friendPk != f->getPublicKey()) {
|
if (friendPk != f->getPublicKey()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,8 +266,8 @@ void ChatForm::onTextEditChanged()
|
||||||
|
|
||||||
void ChatForm::onAttachClicked()
|
void ChatForm::onAttachClicked()
|
||||||
{
|
{
|
||||||
QStringList paths =
|
QStringList paths = QFileDialog::getOpenFileNames(Q_NULLPTR, tr("Send a file"),
|
||||||
QFileDialog::getOpenFileNames(Q_NULLPTR, tr("Send a file"), QDir::homePath(), nullptr, nullptr);
|
QDir::homePath(), nullptr, nullptr);
|
||||||
|
|
||||||
if (paths.isEmpty()) {
|
if (paths.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -512,8 +512,8 @@ void ChatForm::searchInBegin(const QString& phrase, const ParameterSearch& param
|
||||||
if (isFirst || isAfter) {
|
if (isFirst || isAfter) {
|
||||||
if (isFirst || (isAfter && parameter.date < getFirstDate())) {
|
if (isFirst || (isAfter && parameter.date < getFirstDate())) {
|
||||||
const QString pk = f->getPublicKey().toString();
|
const QString pk = f->getPublicKey().toString();
|
||||||
if ((isFirst || parameter.date >= history->getStartDateChatHistory(pk).date()) &&
|
if ((isFirst || parameter.date >= history->getStartDateChatHistory(pk).date())
|
||||||
loadHistory(phrase, parameter)) {
|
&& loadHistory(phrase, parameter)) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -523,7 +523,8 @@ void ChatForm::searchInBegin(const QString& phrase, const ParameterSearch& param
|
||||||
} else {
|
} else {
|
||||||
if (parameter.period == PeriodSearch::BeforeDate && parameter.date < getFirstDate()) {
|
if (parameter.period == PeriodSearch::BeforeDate && parameter.date < getFirstDate()) {
|
||||||
const QString pk = f->getPublicKey().toString();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -558,7 +559,8 @@ void ChatForm::onSearchUp(const QString& phrase, const ParameterSearch& paramete
|
||||||
|
|
||||||
if (!isSearch) {
|
if (!isSearch) {
|
||||||
const QString pk = f->getPublicKey().toString();
|
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()) {
|
if (!newBaseDate.isValid()) {
|
||||||
emit messageNotFoundShow(SearchDirection::Up);
|
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()) {
|
if (friendPk != f->getPublicKey()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1061,7 +1063,7 @@ void ChatForm::SendMessageStr(QString msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatMessage::Ptr ma = createSelfMessage(part, timestamp, isAction, false);
|
ChatMessage::Ptr ma = createSelfMessage(part, timestamp, isAction, false);
|
||||||
|
|
||||||
if (history && Settings::getInstance().getEnableLogging()) {
|
if (history && Settings::getInstance().getEnableLogging()) {
|
||||||
auto* offMsgEngine = getOfflineMsgEngine();
|
auto* offMsgEngine = getOfflineMsgEngine();
|
||||||
QString selfPk = Core::getInstance()->getSelfId().toString();
|
QString selfPk = Core::getInstance()->getSelfId().toString();
|
||||||
|
@ -1086,7 +1088,8 @@ void ChatForm::SendMessageStr(QString msg)
|
||||||
bool ChatForm::loadHistory(const QString& phrase, const ParameterSearch& parameter)
|
bool ChatForm::loadHistory(const QString& phrase, const ParameterSearch& parameter)
|
||||||
{
|
{
|
||||||
const QString pk = f->getPublicKey().toString();
|
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()) {
|
if (newBaseDate.isValid() && getFirstDate().isValid() && newBaseDate.date() < getFirstDate()) {
|
||||||
searchAfterLoadHistory = true;
|
searchAfterLoadHistory = true;
|
||||||
|
@ -1136,7 +1139,8 @@ void ChatForm::onExportChat()
|
||||||
ToxPk authorPk(ToxId(it.sender).getPublicKey());
|
ToxPk authorPk(ToxId(it.sender).getPublicKey());
|
||||||
QString author = getMsgAuthorDispName(authorPk, it.dispName);
|
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.write(buffer.toUtf8());
|
||||||
file.close();
|
file.close();
|
||||||
|
|
|
@ -151,8 +151,7 @@ GeneralForm::GeneralForm(SettingsWidget* myParent)
|
||||||
bodyUI->autoacceptFiles->setChecked(s.getAutoSaveEnabled());
|
bodyUI->autoacceptFiles->setChecked(s.getAutoSaveEnabled());
|
||||||
|
|
||||||
#ifndef QTOX_PLATFORM_EXT
|
#ifndef QTOX_PLATFORM_EXT
|
||||||
bodyUI->autoAwayLabel->setEnabled(
|
bodyUI->autoAwayLabel->setEnabled(false); // these don't seem to change the appearance of the widgets,
|
||||||
false); // these don't seem to change the appearance of the widgets,
|
|
||||||
bodyUI->autoAwaySpinBox->setEnabled(false); // though they are unusable
|
bodyUI->autoAwaySpinBox->setEnabled(false); // though they are unusable
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user