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

refactor(style): use #pragma once rather than include guards

This commit is contained in:
Anthony Bilinski 2020-05-03 05:44:08 -07:00
parent 9306e946f8
commit 8abd4e47e9
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
182 changed files with 211 additions and 723 deletions

View File

@ -316,7 +316,7 @@ foo& g();
void f()
{
foo::bar(); // OK: no object necessary
foo::bar(); // OK: no object necessary
g().bar(); // Not OK: g() can cause side effects
}
```
@ -378,6 +378,8 @@ Newlines can be present between includes to indicate logical grouping, however
be wary that clang-format does not sort includes properly this way, electing to
sort each group individually according to the criteria defined above.
Use `#pragma once` rather than include guards in header files. It reduces duplication and avoids a potential cause of bugs.
The following example demonstrates the above include rules:
```c++
@ -572,4 +574,3 @@ For more info, see:
[String concatenation with QStringBuilder]: https://blog.qt.io/blog/2011/06/13/string-concatenation-with-qstringbuilder/
[Latin-1]: https://en.wikipedia.org/wiki/ISO/IEC_8859-1
[CppCoreGuidelines]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#main

View File

@ -18,8 +18,7 @@
*/
#ifndef AUDIO_H
#define AUDIO_H
#pragma once
#include <memory>
@ -30,5 +29,3 @@ class Audio
public:
static std::unique_ptr<IAudioControl> makeAudio(IAudioSettings& settings);
};
#endif // AUDIO_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ALSINK_H
#define ALSINK_H
#pragma once
#include <QMutex>
#include <QObject>
@ -58,5 +57,3 @@ private:
bool killed = false;
mutable QMutex killLock;
};
#endif // ALSINK_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ALSOURCE_H
#define ALSOURCE_H
#pragma once
#include "src/audio/iaudiosource.h"
#include <QMutex>
@ -45,5 +44,3 @@ private:
bool killed = false;
mutable QMutex killLock;
};
#endif // ALSOURCE_H

View File

@ -18,8 +18,7 @@
*/
#ifndef OPENAL_H
#define OPENAL_H
#pragma once
#include "src/audio/iaudiocontrol.h"
#include "src/audio/backend/alsink.h"
@ -164,5 +163,3 @@ protected:
const qreal maxInThreshold = 0.4;
int16_t* inputBuffer = nullptr;
};
#endif // OPENAL_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IAUDIOCONTROL_H
#define IAUDIOCONTROL_H
#pragma once
#include <QObject>
#include <QStringList>
@ -146,6 +145,3 @@ protected:
AUDIO_FRAME_DURATION * AUDIO_SAMPLE_RATE / 1000;
uint32_t AUDIO_FRAME_SAMPLE_COUNT_TOTAL = 0;
};
#endif // IAUDIOCONTROL_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef I_AUDIO_SETTINGS_H
#define I_AUDIO_SETTINGS_H
#pragma once
#include "src/model/interface.h"
@ -69,5 +68,3 @@ public:
DECLARE_SIGNAL(audioBitrateChanged, int bitrate);
DECLARE_SIGNAL(enableTestSoundChanged, bool newValue);
};
#endif // I_AUDIO_SETTINGS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IAUDIOSINK_H
#define IAUDIOSINK_H
#pragma once
#include <cassert>
@ -110,5 +109,3 @@ signals:
DECLARE_SIGNAL(finishedPlaying);
DECLARE_SIGNAL(invalidated);
};
#endif // IAUDIOSINK_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IAUDIOSOURCE_H
#define IAUDIOSOURCE_H
#pragma once
#include <QObject>
@ -44,5 +43,3 @@ signals:
void volumeAvailable(float value);
void invalidated();
};
#endif // IAUDIOSOURCE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHATLINE_H
#define CHATLINE_H
#pragma once
#include <QPointF>
#include <QRectF>
@ -116,5 +115,3 @@ private:
QRectF bbox;
bool isVisible = false;
};
#endif // CHATLINE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHATLINECONTENT_H
#define CHATLINECONTENT_H
#pragma once
#include <QGraphicsItem>
@ -69,5 +68,3 @@ private:
int row = -1;
int col = -1;
};
#endif // CHATLINECONTENT_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHATLINECONTENTPROXY_H
#define CHATLINECONTENTPROXY_H
#pragma once
#include "chatlinecontent.h"
#include <QGraphicsProxyWidget>
@ -58,5 +57,3 @@ private:
int widthMin;
const ChatLineContentProxyType widgetType;
};
#endif // CHATLINECONTENTPROXY_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHATLOG_H
#define CHATLOG_H
#pragma once
#include <QDateTime>
#include <QGraphicsView>
@ -189,5 +188,3 @@ private:
int numRemove{0};
const int maxMessages{300};
};
#endif // CHATLOG_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHATMESSAGE_H
#define CHATMESSAGE_H
#pragma once
#include "chatline.h"
#include "src/core/toxfile.h"
@ -73,5 +72,3 @@ protected:
private:
bool action = false;
};
#endif // CHATMESSAGE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BROKEN_H
#define BROKEN_H
#pragma once
#include "../chatlinecontent.h"
@ -41,5 +40,3 @@ private:
QPixmap pmap;
QSize size;
};
#endif // BROKEN_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FILETRANSFERWIDGET_H
#define FILETRANSFERWIDGET_H
#pragma once
#include <QTime>
#include <QWidget>
@ -109,5 +108,3 @@ private:
LeftBottom = 8
};
};
#endif // FILETRANSFERWIDGET_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IMAGE_H
#define IMAGE_H
#pragma once
#include "../chatlinecontent.h"
@ -39,5 +38,3 @@ private:
QSize size;
QPixmap pmap;
};
#endif // IMAGE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NOTIFICATIONICON_H
#define NOTIFICATIONICON_H
#pragma once
#include "../chatlinecontent.h"
@ -51,5 +50,3 @@ private:
qreal dotWidth = 0.2;
qreal alpha = 0.0;
};
#endif // NOTIFICATIONICON_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SPINNER_H
#define SPINNER_H
#pragma once
#include "../chatlinecontent.h"
@ -52,5 +51,3 @@ private:
qreal alpha = 0.0;
QVariantAnimation* blendAnimation;
};
#endif // SPINNER_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TEXT_H
#define TEXT_H
#pragma once
#include "../chatlinecontent.h"
#include "src/widget/style.h"
@ -115,5 +114,3 @@ private:
QTextCursor selectCursor;
std::pair<int, int> selectPoint{0, 0};
};
#endif // TEXT_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TIMESTAMP_H
#define TIMESTAMP_H
#pragma once
#include "text.h"
#include <QDateTime>
@ -39,5 +38,3 @@ protected:
private:
QDateTime time;
};
#endif // TIMESTAMP_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CUSTOMTEXTDOCUMENT_H
#define CUSTOMTEXTDOCUMENT_H
#pragma once
#include <QTextDocument>
#include <QList>
@ -39,5 +38,3 @@ protected:
private:
QList<std::shared_ptr<QIcon>> emoticonIcons;
};
#endif // CUSTOMTEXTDOCUMENT_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DOCUMENTCACHE_H
#define DOCUMENTCACHE_H
#pragma once
#include <QStack>
@ -41,5 +40,3 @@ private:
private:
QStack<QTextDocument*> documents;
};
#endif // DOCUMENTCACHE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICONCACHE_H
#define ICONCACHE_H
#pragma once
#include <QHash>
#include <QIcon>
@ -40,5 +39,3 @@ protected:
private:
QHash<QString, QIcon> cache;
};
#endif // ICONCACHE_H

View File

@ -17,13 +17,10 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TEXTFORMATTER_H
#define TEXTFORMATTER_H
#pragma once
#include <QString>
QString highlightURI(const QString& message);
QString applyMarkdown(const QString& message, bool showFormattingSymbols);
#endif // TEXTFORMATTER_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXFILEPROGRESS_H
#define TOXFILEPROGRESS_H
#pragma once
#include <QTime>
@ -48,6 +47,3 @@ private:
double timeLeftSeconds;
double progress;
};
#endif // TOXFILEPROGRESS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONTACTID_H
#define CONTACTID_H
#pragma once
#include <QByteArray>
#include <QString>
@ -53,5 +52,3 @@ inline uint qHash(const ContactId& id)
}
using ContactIdPtr = std::shared_ptr<const ContactId>;
#endif // CONTACTID_H

View File

@ -18,8 +18,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CORE_HPP
#define CORE_HPP
#pragma once
#include "groupid.h"
#include "icorefriendmessagesender.h"
@ -253,5 +252,3 @@ private:
std::unique_ptr<QThread> coreThread;
};
#endif // CORE_HPP

View File

@ -18,8 +18,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COREAV_H
#define COREAV_H
#pragma once
#include "src/core/toxcall.h"
#include <QObject>
@ -158,5 +157,3 @@ private:
*/
QMutex& coreLock;
};
#endif // COREAV_H

View File

@ -18,8 +18,7 @@
*/
#ifndef COREFILE_H
#define COREFILE_H
#pragma once
#include <tox/tox.h>
@ -109,5 +108,3 @@ private:
Tox* tox;
QMutex* coreLoopLock = nullptr;
};
#endif // COREFILE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DHT_SERVER_H
#define DHT_SERVER_H
#pragma once
#include <QString>
@ -32,5 +31,3 @@ struct DhtServer
bool operator==(const DhtServer& other) const;
bool operator!=(const DhtServer& other) const;
};
#endif // DHT_SERVER_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUPID_H
#define GROUPID_H
#pragma once
#include "src/core/contactid.h"
#include <QByteArray>
@ -33,5 +32,3 @@ public:
explicit GroupId(const uint8_t* rawId);
int getSize() const override;
};
#endif // GROUPID_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICORE_FRIEND_MESSAGE_SENDER_H
#define ICORE_FRIEND_MESSAGE_SENDER_H
#pragma once
#include "receiptnum.h"
@ -32,6 +31,3 @@ public:
virtual bool sendAction(uint32_t friendId, const QString& action, ReceiptNum& receipt) = 0;
virtual bool sendMessage(uint32_t friendId, const QString& message, ReceiptNum& receipt) = 0;
};
#endif /* ICORE_FRIEND_MESSAGE_SENDER_H */

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICORE_GROUP_MESSAGE_SENDER_H
#define ICORE_GROUP_MESSAGE_SENDER_H
#pragma once
#include <QString>
@ -29,5 +28,3 @@ public:
virtual void sendGroupAction(int groupId, const QString& message) = 0;
virtual void sendGroupMessage(int groupId, const QString& message) = 0;
};
#endif /*ICORE_GROUP_MESSAGE_SENDER_H*/

View File

@ -18,8 +18,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICORE_GROUP_QUERY_H
#define ICORE_GROUP_QUERY_H
#pragma once
#include "groupid.h"
#include "toxpk.h"
@ -40,5 +39,3 @@ public:
virtual QStringList getGroupPeerNames(int groupId) const = 0;
virtual bool getGroupAvEnabled(int groupId) const = 0;
};
#endif /*ICORE_GROUP_QUERY_H*/

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICORE_ID_HANDLER_H
#define ICORE_ID_HANDLER_H
#pragma once
#include "toxid.h"
#include "toxpk.h"
@ -32,6 +31,3 @@ public:
virtual ToxPk getSelfPublicKey() const = 0;
virtual QString getUsername() const = 0;
};
#endif /*ICORE_ID_HANDLER_H*/

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef I_CORE_SETTINGS_H
#define I_CORE_SETTINGS_H
#pragma once
#include "src/model/interface.h"
@ -64,5 +63,3 @@ public:
DECLARE_SIGNAL(proxyAddressChanged, const QString& address);
DECLARE_SIGNAL(proxyPortChanged, quint16 port);
};
#endif // I_CORE_SETTINGS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RECEIPT_NUM_H
#define RECEIPT_NUM_H
#pragma once
#include "src/util/strongtype.h"
@ -27,5 +26,3 @@
using ReceiptNum = NamedType<uint32_t, struct ReceiptNumTag, Orderable>;
Q_DECLARE_METATYPE(ReceiptNum)
#endif /* RECEIPT_NUM_H */

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXCALL_H
#define TOXCALL_H
#pragma once
#include "src/audio/iaudiocontrol.h"
#include "src/audio/iaudiosink.h"
@ -141,5 +140,3 @@ private slots:
void onAudioSourceInvalidated();
void onAudioSinkInvalidated(ToxPk peerId);
};
#endif // TOXCALL_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXENCRYPT_H
#define TOXENCRYPT_H
#pragma once
#include <QByteArray>
#include <QString>
@ -51,5 +50,3 @@ private:
private:
Tox_Pass_Key* passKey = nullptr;
};
#endif // TOXENCRYPT_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CORESTRUCTS_H
#define CORESTRUCTS_H
#pragma once
#include "src/core/toxfilepause.h"
@ -76,5 +75,3 @@ struct ToxFile
std::shared_ptr<QCryptographicHash> hashGenerator = std::make_shared<QCryptographicHash>(QCryptographicHash::Sha256);
ToxFilePause pauseStatus;
};
#endif // CORESTRUCTS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOX_FILE_PAUSE_H
#define TOX_FILE_PAUSE_H
#pragma once
class ToxFilePause
{
@ -72,5 +71,3 @@ private:
bool localPauseState = false;
bool remotePauseState = false;
};
#endif // TOX_FILE_PAUSE_H

View File

@ -18,8 +18,7 @@
*/
#ifndef TOXID_H
#define TOXID_H
#pragma once
#include "toxpk.h"
@ -60,5 +59,3 @@ public:
private:
QByteArray toxId;
};
#endif // TOXID_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXLOGGER_H
#define TOXLOGGER_H
#pragma once
#include <tox/tox.h>
@ -28,5 +27,3 @@ namespace ToxLogger {
void onLogMessage(Tox *tox, Tox_Log_Level level, const char *file, uint32_t line,
const char *func, const char *message, void *user_data);
}
#endif // TOXLOGGER_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXOPTIONS_H
#define TOXOPTIONS_H
#pragma once
#include <QByteArray>
@ -46,5 +45,3 @@ private:
Tox_Options* options = nullptr;
QByteArray proxyAddrData;
};
#endif // TOXOPTIONS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXPK_H
#define TOXPK_H
#pragma once
#include "src/core/contactid.h"
#include <QByteArray>
@ -33,5 +32,3 @@ public:
explicit ToxPk(const uint8_t* rawId);
int getSize() const override;
};
#endif // TOXPK_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXSTRING_H
#define TOXSTRING_H
#pragma once
#include <QByteArray>
#include <QString>
@ -40,4 +39,3 @@ public:
private:
QByteArray string;
};
#endif // TOXSTRING_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FRIENDLIST_H
#define FRIENDLIST_H
#pragma once
#include <cstdint>
@ -46,5 +45,3 @@ private:
static QHash<ToxPk, Friend*> friendList;
static QHash<uint32_t, ToxPk> id2key;
};
#endif // FRIENDLIST_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUPLIST_H
#define GROUPLIST_H
#pragma once
#include "src/core/groupid.h"
@ -43,5 +42,3 @@ private:
static QHash<const GroupId, Group*> groupList;
static QHash<uint32_t, GroupId> id2key;
};
#endif // GROUPLIST_H

View File

@ -18,8 +18,7 @@
*/
#ifndef IPC_H
#define IPC_H
#pragma once
#include <QMap>
#include <QObject>
@ -91,5 +90,3 @@ private:
QSharedMemory globalMemory;
QMap<QString, IPCEventHandler> eventHandlers;
};
#endif // IPC_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ABOUT_FRIEND_H
#define ABOUT_FRIEND_H
#pragma once
#include "iaboutfriend.h"
#include "src/model/interface.h"
@ -72,5 +71,3 @@ private:
const Friend* const f;
IFriendSettings* const settings;
};
#endif // ABOUT_FRIEND_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef I_ABOUT_FRIEND_H
#define I_ABOUT_FRIEND_H
#pragma once
#include "src/model/interface.h"
#include "src/persistence/ifriendsettings.h"
@ -62,5 +61,3 @@ public:
DECLARE_SIGNAL(autoAcceptCallChanged, IFriendSettings::AutoAcceptCallFlags);
DECLARE_SIGNAL(autoGroupInviteChanged, bool);
};
#endif // I_ABOUT_FRIEND_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHAT_HISTORY_H
#define CHAT_HISTORY_H
#pragma once
#include "ichatlog.h"
#include "sessionchatlog.h"
@ -76,5 +75,3 @@ private:
// callback it will end up in this map
QMap<DispatchedMessageId, RowId> dispatchedMessageRowIdMap;
};
#endif /*CHAT_HISTORY_H*/

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHAT_LOG_ITEM_H
#define CHAT_LOG_ITEM_H
#pragma once
#include "src/core/toxfile.h"
#include "src/core/toxpk.h"
@ -72,5 +71,3 @@ private:
ContentPtr content;
};
#endif /*CHAT_LOG_ITEM_H*/

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MODEL_CHATROOM_H
#define MODEL_CHATROOM_H
#pragma once
#include "src/model/contact.h"
@ -27,5 +26,3 @@ class Chatroom
public:
virtual Contact* getContact() = 0;
};
#endif /* MODEL_CHATROOM_H */

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FRIEND_CHATROOM_H
#define FRIEND_CHATROOM_H
#pragma once
#include "chatroom.h"
@ -87,5 +86,3 @@ private:
Friend* frnd{nullptr};
IDialogsManager* dialogsManager{nullptr};
};
#endif // FRIEND_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUP_CHATROOM_H
#define GROUP_CHATROOM_H
#pragma once
#include "chatroom.h"
@ -52,5 +51,3 @@ private:
Group* group{nullptr};
IDialogsManager* dialogsManager{nullptr};
};
#endif /* GROUP_CHATROOM_H */

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONTACT_H
#define CONTACT_H
#pragma once
#include "src/core/contactid.h"
#include <QObject>
@ -42,5 +41,3 @@ public:
signals:
void displayedNameChanged(const QString& newName);
};
#endif // CONTACT_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef I_DIALOGS_H
#define I_DIALOGS_H
#pragma once
class ContactId;
class GroupId;
@ -36,5 +35,3 @@ public:
virtual int chatroomCount() const = 0;
};
#endif // I_DIALOGS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef I_DIALOGS_MANAGER
#define I_DIALOGS_MANAGER
#pragma once
#include "idialogs.h"
@ -32,5 +31,3 @@ public:
virtual IDialogs* getFriendDialogs(const ToxPk& friendPk) const = 0;
virtual IDialogs* getGroupDialogs(const GroupId& groupId) const = 0;
};
#endif // I_DIALOGS_MANAGER

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FRIEND_H
#define FRIEND_H
#pragma once
#include "contact.h"
#include "src/core/core.h"
@ -74,5 +73,3 @@ private:
bool hasNewEvents;
Status::Status friendStatus;
};
#endif // FRIEND_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FRIEND_MESSAGE_DISPATCHER_H
#define FRIEND_MESSAGE_DISPATCHER_H
#pragma once
#include "src/core/icorefriendmessagesender.h"
#include "src/model/friend.h"
@ -54,6 +53,3 @@ private:
OfflineMsgEngine offlineMsgEngine;
MessageProcessor processor;
};
#endif /* IMESSAGE_DISPATCHER_H */

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUP_H
#define GROUP_H
#pragma once
#include "contact.h"
@ -86,5 +85,3 @@ private:
const GroupId groupId;
bool avGroupchat;
};
#endif // GROUP_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUPINVITE_H
#define GROUPINVITE_H
#pragma once
#include <QByteArray>
#include <QDateTime>
@ -42,5 +41,3 @@ private:
QByteArray invite;
QDateTime date;
};
#endif // GROUPINVITE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROUP_MESSAGE_DISPATCHER_H
#define GROUP_MESSAGE_DISPATCHER_H
#pragma once
#include "src/core/icoregroupmessagesender.h"
#include "src/core/icoreidhandler.h"
@ -53,6 +52,3 @@ private:
const IGroupSettings& groupSettings;
DispatchedMessageId nextMessageId{0};
};
#endif /* IMESSAGE_DISPATCHER_H */

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICHAT_LOG_H
#define ICHAT_LOG_H
#pragma once
#include "message.h"
#include "src/core/core.h"
@ -141,5 +140,3 @@ public:
signals:
void itemUpdated(ChatLogIdx idx);
};
#endif /*ICHAT_LOG_H*/

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IMESSAGE_DISPATCHER_H
#define IMESSAGE_DISPATCHER_H
#pragma once
#include "src/model/friend.h"
#include "src/model/message.h"
@ -64,5 +63,3 @@ signals:
*/
void messageComplete(DispatchedMessageId id);
};
#endif /* IMESSAGE_DISPATCHER_H */

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_H
#define INTERFACE_H
#pragma once
#include <QMetaObject>
@ -70,5 +69,3 @@
QMetaObject::Connection connectTo_##name(QObject *receiver, Slot_##name slot) const override { \
return connect(this, &classname::name, receiver, slot); \
}
#endif // INTERFACE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MESSAGE_H
#define MESSAGE_H
#pragma once
#include <QDateTime>
#include <QRegularExpression>
@ -114,5 +113,3 @@ private:
bool detectingMentions = false;
const SharedParams& sharedParams;
};
#endif /*MESSAGE_H*/

View File

@ -17,6 +17,8 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "src/model/interface.h"
#include <QObject>

View File

@ -17,6 +17,8 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <QObject>
#include "src/model/interface.h"
#include "src/core/toxpk.h"

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SESSION_CHAT_LOG_H
#define SESSION_CHAT_LOG_H
#pragma once
#include "ichatlog.h"
#include "imessagedispatcher.h"
@ -89,5 +88,3 @@ private:
*/
QMap<DispatchedMessageId, ChatLogIdx> outgoingMessages;
};
#endif /*SESSION_CHAT_LOG_H*/

View File

@ -20,8 +20,7 @@
#include <QString>
#include <QPixmap>
#ifndef STATUS_H
#define STATUS_H
#pragma once
namespace Status
{
@ -40,5 +39,3 @@ namespace Status
QString getAssetSuffix(Status status);
bool isOnline(Status status);
}
#endif // STATUS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXCLIENTSTANDARDS_H
#define TOXCLIENTSTANDARDS_H
#pragma once
#include <cstdint>
@ -31,5 +30,3 @@ namespace ToxClientStandards
return fileSize <= MaxAvatarSize;
}
} // ToxClientStandards
#endif // TOXCLIENTSTANDARDS_H

View File

@ -18,8 +18,7 @@
*/
#ifndef AVATARBROADCASTER_H
#define AVATARBROADCASTER_H
#pragma once
#include <QByteArray>
#include <QMap>
@ -38,5 +37,3 @@ private:
static QByteArray avatarData;
static QMap<uint32_t, bool> friendsSentTo;
};
#endif // AVATARBROADCASTER_H

View File

@ -1,5 +1,23 @@
#ifndef BOOTSTRAPNODEUPDATER_H
#define BOOTSTRAPNODEUPDATER_H
/*
Copyright © 2018-2020 by The qTox Project Contributors
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
qTox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <QList>
#include <QNetworkAccessManager>
@ -32,5 +50,3 @@ private:
QNetworkProxy proxy;
QNetworkAccessManager nam;
};
#endif // BOOTSTRAPNODEUPDATER_H

View File

@ -18,8 +18,7 @@
*/
#ifndef TOXURI_H
#define TOXURI_H
#pragma once
#include <QDialog>
@ -39,5 +38,3 @@ public:
private:
QPlainTextEdit* messageEdit;
};
#endif // TOXURI_H

View File

@ -16,6 +16,9 @@
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <QNetworkAccessManager>
#include <QObject>
#include <QTimer>

View File

@ -18,8 +18,7 @@
*/
#ifndef NEXUS_H
#define NEXUS_H
#pragma once
#include <QObject>
@ -106,5 +105,3 @@ private:
std::unique_ptr<IAudioControl> audioControl;
QCommandLineParser* parser = nullptr;
};
#endif // NEXUS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RAWDATABASE_H
#define RAWDATABASE_H
#pragma once
#include "src/util/strongtype.h"
@ -177,5 +176,3 @@ private:
QByteArray currentSalt;
QString currentHexKey;
};
#endif // RAWDATABASE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HISTORY_H
#define HISTORY_H
#pragma once
#include <QDateTime>
#include <QHash>
@ -220,5 +219,3 @@ private:
// This needs to be a shared pointer to avoid callback lifetime issues
QHash<QString, FileInfo> fileInfos;
};
#endif // HISTORY_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef I_FRIEND_SETTINGS_H
#define I_FRIEND_SETTINGS_H
#pragma once
#include "src/model/interface.h"
@ -73,4 +72,3 @@ signals:
};
Q_DECLARE_OPERATORS_FOR_FLAGS(IFriendSettings::AutoAcceptCallFlags)
#endif // I_FRIEND_SETTINGS_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IGROUP_SETTINGS_H
#define IGROUP_SETTINGS_H
#pragma once
#include <QStringList>
@ -31,5 +30,3 @@ public:
virtual bool getGroupAlwaysNotify() const = 0;
virtual void setGroupAlwaysNotify(bool newValue) = 0;
};
#endif /*IGROUP_SETTINGS_H*/

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OFFLINEMSGENGINE_H
#define OFFLINEMSGENGINE_H
#pragma once
#include "src/chatlog/chatmessage.h"
#include "src/core/core.h"
@ -70,5 +69,3 @@ private:
QMap<ReceiptNum, OfflineMessage> sentMessages;
QVector<OfflineMessage> unsentMessages;
};
#endif // OFFLINEMSGENGINE_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PATHS_H
#define PATHS_H
#pragma once
#include <QString>
#include <QStringList>
@ -50,5 +49,3 @@ private:
QString basePath{};
bool portable = false;
};
#endif // PATHS_H

View File

@ -18,8 +18,7 @@
*/
#ifndef PROFILE_H
#define PROFILE_H
#pragma once
#include "src/core/core.h"
#include "src/core/toxencrypt.h"
@ -118,5 +117,3 @@ private:
bool encrypted = false;
static QStringList profiles;
};
#endif // PROFILE_H

View File

@ -18,8 +18,7 @@
*/
#ifndef PROFILELOCKER_H
#define PROFILELOCKER_H
#pragma once
#include <QLockFile>
#include <memory>
@ -45,5 +44,3 @@ private:
static std::unique_ptr<QLockFile> lockfile;
static QString curLockName;
};
#endif // PROFILELOCKER_H

View File

@ -18,8 +18,7 @@
*/
#ifndef SERIALIZE_H
#define SERIALIZE_H
#pragma once
#include <QByteArray>
#include <QString>
@ -32,5 +31,3 @@ size_t dataToVUint(const QByteArray& data);
unsigned getVUint32Size(QByteArray data);
QByteArray vintToData(int num);
QByteArray vuintToData(size_t num);
#endif // SERIALIZE_H

View File

@ -18,8 +18,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SETTINGS_HPP
#define SETTINGS_HPP
#pragma once
#include "src/audio/iaudiosettings.h"
#include "src/core/icoresettings.h"
@ -708,5 +707,3 @@ private:
static const QString globalSettingsFile;
static QThread* settingsThread;
};
#endif // SETTINGS_HPP

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SETTINGSSERIALIZER_H
#define SETTINGSSERIALIZER_H
#pragma once
#include "src/core/toxencrypt.h"
@ -111,5 +110,3 @@ private:
QVector<Value> values;
static const char magic[];
};
#endif // SETTINGSSERIALIZER_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SMILEYPACK_H
#define SMILEYPACK_H
#pragma once
#include <QIcon>
#include <QMap>
@ -63,5 +62,3 @@ private:
QRegularExpression smilify;
mutable QMutex loadingMutex;
};
#endif // SMILEYPACK_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOXSAVE_H
#define TOXSAVE_H
#pragma once
class QString;
class QByteArray;
@ -27,5 +26,3 @@ bool handleToxSave(const QString& path);
// Internals
bool toxSaveEventHandler(const QByteArray& eventData);
#endif

View File

@ -17,10 +17,9 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef QTOX_PLATFORM_EXT
#pragma once
#ifndef PLATFORM_AUTORUN_H
#define PLATFORM_AUTORUN_H
#ifdef QTOX_PLATFORM_EXT
namespace Platform {
@ -28,6 +27,4 @@ bool setAutorun(bool on);
bool getAutorun();
}
#endif // PLATFORM_AUTORUN_H
#endif // QTOX_PLATFORM_EXT

View File

@ -16,8 +16,7 @@
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef AVFOUNDATION_H
#define AVFOUNDATION_H
#pragma once
#include "src/video/videomode.h"
#include <QPair>
@ -34,5 +33,3 @@ const QString CAPTURE_SCREEN{"Capture screen"};
QVector<VideoMode> getDeviceModes(QString devName);
QVector<QPair<QString, QString>> getDeviceList();
}
#endif // AVFOUNDATION_H

View File

@ -18,8 +18,7 @@
*/
#ifndef DIRECTSHOW_H
#define DIRECTSHOW_H
#pragma once
#include "src/video/videomode.h"
#include <QPair>
@ -34,5 +33,3 @@ namespace DirectShow {
QVector<QPair<QString, QString>> getDeviceList();
QVector<VideoMode> getDeviceModes(QString devName);
}
#endif // DIRECTSHOW_H

View File

@ -16,8 +16,7 @@
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef V4L2_H
#define V4L2_H
#pragma once
#include "src/video/videomode.h"
#include <QPair>
@ -34,5 +33,3 @@ QVector<QPair<QString, QString>> getDeviceList();
QString getPixelFormatString(uint32_t pixel_format);
bool betterPixelFormat(uint32_t a, uint32_t b);
}
#endif // V4L2_H

View File

@ -17,16 +17,13 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef QTOX_PLATFORM_EXT
#pragma once
#ifndef PLATFORM_CAPSLOCK_H
#define PLATFORM_CAPSLOCK_H
#ifdef QTOX_PLATFORM_EXT
namespace Platform {
bool capsLockEnabled();
}
#endif // PLATFORM_CAPSLOCK_H
#endif // QTOX_PLATFORM_EXT

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DESKTOPNOTIFY_H
#define DESKTOPNOTIFY_H
#pragma once
#if DESKTOP_NOTIFICATIONS
#include <libsnore/snore.h>
@ -54,5 +53,3 @@ private:
Snore::Icon snoreIcon;
};
#endif // DESKTOP_NOTIFICATIONS
#endif // DESKTOPNOTIFY_H

View File

@ -16,8 +16,7 @@
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INSTALLOSX_H
#define INSTALLOSX_H
#pragma once
#include <QtCore/qsystemdetection.h>
@ -33,5 +32,3 @@ static constexpr int EXIT_UPDATE_MACX_FAIL = 216;
void moveToAppFolder();
void migrateProfiles();
}
#endif // INSTALLOSX_H

View File

@ -17,8 +17,7 @@
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef POSIXSIGNALNOTIFIER_H
#define POSIXSIGNALNOTIFIER_H
#pragma once
#include <QObject>
@ -49,5 +48,3 @@ private:
private:
QSocketNotifier* notifier{nullptr};
};
#endif // POSIXSIGNALNOTIFIER_H

Some files were not shown because too many files have changed in this diff Show More