From 8abd4e47e999371526f90c2836b340e88436df61 Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Sun, 3 May 2020 05:44:08 -0700 Subject: [PATCH] refactor(style): use #pragma once rather than include guards --- doc/coding_standards.md | 5 ++-- src/audio/audio.h | 5 +--- src/audio/backend/alsink.h | 5 +--- src/audio/backend/alsource.h | 5 +--- src/audio/backend/openal.h | 5 +--- src/audio/iaudiocontrol.h | 6 +---- src/audio/iaudiosettings.h | 5 +--- src/audio/iaudiosink.h | 5 +--- src/audio/iaudiosource.h | 5 +--- src/chatlog/chatline.h | 5 +--- src/chatlog/chatlinecontent.h | 5 +--- src/chatlog/chatlinecontentproxy.h | 5 +--- src/chatlog/chatlog.h | 5 +--- src/chatlog/chatmessage.h | 5 +--- src/chatlog/content/broken.h | 5 +--- src/chatlog/content/filetransferwidget.h | 5 +--- src/chatlog/content/image.h | 5 +--- src/chatlog/content/notificationicon.h | 5 +--- src/chatlog/content/spinner.h | 5 +--- src/chatlog/content/text.h | 5 +--- src/chatlog/content/timestamp.h | 5 +--- src/chatlog/customtextdocument.h | 5 +--- src/chatlog/documentcache.h | 5 +--- src/chatlog/pixmapcache.h | 5 +--- src/chatlog/textformatter.h | 5 +--- src/chatlog/toxfileprogress.h | 6 +---- src/core/contactid.h | 5 +--- src/core/core.h | 5 +--- src/core/coreav.h | 5 +--- src/core/corefile.h | 5 +--- src/core/dhtserver.h | 5 +--- src/core/groupid.h | 5 +--- src/core/icorefriendmessagesender.h | 6 +---- src/core/icoregroupmessagesender.h | 5 +--- src/core/icoregroupquery.h | 5 +--- src/core/icoreidhandler.h | 6 +---- src/core/icoresettings.h | 5 +--- src/core/receiptnum.h | 5 +--- src/core/toxcall.h | 5 +--- src/core/toxencrypt.h | 5 +--- src/core/toxfile.h | 5 +--- src/core/toxfilepause.h | 5 +--- src/core/toxid.h | 5 +--- src/core/toxlogger.h | 5 +--- src/core/toxoptions.h | 5 +--- src/core/toxpk.h | 5 +--- src/core/toxstring.h | 4 +--- src/friendlist.h | 5 +--- src/grouplist.h | 5 +--- src/ipc.h | 5 +--- src/model/about/aboutfriend.h | 5 +--- src/model/about/iaboutfriend.h | 5 +--- src/model/chathistory.h | 5 +--- src/model/chatlogitem.h | 5 +--- src/model/chatroom/chatroom.h | 5 +--- src/model/chatroom/friendchatroom.h | 5 +--- src/model/chatroom/groupchatroom.h | 5 +--- src/model/contact.h | 5 +--- src/model/dialogs/idialogs.h | 5 +--- src/model/dialogs/idialogsmanager.h | 5 +--- src/model/friend.h | 5 +--- src/model/friendmessagedispatcher.h | 6 +---- src/model/group.h | 5 +--- src/model/groupinvite.h | 5 +--- src/model/groupmessagedispatcher.h | 6 +---- src/model/ichatlog.h | 5 +--- src/model/imessagedispatcher.h | 5 +--- src/model/interface.h | 5 +--- src/model/message.h | 5 +--- src/model/profile/iprofileinfo.h | 2 ++ src/model/profile/profileinfo.h | 2 ++ src/model/sessionchatlog.h | 5 +--- src/model/status.h | 5 +--- src/model/toxclientstandards.h | 5 +--- src/net/avatarbroadcaster.h | 5 +--- src/net/bootstrapnodeupdater.h | 24 +++++++++++++++---- src/net/toxuri.h | 5 +--- src/net/updatecheck.h | 3 +++ src/nexus.h | 5 +--- src/persistence/db/rawdatabase.h | 5 +--- src/persistence/history.h | 5 +--- src/persistence/ifriendsettings.h | 4 +--- src/persistence/igroupsettings.h | 5 +--- src/persistence/offlinemsgengine.h | 5 +--- src/persistence/paths.h | 5 +--- src/persistence/profile.h | 5 +--- src/persistence/profilelocker.h | 5 +--- src/persistence/serialize.h | 5 +--- src/persistence/settings.h | 5 +--- src/persistence/settingsserializer.h | 5 +--- src/persistence/smileypack.h | 5 +--- src/persistence/toxsave.h | 5 +--- src/platform/autorun.h | 7 ++---- src/platform/camera/avfoundation.h | 5 +--- src/platform/camera/directshow.h | 5 +--- src/platform/camera/v4l2.h | 5 +--- src/platform/capslock.h | 7 ++---- .../desktop_notifications/desktopnotify.h | 5 +--- src/platform/install_osx.h | 5 +--- src/platform/posixsignalnotifier.h | 5 +--- src/platform/statusnotifier/closures.h | 5 +--- src/platform/statusnotifier/enums.h | 5 +--- src/platform/statusnotifier/interfaces.h | 5 +--- src/platform/statusnotifier/statusnotifier.h | 5 +--- src/platform/timer.h | 7 ++---- src/platform/x11_display.h | 7 ++---- src/util/strongtype.h | 4 +--- src/video/cameradevice.h | 5 +--- src/video/camerasource.h | 5 +--- src/video/corevideosource.h | 5 +--- src/video/ivideosettings.h | 5 +--- src/video/netcamview.h | 5 +--- src/video/videoframe.h | 5 +--- src/video/videomode.h | 5 +--- src/video/videosource.h | 5 +--- src/video/videosurface.h | 5 +--- src/widget/about/aboutfriendform.h | 5 +--- src/widget/categorywidget.h | 5 +--- src/widget/chatformheader.h | 5 +--- src/widget/circlewidget.h | 5 +--- src/widget/contentdialog.h | 5 +--- src/widget/contentdialogmanager.h | 5 +--- src/widget/contentlayout.h | 5 +--- src/widget/emoticonswidget.h | 5 +--- src/widget/flowlayout.h | 5 +--- src/widget/form/addfriendform.h | 5 +--- src/widget/form/chatform.h | 5 +--- src/widget/form/filesform.h | 5 +--- src/widget/form/genericchatform.h | 5 +--- src/widget/form/groupchatform.h | 5 +--- src/widget/form/groupinviteform.h | 5 +--- src/widget/form/groupinvitewidget.h | 5 +--- src/widget/form/loadhistorydialog.h | 5 +--- src/widget/form/profileform.h | 5 +--- src/widget/form/searchsettingsform.h | 5 +--- src/widget/form/setpassworddialog.h | 5 +--- src/widget/form/settings/aboutform.h | 5 +--- src/widget/form/settings/advancedform.h | 5 +--- src/widget/form/settings/avform.h | 5 +--- src/widget/form/settings/generalform.h | 5 +--- src/widget/form/settings/genericsettings.h | 5 +--- src/widget/form/settings/privacyform.h | 5 +--- src/widget/form/settings/userinterfaceform.h | 5 +--- .../form/settings/verticalonlyscroller.h | 5 +--- src/widget/form/settingswidget.h | 5 +--- src/widget/form/tabcompleter.h | 6 +---- src/widget/friendlistlayout.h | 5 +--- src/widget/friendlistwidget.h | 5 +--- src/widget/friendwidget.h | 5 +--- src/widget/genericchatitemlayout.h | 5 +--- src/widget/genericchatitemwidget.h | 5 +--- src/widget/genericchatroomwidget.h | 5 +--- src/widget/groupwidget.h | 5 +--- src/widget/gui.h | 5 +--- src/widget/loginscreen.h | 5 +--- src/widget/maskablepixmapwidget.h | 5 +--- src/widget/notificationedgewidget.h | 5 +--- src/widget/notificationscrollarea.h | 5 +--- src/widget/passwordedit.h | 4 +--- src/widget/qrwidget.h | 5 +--- src/widget/searchform.h | 5 +--- src/widget/searchtypes.h | 5 +--- src/widget/splitterrestorer.h | 5 +--- src/widget/style.h | 5 +--- src/widget/tool/activatedialog.h | 5 +--- src/widget/tool/adjustingscrollarea.h | 5 +--- src/widget/tool/callconfirmwidget.h | 5 +--- src/widget/tool/chattextedit.h | 5 +--- src/widget/tool/croppinglabel.h | 5 +--- src/widget/tool/flyoutoverlaywidget.h | 5 +--- src/widget/tool/friendrequestdialog.h | 5 +--- src/widget/tool/identicon.h | 5 +--- src/widget/tool/movablewidget.h | 5 +--- src/widget/tool/profileimporter.h | 5 +--- src/widget/tool/recursivesignalblocker.h | 5 +--- src/widget/tool/removefrienddialog.h | 5 +--- .../tool/screengrabberchooserrectitem.h | 6 +---- src/widget/tool/screengrabberoverlayitem.h | 5 +--- src/widget/tool/screenshotgrabber.h | 6 +---- src/widget/tool/toolboxgraphicsitem.h | 5 +--- src/widget/translator.h | 5 +--- src/widget/widget.h | 5 +--- 182 files changed, 211 insertions(+), 723 deletions(-) diff --git a/doc/coding_standards.md b/doc/coding_standards.md index a5982780f..5aae3d5d2 100644 --- a/doc/coding_standards.md +++ b/doc/coding_standards.md @@ -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 - diff --git a/src/audio/audio.h b/src/audio/audio.h index 826c2be77..b81062a1d 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -18,8 +18,7 @@ */ -#ifndef AUDIO_H -#define AUDIO_H +#pragma once #include @@ -30,5 +29,3 @@ class Audio public: static std::unique_ptr makeAudio(IAudioSettings& settings); }; - -#endif // AUDIO_H diff --git a/src/audio/backend/alsink.h b/src/audio/backend/alsink.h index b742bba13..1c9dfac71 100644 --- a/src/audio/backend/alsink.h +++ b/src/audio/backend/alsink.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ALSINK_H -#define ALSINK_H +#pragma once #include #include @@ -58,5 +57,3 @@ private: bool killed = false; mutable QMutex killLock; }; - -#endif // ALSINK_H diff --git a/src/audio/backend/alsource.h b/src/audio/backend/alsource.h index 64e2191f5..7ffe31b39 100644 --- a/src/audio/backend/alsource.h +++ b/src/audio/backend/alsource.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ALSOURCE_H -#define ALSOURCE_H +#pragma once #include "src/audio/iaudiosource.h" #include @@ -45,5 +44,3 @@ private: bool killed = false; mutable QMutex killLock; }; - -#endif // ALSOURCE_H diff --git a/src/audio/backend/openal.h b/src/audio/backend/openal.h index 64b4470ec..2aaab2b0e 100644 --- a/src/audio/backend/openal.h +++ b/src/audio/backend/openal.h @@ -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 diff --git a/src/audio/iaudiocontrol.h b/src/audio/iaudiocontrol.h index f2f75c699..dfaa0293f 100644 --- a/src/audio/iaudiocontrol.h +++ b/src/audio/iaudiocontrol.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef IAUDIOCONTROL_H -#define IAUDIOCONTROL_H +#pragma once #include #include @@ -146,6 +145,3 @@ protected: AUDIO_FRAME_DURATION * AUDIO_SAMPLE_RATE / 1000; uint32_t AUDIO_FRAME_SAMPLE_COUNT_TOTAL = 0; }; - - -#endif // IAUDIOCONTROL_H diff --git a/src/audio/iaudiosettings.h b/src/audio/iaudiosettings.h index 1d0547971..dc8862e60 100644 --- a/src/audio/iaudiosettings.h +++ b/src/audio/iaudiosettings.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/audio/iaudiosink.h b/src/audio/iaudiosink.h index 83f53c1b1..62f9c06fb 100644 --- a/src/audio/iaudiosink.h +++ b/src/audio/iaudiosink.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef IAUDIOSINK_H -#define IAUDIOSINK_H +#pragma once #include @@ -110,5 +109,3 @@ signals: DECLARE_SIGNAL(finishedPlaying); DECLARE_SIGNAL(invalidated); }; - -#endif // IAUDIOSINK_H diff --git a/src/audio/iaudiosource.h b/src/audio/iaudiosource.h index 0d732fd7d..c62f8628b 100644 --- a/src/audio/iaudiosource.h +++ b/src/audio/iaudiosource.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef IAUDIOSOURCE_H -#define IAUDIOSOURCE_H +#pragma once #include @@ -44,5 +43,3 @@ signals: void volumeAvailable(float value); void invalidated(); }; - -#endif // IAUDIOSOURCE_H diff --git a/src/chatlog/chatline.h b/src/chatlog/chatline.h index dbb1acf85..0872c3079 100644 --- a/src/chatlog/chatline.h +++ b/src/chatlog/chatline.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CHATLINE_H -#define CHATLINE_H +#pragma once #include #include @@ -116,5 +115,3 @@ private: QRectF bbox; bool isVisible = false; }; - -#endif // CHATLINE_H diff --git a/src/chatlog/chatlinecontent.h b/src/chatlog/chatlinecontent.h index f113af343..c148cae82 100644 --- a/src/chatlog/chatlinecontent.h +++ b/src/chatlog/chatlinecontent.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CHATLINECONTENT_H -#define CHATLINECONTENT_H +#pragma once #include @@ -69,5 +68,3 @@ private: int row = -1; int col = -1; }; - -#endif // CHATLINECONTENT_H diff --git a/src/chatlog/chatlinecontentproxy.h b/src/chatlog/chatlinecontentproxy.h index dd74615e0..7ecd71000 100644 --- a/src/chatlog/chatlinecontentproxy.h +++ b/src/chatlog/chatlinecontentproxy.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CHATLINECONTENTPROXY_H -#define CHATLINECONTENTPROXY_H +#pragma once #include "chatlinecontent.h" #include @@ -58,5 +57,3 @@ private: int widthMin; const ChatLineContentProxyType widgetType; }; - -#endif // CHATLINECONTENTPROXY_H diff --git a/src/chatlog/chatlog.h b/src/chatlog/chatlog.h index 0d91ef2b7..30eb0a872 100644 --- a/src/chatlog/chatlog.h +++ b/src/chatlog/chatlog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CHATLOG_H -#define CHATLOG_H +#pragma once #include #include @@ -189,5 +188,3 @@ private: int numRemove{0}; const int maxMessages{300}; }; - -#endif // CHATLOG_H diff --git a/src/chatlog/chatmessage.h b/src/chatlog/chatmessage.h index d8e03c81c..8eb6e3dd0 100644 --- a/src/chatlog/chatmessage.h +++ b/src/chatlog/chatmessage.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/chatlog/content/broken.h b/src/chatlog/content/broken.h index ab5534494..7197b3531 100644 --- a/src/chatlog/content/broken.h +++ b/src/chatlog/content/broken.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef BROKEN_H -#define BROKEN_H +#pragma once #include "../chatlinecontent.h" @@ -41,5 +40,3 @@ private: QPixmap pmap; QSize size; }; - -#endif // BROKEN_H diff --git a/src/chatlog/content/filetransferwidget.h b/src/chatlog/content/filetransferwidget.h index 94f37d5e1..d3929bb9b 100644 --- a/src/chatlog/content/filetransferwidget.h +++ b/src/chatlog/content/filetransferwidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef FILETRANSFERWIDGET_H -#define FILETRANSFERWIDGET_H +#pragma once #include #include @@ -109,5 +108,3 @@ private: LeftBottom = 8 }; }; - -#endif // FILETRANSFERWIDGET_H diff --git a/src/chatlog/content/image.h b/src/chatlog/content/image.h index 0b7226c6f..6de1aa7b7 100644 --- a/src/chatlog/content/image.h +++ b/src/chatlog/content/image.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef IMAGE_H -#define IMAGE_H +#pragma once #include "../chatlinecontent.h" @@ -39,5 +38,3 @@ private: QSize size; QPixmap pmap; }; - -#endif // IMAGE_H diff --git a/src/chatlog/content/notificationicon.h b/src/chatlog/content/notificationicon.h index 6d6611068..18395e331 100644 --- a/src/chatlog/content/notificationicon.h +++ b/src/chatlog/content/notificationicon.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/chatlog/content/spinner.h b/src/chatlog/content/spinner.h index 3a63de5fd..48abd9fdf 100644 --- a/src/chatlog/content/spinner.h +++ b/src/chatlog/content/spinner.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/chatlog/content/text.h b/src/chatlog/content/text.h index de3d6243b..624135fbf 100644 --- a/src/chatlog/content/text.h +++ b/src/chatlog/content/text.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 selectPoint{0, 0}; }; - -#endif // TEXT_H diff --git a/src/chatlog/content/timestamp.h b/src/chatlog/content/timestamp.h index 36ed2945d..4b2c75e5c 100644 --- a/src/chatlog/content/timestamp.h +++ b/src/chatlog/content/timestamp.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TIMESTAMP_H -#define TIMESTAMP_H +#pragma once #include "text.h" #include @@ -39,5 +38,3 @@ protected: private: QDateTime time; }; - -#endif // TIMESTAMP_H diff --git a/src/chatlog/customtextdocument.h b/src/chatlog/customtextdocument.h index c6ae023e9..c2fa77912 100644 --- a/src/chatlog/customtextdocument.h +++ b/src/chatlog/customtextdocument.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CUSTOMTEXTDOCUMENT_H -#define CUSTOMTEXTDOCUMENT_H +#pragma once #include #include @@ -39,5 +38,3 @@ protected: private: QList> emoticonIcons; }; - -#endif // CUSTOMTEXTDOCUMENT_H diff --git a/src/chatlog/documentcache.h b/src/chatlog/documentcache.h index 8f7567fec..8b9d8f190 100644 --- a/src/chatlog/documentcache.h +++ b/src/chatlog/documentcache.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef DOCUMENTCACHE_H -#define DOCUMENTCACHE_H +#pragma once #include @@ -41,5 +40,3 @@ private: private: QStack documents; }; - -#endif // DOCUMENTCACHE_H diff --git a/src/chatlog/pixmapcache.h b/src/chatlog/pixmapcache.h index c395ac5d1..2fc811008 100644 --- a/src/chatlog/pixmapcache.h +++ b/src/chatlog/pixmapcache.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ICONCACHE_H -#define ICONCACHE_H +#pragma once #include #include @@ -40,5 +39,3 @@ protected: private: QHash cache; }; - -#endif // ICONCACHE_H diff --git a/src/chatlog/textformatter.h b/src/chatlog/textformatter.h index 576b5db30..8660d2ee9 100644 --- a/src/chatlog/textformatter.h +++ b/src/chatlog/textformatter.h @@ -17,13 +17,10 @@ along with qTox. If not, see . */ -#ifndef TEXTFORMATTER_H -#define TEXTFORMATTER_H +#pragma once #include QString highlightURI(const QString& message); QString applyMarkdown(const QString& message, bool showFormattingSymbols); - -#endif // TEXTFORMATTER_H diff --git a/src/chatlog/toxfileprogress.h b/src/chatlog/toxfileprogress.h index b02e5dec0..aacb16458 100644 --- a/src/chatlog/toxfileprogress.h +++ b/src/chatlog/toxfileprogress.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOXFILEPROGRESS_H -#define TOXFILEPROGRESS_H +#pragma once #include @@ -48,6 +47,3 @@ private: double timeLeftSeconds; double progress; }; - - -#endif // TOXFILEPROGRESS_H diff --git a/src/core/contactid.h b/src/core/contactid.h index 78a6c10ae..61a96e8d4 100644 --- a/src/core/contactid.h +++ b/src/core/contactid.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CONTACTID_H -#define CONTACTID_H +#pragma once #include #include @@ -53,5 +52,3 @@ inline uint qHash(const ContactId& id) } using ContactIdPtr = std::shared_ptr; - -#endif // CONTACTID_H diff --git a/src/core/core.h b/src/core/core.h index 1cafc8b84..b0c6b7af9 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -18,8 +18,7 @@ along with qTox. If not, see . */ -#ifndef CORE_HPP -#define CORE_HPP +#pragma once #include "groupid.h" #include "icorefriendmessagesender.h" @@ -253,5 +252,3 @@ private: std::unique_ptr coreThread; }; - -#endif // CORE_HPP diff --git a/src/core/coreav.h b/src/core/coreav.h index 3b312e47d..fb2845b0a 100644 --- a/src/core/coreav.h +++ b/src/core/coreav.h @@ -18,8 +18,7 @@ along with qTox. If not, see . */ -#ifndef COREAV_H -#define COREAV_H +#pragma once #include "src/core/toxcall.h" #include @@ -158,5 +157,3 @@ private: */ QMutex& coreLock; }; - -#endif // COREAV_H diff --git a/src/core/corefile.h b/src/core/corefile.h index 429e7579a..d6e32a787 100644 --- a/src/core/corefile.h +++ b/src/core/corefile.h @@ -18,8 +18,7 @@ */ -#ifndef COREFILE_H -#define COREFILE_H +#pragma once #include @@ -109,5 +108,3 @@ private: Tox* tox; QMutex* coreLoopLock = nullptr; }; - -#endif // COREFILE_H diff --git a/src/core/dhtserver.h b/src/core/dhtserver.h index 87061c1b1..baa8ee2a4 100644 --- a/src/core/dhtserver.h +++ b/src/core/dhtserver.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef DHT_SERVER_H -#define DHT_SERVER_H +#pragma once #include @@ -32,5 +31,3 @@ struct DhtServer bool operator==(const DhtServer& other) const; bool operator!=(const DhtServer& other) const; }; - -#endif // DHT_SERVER_H diff --git a/src/core/groupid.h b/src/core/groupid.h index a05e1f73a..02135e2e6 100644 --- a/src/core/groupid.h +++ b/src/core/groupid.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUPID_H -#define GROUPID_H +#pragma once #include "src/core/contactid.h" #include @@ -33,5 +32,3 @@ public: explicit GroupId(const uint8_t* rawId); int getSize() const override; }; - -#endif // GROUPID_H diff --git a/src/core/icorefriendmessagesender.h b/src/core/icorefriendmessagesender.h index f9e1960a2..5ce7b4dd8 100644 --- a/src/core/icorefriendmessagesender.h +++ b/src/core/icorefriendmessagesender.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 */ diff --git a/src/core/icoregroupmessagesender.h b/src/core/icoregroupmessagesender.h index 537c8a0a8..40edf432c 100644 --- a/src/core/icoregroupmessagesender.h +++ b/src/core/icoregroupmessagesender.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ICORE_GROUP_MESSAGE_SENDER_H -#define ICORE_GROUP_MESSAGE_SENDER_H +#pragma once #include @@ -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*/ diff --git a/src/core/icoregroupquery.h b/src/core/icoregroupquery.h index 00aef71a4..51a3b678e 100644 --- a/src/core/icoregroupquery.h +++ b/src/core/icoregroupquery.h @@ -18,8 +18,7 @@ along with qTox. If not, see . */ -#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*/ diff --git a/src/core/icoreidhandler.h b/src/core/icoreidhandler.h index eb3717dcb..e8884f842 100644 --- a/src/core/icoreidhandler.h +++ b/src/core/icoreidhandler.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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*/ diff --git a/src/core/icoresettings.h b/src/core/icoresettings.h index 624eac9da..43b6e0bb3 100644 --- a/src/core/icoresettings.h +++ b/src/core/icoresettings.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/core/receiptnum.h b/src/core/receiptnum.h index f6bce040c..5cca6af6a 100644 --- a/src/core/receiptnum.h +++ b/src/core/receiptnum.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef RECEIPT_NUM_H -#define RECEIPT_NUM_H +#pragma once #include "src/util/strongtype.h" @@ -27,5 +26,3 @@ using ReceiptNum = NamedType; Q_DECLARE_METATYPE(ReceiptNum) - -#endif /* RECEIPT_NUM_H */ diff --git a/src/core/toxcall.h b/src/core/toxcall.h index 4bf16d0a0..aca35309f 100644 --- a/src/core/toxcall.h +++ b/src/core/toxcall.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/core/toxencrypt.h b/src/core/toxencrypt.h index e56e72267..8db1f39ea 100644 --- a/src/core/toxencrypt.h +++ b/src/core/toxencrypt.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOXENCRYPT_H -#define TOXENCRYPT_H +#pragma once #include #include @@ -51,5 +50,3 @@ private: private: Tox_Pass_Key* passKey = nullptr; }; - -#endif // TOXENCRYPT_H diff --git a/src/core/toxfile.h b/src/core/toxfile.h index 38c99cf6d..51b4a872d 100644 --- a/src/core/toxfile.h +++ b/src/core/toxfile.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CORESTRUCTS_H -#define CORESTRUCTS_H +#pragma once #include "src/core/toxfilepause.h" @@ -76,5 +75,3 @@ struct ToxFile std::shared_ptr hashGenerator = std::make_shared(QCryptographicHash::Sha256); ToxFilePause pauseStatus; }; - -#endif // CORESTRUCTS_H diff --git a/src/core/toxfilepause.h b/src/core/toxfilepause.h index a880e7522..5e5f124f7 100644 --- a/src/core/toxfilepause.h +++ b/src/core/toxfilepause.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/core/toxid.h b/src/core/toxid.h index f668a8761..4972b5f1d 100644 --- a/src/core/toxid.h +++ b/src/core/toxid.h @@ -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 diff --git a/src/core/toxlogger.h b/src/core/toxlogger.h index 97a57c891..562787b19 100644 --- a/src/core/toxlogger.h +++ b/src/core/toxlogger.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOXLOGGER_H -#define TOXLOGGER_H +#pragma once #include @@ -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 diff --git a/src/core/toxoptions.h b/src/core/toxoptions.h index bea857b28..d1439f62a 100644 --- a/src/core/toxoptions.h +++ b/src/core/toxoptions.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOXOPTIONS_H -#define TOXOPTIONS_H +#pragma once #include @@ -46,5 +45,3 @@ private: Tox_Options* options = nullptr; QByteArray proxyAddrData; }; - -#endif // TOXOPTIONS_H diff --git a/src/core/toxpk.h b/src/core/toxpk.h index cf4394832..b88536d12 100644 --- a/src/core/toxpk.h +++ b/src/core/toxpk.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOXPK_H -#define TOXPK_H +#pragma once #include "src/core/contactid.h" #include @@ -33,5 +32,3 @@ public: explicit ToxPk(const uint8_t* rawId); int getSize() const override; }; - -#endif // TOXPK_H diff --git a/src/core/toxstring.h b/src/core/toxstring.h index bc68e6b34..c5c209154 100644 --- a/src/core/toxstring.h +++ b/src/core/toxstring.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOXSTRING_H -#define TOXSTRING_H +#pragma once #include #include @@ -40,4 +39,3 @@ public: private: QByteArray string; }; -#endif // TOXSTRING_H diff --git a/src/friendlist.h b/src/friendlist.h index 49b906d79..4761b3161 100644 --- a/src/friendlist.h +++ b/src/friendlist.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef FRIENDLIST_H -#define FRIENDLIST_H +#pragma once #include @@ -46,5 +45,3 @@ private: static QHash friendList; static QHash id2key; }; - -#endif // FRIENDLIST_H diff --git a/src/grouplist.h b/src/grouplist.h index 694a214f2..8ace8d1e3 100644 --- a/src/grouplist.h +++ b/src/grouplist.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUPLIST_H -#define GROUPLIST_H +#pragma once #include "src/core/groupid.h" @@ -43,5 +42,3 @@ private: static QHash groupList; static QHash id2key; }; - -#endif // GROUPLIST_H diff --git a/src/ipc.h b/src/ipc.h index 3b65880a8..b81485797 100644 --- a/src/ipc.h +++ b/src/ipc.h @@ -18,8 +18,7 @@ */ -#ifndef IPC_H -#define IPC_H +#pragma once #include #include @@ -91,5 +90,3 @@ private: QSharedMemory globalMemory; QMap eventHandlers; }; - -#endif // IPC_H diff --git a/src/model/about/aboutfriend.h b/src/model/about/aboutfriend.h index 665419f2c..56c328e19 100644 --- a/src/model/about/aboutfriend.h +++ b/src/model/about/aboutfriend.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/model/about/iaboutfriend.h b/src/model/about/iaboutfriend.h index 7123cb63d..9f972bb3f 100644 --- a/src/model/about/iaboutfriend.h +++ b/src/model/about/iaboutfriend.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/model/chathistory.h b/src/model/chathistory.h index a1625e8ce..1e771e96c 100644 --- a/src/model/chathistory.h +++ b/src/model/chathistory.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 dispatchedMessageRowIdMap; }; - -#endif /*CHAT_HISTORY_H*/ diff --git a/src/model/chatlogitem.h b/src/model/chatlogitem.h index a22a9539c..96c748001 100644 --- a/src/model/chatlogitem.h +++ b/src/model/chatlogitem.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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*/ diff --git a/src/model/chatroom/chatroom.h b/src/model/chatroom/chatroom.h index 1aaba6082..2d71f3a62 100644 --- a/src/model/chatroom/chatroom.h +++ b/src/model/chatroom/chatroom.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 */ diff --git a/src/model/chatroom/friendchatroom.h b/src/model/chatroom/friendchatroom.h index 8be49315b..9c34bbc7f 100644 --- a/src/model/chatroom/friendchatroom.h +++ b/src/model/chatroom/friendchatroom.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/model/chatroom/groupchatroom.h b/src/model/chatroom/groupchatroom.h index ded2127e0..97b227daa 100644 --- a/src/model/chatroom/groupchatroom.h +++ b/src/model/chatroom/groupchatroom.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 */ diff --git a/src/model/contact.h b/src/model/contact.h index 182d1ce90..2b94b0059 100644 --- a/src/model/contact.h +++ b/src/model/contact.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CONTACT_H -#define CONTACT_H +#pragma once #include "src/core/contactid.h" #include @@ -42,5 +41,3 @@ public: signals: void displayedNameChanged(const QString& newName); }; - -#endif // CONTACT_H diff --git a/src/model/dialogs/idialogs.h b/src/model/dialogs/idialogs.h index 0fee87a46..0d5f715a5 100644 --- a/src/model/dialogs/idialogs.h +++ b/src/model/dialogs/idialogs.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/model/dialogs/idialogsmanager.h b/src/model/dialogs/idialogsmanager.h index 442fbc3fa..ddcd78c34 100644 --- a/src/model/dialogs/idialogsmanager.h +++ b/src/model/dialogs/idialogsmanager.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/model/friend.h b/src/model/friend.h index 46f1c08d8..fa6481677 100644 --- a/src/model/friend.h +++ b/src/model/friend.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/model/friendmessagedispatcher.h b/src/model/friendmessagedispatcher.h index 63efe5e13..66011447d 100644 --- a/src/model/friendmessagedispatcher.h +++ b/src/model/friendmessagedispatcher.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 */ diff --git a/src/model/group.h b/src/model/group.h index 8c4cd869c..e72e684c6 100644 --- a/src/model/group.h +++ b/src/model/group.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUP_H -#define GROUP_H +#pragma once #include "contact.h" @@ -86,5 +85,3 @@ private: const GroupId groupId; bool avGroupchat; }; - -#endif // GROUP_H diff --git a/src/model/groupinvite.h b/src/model/groupinvite.h index 6d7000a4b..7657d5fa1 100644 --- a/src/model/groupinvite.h +++ b/src/model/groupinvite.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUPINVITE_H -#define GROUPINVITE_H +#pragma once #include #include @@ -42,5 +41,3 @@ private: QByteArray invite; QDateTime date; }; - -#endif // GROUPINVITE_H diff --git a/src/model/groupmessagedispatcher.h b/src/model/groupmessagedispatcher.h index 1ba1a788f..0cbcc4024 100644 --- a/src/model/groupmessagedispatcher.h +++ b/src/model/groupmessagedispatcher.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 */ diff --git a/src/model/ichatlog.h b/src/model/ichatlog.h index f4181a51f..1b152c941 100644 --- a/src/model/ichatlog.h +++ b/src/model/ichatlog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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*/ diff --git a/src/model/imessagedispatcher.h b/src/model/imessagedispatcher.h index 37bb23532..78b9466e5 100644 --- a/src/model/imessagedispatcher.h +++ b/src/model/imessagedispatcher.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 */ diff --git a/src/model/interface.h b/src/model/interface.h index 2e8ef2f36..fa5f9db76 100644 --- a/src/model/interface.h +++ b/src/model/interface.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef INTERFACE_H -#define INTERFACE_H +#pragma once #include @@ -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 diff --git a/src/model/message.h b/src/model/message.h index 13783571c..059ce64c6 100644 --- a/src/model/message.h +++ b/src/model/message.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef MESSAGE_H -#define MESSAGE_H +#pragma once #include #include @@ -114,5 +113,3 @@ private: bool detectingMentions = false; const SharedParams& sharedParams; }; - -#endif /*MESSAGE_H*/ diff --git a/src/model/profile/iprofileinfo.h b/src/model/profile/iprofileinfo.h index 999a8383f..5db6f7262 100644 --- a/src/model/profile/iprofileinfo.h +++ b/src/model/profile/iprofileinfo.h @@ -17,6 +17,8 @@ along with qTox. If not, see . */ +#pragma once + #include "src/model/interface.h" #include diff --git a/src/model/profile/profileinfo.h b/src/model/profile/profileinfo.h index 0cb55620d..09ea61b8e 100644 --- a/src/model/profile/profileinfo.h +++ b/src/model/profile/profileinfo.h @@ -17,6 +17,8 @@ along with qTox. If not, see . */ +#pragma once + #include #include "src/model/interface.h" #include "src/core/toxpk.h" diff --git a/src/model/sessionchatlog.h b/src/model/sessionchatlog.h index 51234b847..95f67a18b 100644 --- a/src/model/sessionchatlog.h +++ b/src/model/sessionchatlog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SESSION_CHAT_LOG_H -#define SESSION_CHAT_LOG_H +#pragma once #include "ichatlog.h" #include "imessagedispatcher.h" @@ -89,5 +88,3 @@ private: */ QMap outgoingMessages; }; - -#endif /*SESSION_CHAT_LOG_H*/ diff --git a/src/model/status.h b/src/model/status.h index 5ee11664e..e95a56cbd 100644 --- a/src/model/status.h +++ b/src/model/status.h @@ -20,8 +20,7 @@ #include #include -#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 diff --git a/src/model/toxclientstandards.h b/src/model/toxclientstandards.h index 80e28c4ab..0d265c431 100644 --- a/src/model/toxclientstandards.h +++ b/src/model/toxclientstandards.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOXCLIENTSTANDARDS_H -#define TOXCLIENTSTANDARDS_H +#pragma once #include @@ -31,5 +30,3 @@ namespace ToxClientStandards return fileSize <= MaxAvatarSize; } } // ToxClientStandards - -#endif // TOXCLIENTSTANDARDS_H diff --git a/src/net/avatarbroadcaster.h b/src/net/avatarbroadcaster.h index f93d92d76..655c0554f 100644 --- a/src/net/avatarbroadcaster.h +++ b/src/net/avatarbroadcaster.h @@ -18,8 +18,7 @@ */ -#ifndef AVATARBROADCASTER_H -#define AVATARBROADCASTER_H +#pragma once #include #include @@ -38,5 +37,3 @@ private: static QByteArray avatarData; static QMap friendsSentTo; }; - -#endif // AVATARBROADCASTER_H diff --git a/src/net/bootstrapnodeupdater.h b/src/net/bootstrapnodeupdater.h index 2ce82b63b..ff3a1cfcc 100644 --- a/src/net/bootstrapnodeupdater.h +++ b/src/net/bootstrapnodeupdater.h @@ -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 . +*/ + +#pragma once #include #include @@ -32,5 +50,3 @@ private: QNetworkProxy proxy; QNetworkAccessManager nam; }; - -#endif // BOOTSTRAPNODEUPDATER_H diff --git a/src/net/toxuri.h b/src/net/toxuri.h index 648fff9db..947ecc80f 100644 --- a/src/net/toxuri.h +++ b/src/net/toxuri.h @@ -18,8 +18,7 @@ */ -#ifndef TOXURI_H -#define TOXURI_H +#pragma once #include @@ -39,5 +38,3 @@ public: private: QPlainTextEdit* messageEdit; }; - -#endif // TOXURI_H diff --git a/src/net/updatecheck.h b/src/net/updatecheck.h index 30edeedb9..8ca037a80 100644 --- a/src/net/updatecheck.h +++ b/src/net/updatecheck.h @@ -16,6 +16,9 @@ You should have received a copy of the GNU General Public License along with qTox. If not, see . */ + +#pragma once + #include #include #include diff --git a/src/nexus.h b/src/nexus.h index 3cd7c5f07..505169a0f 100644 --- a/src/nexus.h +++ b/src/nexus.h @@ -18,8 +18,7 @@ */ -#ifndef NEXUS_H -#define NEXUS_H +#pragma once #include @@ -106,5 +105,3 @@ private: std::unique_ptr audioControl; QCommandLineParser* parser = nullptr; }; - -#endif // NEXUS_H diff --git a/src/persistence/db/rawdatabase.h b/src/persistence/db/rawdatabase.h index 8151d9d52..1686aa841 100644 --- a/src/persistence/db/rawdatabase.h +++ b/src/persistence/db/rawdatabase.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/persistence/history.h b/src/persistence/history.h index fcdf3a8ac..0fac18330 100644 --- a/src/persistence/history.h +++ b/src/persistence/history.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef HISTORY_H -#define HISTORY_H +#pragma once #include #include @@ -220,5 +219,3 @@ private: // This needs to be a shared pointer to avoid callback lifetime issues QHash fileInfos; }; - -#endif // HISTORY_H diff --git a/src/persistence/ifriendsettings.h b/src/persistence/ifriendsettings.h index 5f2f04370..c2649dfbe 100644 --- a/src/persistence/ifriendsettings.h +++ b/src/persistence/ifriendsettings.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/persistence/igroupsettings.h b/src/persistence/igroupsettings.h index ce9a94db5..1c283822b 100644 --- a/src/persistence/igroupsettings.h +++ b/src/persistence/igroupsettings.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef IGROUP_SETTINGS_H -#define IGROUP_SETTINGS_H +#pragma once #include @@ -31,5 +30,3 @@ public: virtual bool getGroupAlwaysNotify() const = 0; virtual void setGroupAlwaysNotify(bool newValue) = 0; }; - -#endif /*IGROUP_SETTINGS_H*/ diff --git a/src/persistence/offlinemsgengine.h b/src/persistence/offlinemsgengine.h index adac2aa93..ed4ceb307 100644 --- a/src/persistence/offlinemsgengine.h +++ b/src/persistence/offlinemsgengine.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef OFFLINEMSGENGINE_H -#define OFFLINEMSGENGINE_H +#pragma once #include "src/chatlog/chatmessage.h" #include "src/core/core.h" @@ -70,5 +69,3 @@ private: QMap sentMessages; QVector unsentMessages; }; - -#endif // OFFLINEMSGENGINE_H diff --git a/src/persistence/paths.h b/src/persistence/paths.h index 27b9ada53..5db3683ba 100644 --- a/src/persistence/paths.h +++ b/src/persistence/paths.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef PATHS_H -#define PATHS_H +#pragma once #include #include @@ -50,5 +49,3 @@ private: QString basePath{}; bool portable = false; }; - -#endif // PATHS_H diff --git a/src/persistence/profile.h b/src/persistence/profile.h index 5388a02b9..c7a7648f6 100644 --- a/src/persistence/profile.h +++ b/src/persistence/profile.h @@ -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 diff --git a/src/persistence/profilelocker.h b/src/persistence/profilelocker.h index de4b3e5dd..87968aac8 100644 --- a/src/persistence/profilelocker.h +++ b/src/persistence/profilelocker.h @@ -18,8 +18,7 @@ */ -#ifndef PROFILELOCKER_H -#define PROFILELOCKER_H +#pragma once #include #include @@ -45,5 +44,3 @@ private: static std::unique_ptr lockfile; static QString curLockName; }; - -#endif // PROFILELOCKER_H diff --git a/src/persistence/serialize.h b/src/persistence/serialize.h index 6cea5a597..692e8dc49 100644 --- a/src/persistence/serialize.h +++ b/src/persistence/serialize.h @@ -18,8 +18,7 @@ */ -#ifndef SERIALIZE_H -#define SERIALIZE_H +#pragma once #include #include @@ -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 diff --git a/src/persistence/settings.h b/src/persistence/settings.h index 42c39a4e7..52bee3106 100644 --- a/src/persistence/settings.h +++ b/src/persistence/settings.h @@ -18,8 +18,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/persistence/settingsserializer.h b/src/persistence/settingsserializer.h index 88eea77ff..703046e64 100644 --- a/src/persistence/settingsserializer.h +++ b/src/persistence/settingsserializer.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SETTINGSSERIALIZER_H -#define SETTINGSSERIALIZER_H +#pragma once #include "src/core/toxencrypt.h" @@ -111,5 +110,3 @@ private: QVector values; static const char magic[]; }; - -#endif // SETTINGSSERIALIZER_H diff --git a/src/persistence/smileypack.h b/src/persistence/smileypack.h index 5a327692f..1655b3f41 100644 --- a/src/persistence/smileypack.h +++ b/src/persistence/smileypack.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SMILEYPACK_H -#define SMILEYPACK_H +#pragma once #include #include @@ -63,5 +62,3 @@ private: QRegularExpression smilify; mutable QMutex loadingMutex; }; - -#endif // SMILEYPACK_H diff --git a/src/persistence/toxsave.h b/src/persistence/toxsave.h index c0e3d98e1..ca64ad488 100644 --- a/src/persistence/toxsave.h +++ b/src/persistence/toxsave.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#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 diff --git a/src/platform/autorun.h b/src/platform/autorun.h index 9aa607051..ffe168772 100644 --- a/src/platform/autorun.h +++ b/src/platform/autorun.h @@ -17,10 +17,9 @@ along with qTox. If not, see . */ -#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 diff --git a/src/platform/camera/avfoundation.h b/src/platform/camera/avfoundation.h index fa494fa43..722d4d1a2 100644 --- a/src/platform/camera/avfoundation.h +++ b/src/platform/camera/avfoundation.h @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with qTox. If not, see . */ -#ifndef AVFOUNDATION_H -#define AVFOUNDATION_H +#pragma once #include "src/video/videomode.h" #include @@ -34,5 +33,3 @@ const QString CAPTURE_SCREEN{"Capture screen"}; QVector getDeviceModes(QString devName); QVector> getDeviceList(); } - -#endif // AVFOUNDATION_H diff --git a/src/platform/camera/directshow.h b/src/platform/camera/directshow.h index 9efd12e31..828c4f768 100644 --- a/src/platform/camera/directshow.h +++ b/src/platform/camera/directshow.h @@ -18,8 +18,7 @@ */ -#ifndef DIRECTSHOW_H -#define DIRECTSHOW_H +#pragma once #include "src/video/videomode.h" #include @@ -34,5 +33,3 @@ namespace DirectShow { QVector> getDeviceList(); QVector getDeviceModes(QString devName); } - -#endif // DIRECTSHOW_H diff --git a/src/platform/camera/v4l2.h b/src/platform/camera/v4l2.h index 198417092..ff06e6b0b 100644 --- a/src/platform/camera/v4l2.h +++ b/src/platform/camera/v4l2.h @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with qTox. If not, see . */ -#ifndef V4L2_H -#define V4L2_H +#pragma once #include "src/video/videomode.h" #include @@ -34,5 +33,3 @@ QVector> getDeviceList(); QString getPixelFormatString(uint32_t pixel_format); bool betterPixelFormat(uint32_t a, uint32_t b); } - -#endif // V4L2_H diff --git a/src/platform/capslock.h b/src/platform/capslock.h index 7f4322f6a..bd2bf95f1 100644 --- a/src/platform/capslock.h +++ b/src/platform/capslock.h @@ -17,16 +17,13 @@ along with qTox. If not, see . */ -#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 diff --git a/src/platform/desktop_notifications/desktopnotify.h b/src/platform/desktop_notifications/desktopnotify.h index 8c6565f9a..cd6baedad 100644 --- a/src/platform/desktop_notifications/desktopnotify.h +++ b/src/platform/desktop_notifications/desktopnotify.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef DESKTOPNOTIFY_H -#define DESKTOPNOTIFY_H +#pragma once #if DESKTOP_NOTIFICATIONS #include @@ -54,5 +53,3 @@ private: Snore::Icon snoreIcon; }; #endif // DESKTOP_NOTIFICATIONS - -#endif // DESKTOPNOTIFY_H diff --git a/src/platform/install_osx.h b/src/platform/install_osx.h index 090731559..60566d517 100644 --- a/src/platform/install_osx.h +++ b/src/platform/install_osx.h @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with qTox. If not, see . */ -#ifndef INSTALLOSX_H -#define INSTALLOSX_H +#pragma once #include @@ -33,5 +32,3 @@ static constexpr int EXIT_UPDATE_MACX_FAIL = 216; void moveToAppFolder(); void migrateProfiles(); } - -#endif // INSTALLOSX_H diff --git a/src/platform/posixsignalnotifier.h b/src/platform/posixsignalnotifier.h index 12e8d02c8..200b787f2 100644 --- a/src/platform/posixsignalnotifier.h +++ b/src/platform/posixsignalnotifier.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef POSIXSIGNALNOTIFIER_H -#define POSIXSIGNALNOTIFIER_H +#pragma once #include @@ -49,5 +48,3 @@ private: private: QSocketNotifier* notifier{nullptr}; }; - -#endif // POSIXSIGNALNOTIFIER_H diff --git a/src/platform/statusnotifier/closures.h b/src/platform/statusnotifier/closures.h index b35343659..db32203d8 100644 --- a/src/platform/statusnotifier/closures.h +++ b/src/platform/statusnotifier/closures.h @@ -20,8 +20,7 @@ * statusnotifier. If not, see http://www.gnu.org/licenses/ */ -#ifndef __g_cclosure_user_marshal_MARSHAL_H__ -#define __g_cclosure_user_marshal_MARSHAL_H__ +#pragma once #include @@ -33,5 +32,3 @@ extern void g_cclosure_user_marshal_BOOLEAN__INT_INT(GClosure* closure, GValue* gpointer invocation_hint, gpointer marshal_data); G_END_DECLS - -#endif /* __g_cclosure_user_marshal_MARSHAL_H__ */ diff --git a/src/platform/statusnotifier/enums.h b/src/platform/statusnotifier/enums.h index c8d059f87..3bfbc70a5 100644 --- a/src/platform/statusnotifier/enums.h +++ b/src/platform/statusnotifier/enums.h @@ -20,8 +20,7 @@ * statusnotifier. If not, see http://www.gnu.org/licenses/ */ -#ifndef __STATUS_NOTIFIER_ENUMS_H__ -#define __STATUS_NOTIFIER_ENUMS_H__ +#pragma once #include "statusnotifier.h" @@ -38,5 +37,3 @@ GType status_notifier_status_get_type(void); GType status_notifier_scroll_orientation_get_type(void); #define TYPE_STATUS_NOTIFIER_SCROLL_ORIENTATION (status_notifier_scroll_orientation_get_type()) G_END_DECLS - -#endif /* __STATUS_NOTIFIER_ENUMS_H__ */ diff --git a/src/platform/statusnotifier/interfaces.h b/src/platform/statusnotifier/interfaces.h index 3676211b2..3baeabe46 100644 --- a/src/platform/statusnotifier/interfaces.h +++ b/src/platform/statusnotifier/interfaces.h @@ -20,8 +20,7 @@ * statusnotifier. If not, see http://www.gnu.org/licenses/ */ -#ifndef __INTERFACES_H__ -#define __INTERFACES_H__ +#pragma once G_BEGIN_DECLS @@ -90,5 +89,3 @@ static const gchar item_xml[] = ""; G_END_DECLS - -#endif /* __INTERFACES_H__ */ diff --git a/src/platform/statusnotifier/statusnotifier.h b/src/platform/statusnotifier/statusnotifier.h index cc9d4b91f..83c7e0e50 100644 --- a/src/platform/statusnotifier/statusnotifier.h +++ b/src/platform/statusnotifier/statusnotifier.h @@ -20,8 +20,7 @@ * statusnotifier. If not, see http://www.gnu.org/licenses/ */ -#ifndef __STATUS_NOTIFIER_H__ -#define __STATUS_NOTIFIER_H__ +#pragma once #include #include @@ -246,5 +245,3 @@ void status_notifier_register(StatusNotifier* sn); StatusNotifierState status_notifier_get_state(StatusNotifier* sn); G_END_DECLS - -#endif /* __STATUS_NOTIFIER_H__ */ diff --git a/src/platform/timer.h b/src/platform/timer.h index a500b323a..4b2b224c7 100644 --- a/src/platform/timer.h +++ b/src/platform/timer.h @@ -17,10 +17,9 @@ along with qTox. If not, see . */ -#ifdef QTOX_PLATFORM_EXT +#pragma once -#ifndef PLATFORM_TIMER_H -#define PLATFORM_TIMER_H +#ifdef QTOX_PLATFORM_EXT #include @@ -30,5 +29,3 @@ uint32_t getIdleTime(); } #endif // PLATFORM_TIMER_H - -#endif // QTOX_PLATFORM_EXT diff --git a/src/platform/x11_display.h b/src/platform/x11_display.h index bed5f6756..7c021d58b 100644 --- a/src/platform/x11_display.h +++ b/src/platform/x11_display.h @@ -17,10 +17,9 @@ along with qTox. If not, see . */ -#ifdef QTOX_PLATFORM_EXT +#pragma once -#ifndef PLATFORM_X11_DISPLAY_H -#define PLATFORM_X11_DISPLAY_H +#ifdef QTOX_PLATFORM_EXT typedef struct _XDisplay Display; @@ -33,6 +32,4 @@ void unlock(); } -#endif // PLATFORM_X11_DISPLAY_H - #endif // QTOX_PLATFORM_EXT diff --git a/src/util/strongtype.h b/src/util/strongtype.h index d4c8d8e60..841f6bee2 100644 --- a/src/util/strongtype.h +++ b/src/util/strongtype.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef STRONGTYPE_H -#define STRONGTYPE_H +#pragma once #include @@ -129,4 +128,3 @@ uint qHash(const NamedType& key, uint seed = 0) { return qHash(key.get(), seed); } -#endif // STRONGTYPE_H diff --git a/src/video/cameradevice.h b/src/video/cameradevice.h index 3ea59b3f2..910873325 100644 --- a/src/video/cameradevice.h +++ b/src/video/cameradevice.h @@ -18,8 +18,7 @@ */ -#ifndef CAMERADEVICE_H -#define CAMERADEVICE_H +#pragma once #include "videomode.h" #include @@ -67,5 +66,3 @@ private: static QMutex openDeviceLock, iformatLock; static AVInputFormat *iformat, *idesktopFormat; }; - -#endif // CAMERADEVICE_H diff --git a/src/video/camerasource.h b/src/video/camerasource.h index f72aa363d..fa4f3966d 100644 --- a/src/video/camerasource.h +++ b/src/video/camerasource.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CAMERA_H -#define CAMERA_H +#pragma once #include "src/video/videomode.h" #include "src/video/videosource.h" @@ -82,5 +81,3 @@ private: static CameraSource* instance; }; - -#endif // CAMERA_H diff --git a/src/video/corevideosource.h b/src/video/corevideosource.h index 160410d10..dfd2e7582 100644 --- a/src/video/corevideosource.h +++ b/src/video/corevideosource.h @@ -18,8 +18,7 @@ */ -#ifndef COREVIDEOSOURCE_H -#define COREVIDEOSOURCE_H +#pragma once #include "videosource.h" #include @@ -52,5 +51,3 @@ private: friend class CoreAV; friend class ToxFriendCall; }; - -#endif // COREVIDEOSOURCE_H diff --git a/src/video/ivideosettings.h b/src/video/ivideosettings.h index 4b657efc8..9d948da2a 100644 --- a/src/video/ivideosettings.h +++ b/src/video/ivideosettings.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef I_VIDEO_SETTINGS_H -#define I_VIDEO_SETTINGS_H +#pragma once #include "src/model/interface.h" @@ -50,5 +49,3 @@ public: DECLARE_SIGNAL(camVideoResChanged, const QRect& region); DECLARE_SIGNAL(camVideoFPSChanged, unsigned short fps); }; - -#endif // I_VIDEO_SETTINGS_H diff --git a/src/video/netcamview.h b/src/video/netcamview.h index 6ddb8aabb..54a3e626c 100644 --- a/src/video/netcamview.h +++ b/src/video/netcamview.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef NETCAMVIEW_H -#define NETCAMVIEW_H +#pragma once #include "src/core/toxpk.h" #include @@ -97,5 +96,3 @@ private: QPushButton* endVideoButton = nullptr; QPushButton* exitFullScreenButton = nullptr; }; - -#endif // NETCAMVIEW_H diff --git a/src/video/videoframe.h b/src/video/videoframe.h index f13893b24..950ed4c25 100644 --- a/src/video/videoframe.h +++ b/src/video/videoframe.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef VIDEOFRAME_H -#define VIDEOFRAME_H +#pragma once #include #include @@ -163,5 +162,3 @@ private: QReadWriteLock frameLock{}; static QReadWriteLock refsLock; }; - -#endif // VIDEOFRAME_H diff --git a/src/video/videomode.h b/src/video/videomode.h index d3ecd45aa..c755e3fb1 100644 --- a/src/video/videomode.h +++ b/src/video/videomode.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef VIDEOMODE_H -#define VIDEOMODE_H +#pragma once #include #include @@ -41,5 +40,3 @@ struct VideoMode uint32_t norm(const VideoMode& other) const; uint32_t tolerance() const; }; - -#endif // VIDEOMODE_H diff --git a/src/video/videosource.h b/src/video/videosource.h index ff9a77d6e..ea71445c0 100644 --- a/src/video/videosource.h +++ b/src/video/videosource.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef VIDEOSOURCE_H -#define VIDEOSOURCE_H +#pragma once #include @@ -71,5 +70,3 @@ private: // Used to manage a global ID for all VideoSources static AtomicIDType sourceIDs; }; - -#endif // VIDEOSOURCE_H diff --git a/src/video/videosurface.h b/src/video/videosurface.h index a2b7de0f3..524cc4c5d 100644 --- a/src/video/videosurface.h +++ b/src/video/videosurface.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SELFCAMVIEW_H -#define SELFCAMVIEW_H +#pragma once #include "src/video/videosource.h" #include @@ -71,5 +70,3 @@ private: float ratio; bool expanding; }; - -#endif // SELFCAMVIEW_H diff --git a/src/widget/about/aboutfriendform.h b/src/widget/about/aboutfriendform.h index 9dd974992..66acdf0e8 100644 --- a/src/widget/about/aboutfriendform.h +++ b/src/widget/about/aboutfriendform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ABOUT_USER_FORM_H -#define ABOUT_USER_FORM_H +#pragma once #include "src/model/about/iaboutfriend.h" @@ -55,5 +54,3 @@ private slots: void onSelectDirClicked(); void onRemoveHistoryClicked(); }; - -#endif // ABOUT_USER_FORM_H diff --git a/src/widget/categorywidget.h b/src/widget/categorywidget.h index fc9cb591a..e537b4833 100644 --- a/src/widget/categorywidget.h +++ b/src/widget/categorywidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CATEGORYWIDGET_H -#define CATEGORYWIDGET_H +#pragma once #include "genericchatitemwidget.h" #include "src/core/core.h" @@ -85,5 +84,3 @@ private: QFrame* lineFrame; bool expanded = false; }; - -#endif // CATEGORYWIDGET_H diff --git a/src/widget/chatformheader.h b/src/widget/chatformheader.h index f3865bb90..fa37f3f1a 100644 --- a/src/widget/chatformheader.h +++ b/src/widget/chatformheader.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CHAT_FORM_HEADER -#define CHAT_FORM_HEADER +#pragma once #include @@ -112,5 +111,3 @@ private: std::unique_ptr callConfirm; }; - -#endif // CHAT_FORM_HEADER diff --git a/src/widget/circlewidget.h b/src/widget/circlewidget.h index 58325580f..10f08100c 100644 --- a/src/widget/circlewidget.h +++ b/src/widget/circlewidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CIRCLEWIDGET_H -#define CIRCLEWIDGET_H +#pragma once #include "categorywidget.h" @@ -54,5 +53,3 @@ private: static QHash circleList; int id; }; - -#endif // CIRCLEWIDGET_H diff --git a/src/widget/contentdialog.h b/src/widget/contentdialog.h index 2aa516b29..a0d9836b4 100644 --- a/src/widget/contentdialog.h +++ b/src/widget/contentdialog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CONTENTDIALOG_H -#define CONTENTDIALOG_H +#pragma once #include "src/core/groupid.h" #include "src/core/toxpk.h" @@ -133,5 +132,3 @@ private: QString username; }; - -#endif // CONTENTDIALOG_H diff --git a/src/widget/contentdialogmanager.h b/src/widget/contentdialogmanager.h index 564093393..abb2ee2a8 100644 --- a/src/widget/contentdialogmanager.h +++ b/src/widget/contentdialogmanager.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef _CONTENT_DIALOG_MANAGER_H_ -#define _CONTENT_DIALOG_MANAGER_H_ +#pragma once #include "contentdialog.h" #include "src/core/contactid.h" @@ -70,5 +69,3 @@ private: static ContentDialogManager* instance; }; - -#endif // _CONTENT_DIALOG_MANAGER_H_ diff --git a/src/widget/contentlayout.h b/src/widget/contentlayout.h index ad13df154..5200dfde7 100644 --- a/src/widget/contentlayout.h +++ b/src/widget/contentlayout.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CONTENTLAYOUT_H -#define CONTENTLAYOUT_H +#pragma once #include #include @@ -41,5 +40,3 @@ public: private: void init(); }; - -#endif // CONTENTLAYOUT_H diff --git a/src/widget/emoticonswidget.h b/src/widget/emoticonswidget.h index f51617c40..b9c3307a5 100644 --- a/src/widget/emoticonswidget.h +++ b/src/widget/emoticonswidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef EMOTICONSWIDGET_H -#define EMOTICONSWIDGET_H +#pragma once #include #include @@ -57,5 +56,3 @@ private: public: QSize sizeHint() const override; }; - -#endif // EMOTICONSWIDGET_H diff --git a/src/widget/flowlayout.h b/src/widget/flowlayout.h index 9835e01ac..a2bb0067a 100644 --- a/src/widget/flowlayout.h +++ b/src/widget/flowlayout.h @@ -38,8 +38,7 @@ ** ****************************************************************************/ -#ifndef FLOWLAYOUT_H -#define FLOWLAYOUT_H +#pragma once #include #include @@ -72,5 +71,3 @@ private: int m_hSpace; int m_vSpace; }; - -#endif // FLOWLAYOUT_H diff --git a/src/widget/form/addfriendform.h b/src/widget/form/addfriendform.h index 5a1c80c3c..65282b7a2 100644 --- a/src/widget/form/addfriendform.h +++ b/src/widget/form/addfriendform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ADDFRIENDFORM_H -#define ADDFRIENDFORM_H +#pragma once #include "src/core/toxid.h" @@ -113,5 +112,3 @@ private: QList rejectButtons; QList contactsToImport; }; - -#endif // ADDFRIENDFORM_H diff --git a/src/widget/form/chatform.h b/src/widget/form/chatform.h index 84a51eaf1..045a82984 100644 --- a/src/widget/form/chatform.h +++ b/src/widget/form/chatform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CHATFORM_H -#define CHATFORM_H +#pragma once #include #include @@ -135,5 +134,3 @@ private: bool lastCallIsVideo; std::unique_ptr netcam; }; - -#endif // CHATFORM_H diff --git a/src/widget/form/filesform.h b/src/widget/form/filesform.h index 644a288d9..2322ea140 100644 --- a/src/widget/form/filesform.h +++ b/src/widget/form/filesform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef FILESFORM_H -#define FILESFORM_H +#pragma once #include #include @@ -58,5 +57,3 @@ private: QTabWidget main; QListWidget *sent, *recvd; }; - -#endif // FILESFORM_H diff --git a/src/widget/form/genericchatform.h b/src/widget/form/genericchatform.h index 71a2ac9a9..5c10038d4 100644 --- a/src/widget/form/genericchatform.h +++ b/src/widget/form/genericchatform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GENERICCHATFORM_H -#define GENERICCHATFORM_H +#pragma once #include "src/chatlog/chatmessage.h" #include "src/core/toxpk.h" @@ -194,5 +193,3 @@ protected: std::map messages; bool colorizeNames = false; }; - -#endif // GENERICCHATFORM_H diff --git a/src/widget/form/groupchatform.h b/src/widget/form/groupchatform.h index b6c4bb904..e23f8d749 100644 --- a/src/widget/form/groupchatform.h +++ b/src/widget/form/groupchatform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUPCHATFORM_H -#define GROUPCHATFORM_H +#pragma once #include "genericchatform.h" #include "src/core/toxpk.h" @@ -80,5 +79,3 @@ private: TabCompleter* tabber; bool inCall; }; - -#endif // GROUPCHATFORM_H diff --git a/src/widget/form/groupinviteform.h b/src/widget/form/groupinviteform.h index 46beca5ca..2db5b5815 100644 --- a/src/widget/form/groupinviteform.h +++ b/src/widget/form/groupinviteform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUPINVITEFORM_H -#define GROUPINVITEFORM_H +#pragma once #include "src/widget/gui.h" @@ -69,5 +68,3 @@ private: QList invites; QScrollArea* scroll; }; - -#endif // GROUPINVITEFORM_H diff --git a/src/widget/form/groupinvitewidget.h b/src/widget/form/groupinvitewidget.h index bde0a4f09..433f1fa2d 100644 --- a/src/widget/form/groupinvitewidget.h +++ b/src/widget/form/groupinvitewidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUPINVITEWIDGET_H -#define GROUPINVITEWIDGET_H +#pragma once #include "src/model/groupinvite.h" @@ -48,5 +47,3 @@ private: QHBoxLayout* widgetLayout; GroupInvite inviteInfo; }; - -#endif // GROUPINVITEWIDGET_H diff --git a/src/widget/form/loadhistorydialog.h b/src/widget/form/loadhistorydialog.h index 7fdd178b6..bb3f9dfb9 100644 --- a/src/widget/form/loadhistorydialog.h +++ b/src/widget/form/loadhistorydialog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef LOADHISTORYDIALOG_H -#define LOADHISTORYDIALOG_H +#pragma once #include "src/core/toxpk.h" #include @@ -60,5 +59,3 @@ private: Ui::LoadHistoryDialog* ui; const IChatLog* chatLog; }; - -#endif // LOADHISTORYDIALOG_H diff --git a/src/widget/form/profileform.h b/src/widget/form/profileform.h index e9e7e2ee9..ce91d9947 100644 --- a/src/widget/form/profileform.h +++ b/src/widget/form/profileform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef IDENTITYFORM_H -#define IDENTITYFORM_H +#pragma once #include "src/widget/qrwidget.h" #include @@ -94,5 +93,3 @@ private: ClickableTE* toxId; IProfileInfo* profileInfo; }; - -#endif diff --git a/src/widget/form/searchsettingsform.h b/src/widget/form/searchsettingsform.h index 1814c4e75..ab4942c84 100644 --- a/src/widget/form/searchsettingsform.h +++ b/src/widget/form/searchsettingsform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SEARCHSETTINGSFORM_H -#define SEARCHSETTINGSFORM_H +#pragma once #include #include "src/widget/searchtypes.h" @@ -56,5 +55,3 @@ private slots: signals: void updateSettings(const bool isUpdate); }; - -#endif // SEARCHSETTINGSFORM_H diff --git a/src/widget/form/setpassworddialog.h b/src/widget/form/setpassworddialog.h index 6e341748d..e5d51b325 100644 --- a/src/widget/form/setpassworddialog.h +++ b/src/widget/form/setpassworddialog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SETPASSWORDDIALOG_H -#define SETPASSWORDDIALOG_H +#pragma once #include @@ -50,5 +49,3 @@ private: QString body; static const double reasonablePasswordLength; }; - -#endif // SETPASSWORDDIALOG_H diff --git a/src/widget/form/settings/aboutform.h b/src/widget/form/settings/aboutform.h index 9a91066ca..b8ce6a7ca 100644 --- a/src/widget/form/settings/aboutform.h +++ b/src/widget/form/settings/aboutform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ABOUTFORM_H -#define ABOUTFORM_H +#pragma once #include "genericsettings.h" @@ -60,5 +59,3 @@ private: UpdateCheck* updateCheck; QMetaObject::Connection linkConnection; }; - -#endif // ABOUTFORM_H diff --git a/src/widget/form/settings/advancedform.h b/src/widget/form/settings/advancedform.h index 0518e298d..6e14a7d55 100644 --- a/src/widget/form/settings/advancedform.h +++ b/src/widget/form/settings/advancedform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ADVANCEDFORM_H -#define ADVANCEDFORM_H +#pragma once #include "genericsettings.h" @@ -60,5 +59,3 @@ private: private: Ui::AdvancedSettings* bodyUI; }; - -#endif // ADVANCEDFORM_H diff --git a/src/widget/form/settings/avform.h b/src/widget/form/settings/avform.h index 55b3649c3..46d62ff86 100644 --- a/src/widget/form/settings/avform.h +++ b/src/widget/form/settings/avform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef AVFORM_H -#define AVFORM_H +#pragma once #include #include @@ -111,5 +110,3 @@ private: uint alSource; const uint totalSliderSteps = 100; // arbitrary number of steps to give slider a good "feel" }; - -#endif diff --git a/src/widget/form/settings/generalform.h b/src/widget/form/settings/generalform.h index 9c5d0a1d8..a1f5db86a 100644 --- a/src/widget/form/settings/generalform.h +++ b/src/widget/form/settings/generalform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GENERALFORM_H -#define GENERALFORM_H +#pragma once #include "genericsettings.h" @@ -64,5 +63,3 @@ private: Ui::GeneralSettings* bodyUI; SettingsWidget* parent; }; - -#endif diff --git a/src/widget/form/settings/genericsettings.h b/src/widget/form/settings/genericsettings.h index 0fe83d3df..ca9d15163 100644 --- a/src/widget/form/settings/genericsettings.h +++ b/src/widget/form/settings/genericsettings.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GENERICFORM_H -#define GENERICFORM_H +#pragma once #include @@ -41,5 +40,3 @@ protected: protected: QPixmap formIcon; }; - -#endif diff --git a/src/widget/form/settings/privacyform.h b/src/widget/form/settings/privacyform.h index 3fcf753d8..a1d61f44c 100644 --- a/src/widget/form/settings/privacyform.h +++ b/src/widget/form/settings/privacyform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef PRIVACYFORM_H -#define PRIVACYFORM_H +#pragma once #include "genericsettings.h" @@ -58,5 +57,3 @@ private: Ui::PrivacySettings* bodyUI; Core* core; }; - -#endif diff --git a/src/widget/form/settings/userinterfaceform.h b/src/widget/form/settings/userinterfaceform.h index 03de0a9b4..4babd1242 100644 --- a/src/widget/form/settings/userinterfaceform.h +++ b/src/widget/form/settings/userinterfaceform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef USERINTERFACEFORM_H -#define USERINTERFACEFORM_H +#pragma once #include "genericsettings.h" #include "src/widget/form/settingswidget.h" @@ -76,5 +75,3 @@ private: Ui::UserInterfaceSettings* bodyUI; const int MAX_FORMAT_LENGTH = 128; }; - -#endif diff --git a/src/widget/form/settings/verticalonlyscroller.h b/src/widget/form/settings/verticalonlyscroller.h index 09f88aa41..ef1ac35a2 100644 --- a/src/widget/form/settings/verticalonlyscroller.h +++ b/src/widget/form/settings/verticalonlyscroller.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef VERTICALONLYSCROLLER_H -#define VERTICALONLYSCROLLER_H +#pragma once #include @@ -35,5 +34,3 @@ protected: void resizeEvent(QResizeEvent* event) final; void showEvent(QShowEvent* event) final; }; - -#endif // VERTICALONLYSCROLLER_H diff --git a/src/widget/form/settingswidget.h b/src/widget/form/settingswidget.h index 4663c2edb..511b5f250 100644 --- a/src/widget/form/settingswidget.h +++ b/src/widget/form/settingswidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SETTINGSWIDGET_H -#define SETTINGSWIDGET_H +#pragma once #include #include @@ -68,5 +67,3 @@ private: std::array, 6> cfgForms; int currentIndex; }; - -#endif // SETTINGSWIDGET_H diff --git a/src/widget/form/tabcompleter.h b/src/widget/form/tabcompleter.h index c7303785c..89f3bee4a 100644 --- a/src/widget/form/tabcompleter.h +++ b/src/widget/form/tabcompleter.h @@ -20,8 +20,7 @@ along with qTox. If not, see . */ -#ifndef TABCOMPLETER_H -#define TABCOMPLETER_H +#pragma once #include "src/model/group.h" #include "src/widget/tool/chattextedit.h" @@ -60,6 +59,3 @@ private: void buildCompletionList(); }; - - -#endif diff --git a/src/widget/friendlistlayout.h b/src/widget/friendlistlayout.h index 88a99ed99..e925c08df 100644 --- a/src/widget/friendlistlayout.h +++ b/src/widget/friendlistlayout.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef FRIENDLISTLAYOUT_H -#define FRIENDLISTLAYOUT_H +#pragma once #include "genericchatitemlayout.h" #include "src/model/status.h" @@ -56,5 +55,3 @@ private: GenericChatItemLayout friendOnlineLayout; GenericChatItemLayout friendOfflineLayout; }; - -#endif // FRIENDLISTLAYOUT_H diff --git a/src/widget/friendlistwidget.h b/src/widget/friendlistwidget.h index cb6f66777..b7d313920 100644 --- a/src/widget/friendlistwidget.h +++ b/src/widget/friendlistwidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef FRIENDLISTWIDGET_H -#define FRIENDLISTWIDGET_H +#pragma once #include "genericchatitemlayout.h" #include "src/core/core.h" @@ -97,5 +96,3 @@ private: QVBoxLayout* activityLayout = nullptr; QTimer* dayTimer; }; - -#endif // FRIENDLISTWIDGET_H diff --git a/src/widget/friendwidget.h b/src/widget/friendwidget.h index 1e68f19a3..962c95565 100644 --- a/src/widget/friendwidget.h +++ b/src/widget/friendwidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef FRIENDWIDGET_H -#define FRIENDWIDGET_H +#pragma once #include "genericchatroomwidget.h" #include "src/core/toxpk.h" @@ -80,5 +79,3 @@ public: std::shared_ptr chatroom; bool isDefaultAvatar; }; - -#endif // FRIENDWIDGET_H diff --git a/src/widget/genericchatitemlayout.h b/src/widget/genericchatitemlayout.h index 6d4bce7a3..7f62d06d3 100644 --- a/src/widget/genericchatitemlayout.h +++ b/src/widget/genericchatitemlayout.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GENERICCHATITEMLAYOUT_H -#define GENERICCHATITEMLAYOUT_H +#pragma once #include @@ -49,5 +48,3 @@ private: int indexOfClosestSortedWidget(GenericChatItemWidget* widget) const; QVBoxLayout* layout; }; - -#endif // GENERICCHATITEMLAYOUT_H diff --git a/src/widget/genericchatitemwidget.h b/src/widget/genericchatitemwidget.h index 1159b3b3d..b5ec91709 100644 --- a/src/widget/genericchatitemwidget.h +++ b/src/widget/genericchatitemwidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GENERICCHATITEMWIDGET_H -#define GENERICCHATITEMWIDGET_H +#pragma once #include #include @@ -54,5 +53,3 @@ protected: private: bool compact; }; - -#endif // GENERICCHATITEMWIDGET_H diff --git a/src/widget/genericchatroomwidget.h b/src/widget/genericchatroomwidget.h index b506ad4ff..81924b260 100644 --- a/src/widget/genericchatroomwidget.h +++ b/src/widget/genericchatroomwidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GENERICCHATROOMWIDGET_H -#define GENERICCHATROOMWIDGET_H +#pragma once #include "genericchatitemwidget.h" @@ -86,5 +85,3 @@ protected: CroppingLabel* statusMessageLabel; bool active; }; - -#endif // GENERICCHATROOMWIDGET_H diff --git a/src/widget/groupwidget.h b/src/widget/groupwidget.h index 692461193..fce990e84 100644 --- a/src/widget/groupwidget.h +++ b/src/widget/groupwidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef GROUPWIDGET_H -#define GROUPWIDGET_H +#pragma once #include "genericchatroomwidget.h" @@ -66,5 +65,3 @@ public: private: std::shared_ptr chatroom; }; - -#endif // GROUPWIDGET_H diff --git a/src/widget/gui.h b/src/widget/gui.h index e8f0efebd..929016e6e 100644 --- a/src/widget/gui.h +++ b/src/widget/gui.h @@ -18,8 +18,7 @@ */ -#ifndef GUI_H -#define GUI_H +#pragma once #include @@ -60,5 +59,3 @@ private slots: bool _askQuestion(const QString& title, const QString& msg, const QString& button1, const QString& button2, bool defaultAns = false, bool warning = true); }; - -#endif // GUI_H diff --git a/src/widget/loginscreen.h b/src/widget/loginscreen.h index 29637f3cd..e0063d42d 100644 --- a/src/widget/loginscreen.h +++ b/src/widget/loginscreen.h @@ -18,8 +18,7 @@ */ -#ifndef LOGINSCREEN_H -#define LOGINSCREEN_H +#pragma once #include #include @@ -75,5 +74,3 @@ private: Ui::LoginScreen* ui; QShortcut quitShortcut; }; - -#endif // LOGINSCREEN_H diff --git a/src/widget/maskablepixmapwidget.h b/src/widget/maskablepixmapwidget.h index 929870d2d..7b0194b96 100644 --- a/src/widget/maskablepixmapwidget.h +++ b/src/widget/maskablepixmapwidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef MASKABLEPIXMAPWIDGET_H -#define MASKABLEPIXMAPWIDGET_H +#pragma once #include @@ -49,5 +48,3 @@ private: QString maskName; bool clickable; }; - -#endif // MASKABLEPIXMAPWIDGET_H diff --git a/src/widget/notificationedgewidget.h b/src/widget/notificationedgewidget.h index 8ad4fc463..149d0633c 100644 --- a/src/widget/notificationedgewidget.h +++ b/src/widget/notificationedgewidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef NOTIFICATIONEDGEWIDGET_H -#define NOTIFICATIONEDGEWIDGET_H +#pragma once #include @@ -46,5 +45,3 @@ protected: private: QLabel* textLabel; }; - -#endif // NOTIFICATIONEDGEWIDGET_H diff --git a/src/widget/notificationscrollarea.h b/src/widget/notificationscrollarea.h index 79724a90a..c6cd76dd1 100644 --- a/src/widget/notificationscrollarea.h +++ b/src/widget/notificationscrollarea.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef NOTIFICATIONSCROLLAREA_H -#define NOTIFICATIONSCROLLAREA_H +#pragma once #include "tool/adjustingscrollarea.h" #include @@ -60,5 +59,3 @@ private: size_t referencesAbove = 0; size_t referencesBelow = 0; }; - -#endif // NOTIFICATIONSCROLLAREA_H diff --git a/src/widget/passwordedit.h b/src/widget/passwordedit.h index 48b2d496d..33e265127 100644 --- a/src/widget/passwordedit.h +++ b/src/widget/passwordedit.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef PASSWORDEDIT_H -#define PASSWORDEDIT_H +#pragma once #include #include @@ -54,4 +53,3 @@ private: static EventHandler* eventHandler; }; -#endif // PASSWORDEDIT_H diff --git a/src/widget/qrwidget.h b/src/widget/qrwidget.h index 9ab6c6c3d..2b5026e80 100644 --- a/src/widget/qrwidget.h +++ b/src/widget/qrwidget.h @@ -18,8 +18,7 @@ */ -#ifndef QRWIDGET_H -#define QRWIDGET_H +#pragma once #include @@ -40,5 +39,3 @@ private: QImage* image; QSize size; }; - -#endif // QRWIDGET_H diff --git a/src/widget/searchform.h b/src/widget/searchform.h index b8b9de88e..cd13bea09 100644 --- a/src/widget/searchform.h +++ b/src/widget/searchform.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SEARCHFORM_H -#define SEARCHFORM_H +#pragma once #include #include @@ -108,5 +107,3 @@ signals: void clickShiftEnter(); void clickEsc(); }; - -#endif // SEARCHFORM_H diff --git a/src/widget/searchtypes.h b/src/widget/searchtypes.h index 7130887b6..c4f554a62 100644 --- a/src/widget/searchtypes.h +++ b/src/widget/searchtypes.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SEARCHTYPES_H -#define SEARCHTYPES_H +#pragma once #include #include @@ -93,5 +92,3 @@ public: return filter; } }; - -#endif //SEARCHTYPES_H diff --git a/src/widget/splitterrestorer.h b/src/widget/splitterrestorer.h index 89048ef32..b74cf0a9c 100644 --- a/src/widget/splitterrestorer.h +++ b/src/widget/splitterrestorer.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SPLITTERRESTORER_H -#define SPLITTERRESTORER_H +#pragma once class QSize; class QSplitter; @@ -33,5 +32,3 @@ public: private: QSplitter* splitter; }; - -#endif // SPLITTERRESTORER_H diff --git a/src/widget/style.h b/src/widget/style.h index 6e06f6727..5a2974f01 100644 --- a/src/widget/style.h +++ b/src/widget/style.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef STYLE_H -#define STYLE_H +#pragma once #include #include @@ -97,5 +96,3 @@ signals: private: Style(); }; - -#endif // STYLE_H diff --git a/src/widget/tool/activatedialog.h b/src/widget/tool/activatedialog.h index 422b68ace..7aacc9355 100644 --- a/src/widget/tool/activatedialog.h +++ b/src/widget/tool/activatedialog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ACTIVATEDIALOG_H -#define ACTIVATEDIALOG_H +#pragma once #include @@ -36,5 +35,3 @@ public: signals: void windowStateChanged(Qt::WindowStates state); }; - -#endif // ACTIVATEDIALOG_H diff --git a/src/widget/tool/adjustingscrollarea.h b/src/widget/tool/adjustingscrollarea.h index 45d859435..e0b7dfe7e 100644 --- a/src/widget/tool/adjustingscrollarea.h +++ b/src/widget/tool/adjustingscrollarea.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef ADJUSTINGSCROLLAREA_H -#define ADJUSTINGSCROLLAREA_H +#pragma once #include @@ -33,5 +32,3 @@ protected: void resizeEvent(QResizeEvent* ev) override; QSize sizeHint() const final; }; - -#endif // ADJUSTINGSCROLLAREA_H diff --git a/src/widget/tool/callconfirmwidget.h b/src/widget/tool/callconfirmwidget.h index ab336f4de..89ae53071 100644 --- a/src/widget/tool/callconfirmwidget.h +++ b/src/widget/tool/callconfirmwidget.h @@ -18,8 +18,7 @@ */ -#ifndef CALLCONFIRMWIDGET_H -#define CALLCONFIRMWIDGET_H +#pragma once #include #include @@ -60,5 +59,3 @@ private: const int roundedFactor; const qreal rectRatio; }; - -#endif // CALLCONFIRMWIDGET_H diff --git a/src/widget/tool/chattextedit.h b/src/widget/tool/chattextedit.h index 0577dcae9..7b3a8ccf9 100644 --- a/src/widget/tool/chattextedit.h +++ b/src/widget/tool/chattextedit.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CHATTEXTEDIT_H -#define CHATTEXTEDIT_H +#pragma once #include @@ -47,5 +46,3 @@ private: private: QString lastMessage; }; - -#endif // CHATTEXTEDIT_H diff --git a/src/widget/tool/croppinglabel.h b/src/widget/tool/croppinglabel.h index de18472a8..4fb244466 100644 --- a/src/widget/tool/croppinglabel.h +++ b/src/widget/tool/croppinglabel.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef CROPPINGLABEL_H -#define CROPPINGLABEL_H +#pragma once #include @@ -67,5 +66,3 @@ private: bool editable; Qt::TextElideMode elideMode; }; - -#endif // CROPPINGLABEL_H diff --git a/src/widget/tool/flyoutoverlaywidget.h b/src/widget/tool/flyoutoverlaywidget.h index a103ac228..d3debd626 100644 --- a/src/widget/tool/flyoutoverlaywidget.h +++ b/src/widget/tool/flyoutoverlaywidget.h @@ -18,8 +18,7 @@ along with qTox. If not, see . */ -#ifndef FLYOUTOVERLAYWIDGET_HPP -#define FLYOUTOVERLAYWIDGET_HPP +#pragma once #include @@ -59,5 +58,3 @@ private: qreal percent = 1.0f; QPoint startPos; }; - -#endif // FLYOUTOVERLAYWIDGET_HPP diff --git a/src/widget/tool/friendrequestdialog.h b/src/widget/tool/friendrequestdialog.h index 82046bb2e..a79ea5b12 100644 --- a/src/widget/tool/friendrequestdialog.h +++ b/src/widget/tool/friendrequestdialog.h @@ -18,8 +18,7 @@ along with qTox. If not, see . */ -#ifndef FRIENDREQUESTDIALOG_HPP -#define FRIENDREQUESTDIALOG_HPP +#pragma once #include @@ -29,5 +28,3 @@ class FriendRequestDialog : public QDialog public: explicit FriendRequestDialog(QWidget* parent, const QString& userId, const QString& message); }; - -#endif // FRIENDREQUESTDIALOG_HPP diff --git a/src/widget/tool/identicon.h b/src/widget/tool/identicon.h index 8d50e90b4..a75a53b94 100644 --- a/src/widget/tool/identicon.h +++ b/src/widget/tool/identicon.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef IDENTICON_H -#define IDENTICON_H +#pragma once #include #include @@ -45,5 +44,3 @@ private: uint8_t identiconColors[IDENTICON_ROWS][ACTIVE_COLS]; QColor colors[COLORS]; }; - -#endif // IDENTICON_H diff --git a/src/widget/tool/movablewidget.h b/src/widget/tool/movablewidget.h index 5c6acab7c..edd46fba2 100644 --- a/src/widget/tool/movablewidget.h +++ b/src/widget/tool/movablewidget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef MOVABLEWIDGET_H -#define MOVABLEWIDGET_H +#pragma once #include @@ -60,5 +59,3 @@ private: QPointF actualPos; float ratio; }; - -#endif // MOVABLEWIDGET_H diff --git a/src/widget/tool/profileimporter.h b/src/widget/tool/profileimporter.h index 1899a7a35..34cfbf31a 100644 --- a/src/widget/tool/profileimporter.h +++ b/src/widget/tool/profileimporter.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef PROFILEIMPORTER_H -#define PROFILEIMPORTER_H +#pragma once #include @@ -34,5 +33,3 @@ public: private: bool askQuestion(QString title, QString message); }; - -#endif // PROFILEIMPORTER_H diff --git a/src/widget/tool/recursivesignalblocker.h b/src/widget/tool/recursivesignalblocker.h index 3c6e0b3d8..1481a2217 100644 --- a/src/widget/tool/recursivesignalblocker.h +++ b/src/widget/tool/recursivesignalblocker.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef QTOX_RECURSIVESIGNALBLOCKER_H -#define QTOX_RECURSIVESIGNALBLOCKER_H +#pragma once #include @@ -36,5 +35,3 @@ public: private: QVector mBlockers; }; - -#endif diff --git a/src/widget/tool/removefrienddialog.h b/src/widget/tool/removefrienddialog.h index cea7df7af..bfb9a8eba 100644 --- a/src/widget/tool/removefrienddialog.h +++ b/src/widget/tool/removefrienddialog.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef DELETEFRIENDDIALOG_H -#define DELETEFRIENDDIALOG_H +#pragma once #include "ui_removefrienddialog.h" @@ -49,5 +48,3 @@ protected: Ui_RemoveFriendDialog ui; bool _accepted = false; }; - -#endif // DELETEFRIENDDIALOG_H diff --git a/src/widget/tool/screengrabberchooserrectitem.h b/src/widget/tool/screengrabberchooserrectitem.h index 6c15718f9..04fb58d49 100644 --- a/src/widget/tool/screengrabberchooserrectitem.h +++ b/src/widget/tool/screengrabberchooserrectitem.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SCREENGRABBERCHOOSERRECTITEM_HPP -#define SCREENGRABBERCHOOSERRECTITEM_HPP +#pragma once #include @@ -86,6 +85,3 @@ private: QGraphicsRectItem* bottomLeft; QGraphicsRectItem* leftCenter; }; - - -#endif // SCREENGRABBERCHOOSERRECTITEM_HPP diff --git a/src/widget/tool/screengrabberoverlayitem.h b/src/widget/tool/screengrabberoverlayitem.h index ff7f9e5f0..36465f22c 100644 --- a/src/widget/tool/screengrabberoverlayitem.h +++ b/src/widget/tool/screengrabberoverlayitem.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SCREENGRABBEROVERLAYITEM_HPP -#define SCREENGRABBEROVERLAYITEM_HPP +#pragma once #include @@ -43,5 +42,3 @@ private: QRect chosenRect; }; - -#endif // SCREENGRABBEROVERLAYITEM_HPP diff --git a/src/widget/tool/screenshotgrabber.h b/src/widget/tool/screenshotgrabber.h index 93033ff6e..3d77e2bc6 100644 --- a/src/widget/tool/screenshotgrabber.h +++ b/src/widget/tool/screenshotgrabber.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef SCREENSHOTGRABBER_H -#define SCREENSHOTGRABBER_H +#pragma once #include #include @@ -90,6 +89,3 @@ private: bool mQToxVisible; QVector> mHiddenWindows; }; - - -#endif // SCREENSHOTGRABBER_H diff --git a/src/widget/tool/toolboxgraphicsitem.h b/src/widget/tool/toolboxgraphicsitem.h index 4b9587a11..eff6992f3 100644 --- a/src/widget/tool/toolboxgraphicsitem.h +++ b/src/widget/tool/toolboxgraphicsitem.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef TOOLBOXGRAPHICSITEM_HPP -#define TOOLBOXGRAPHICSITEM_HPP +#pragma once #include #include @@ -47,5 +46,3 @@ private: qreal activeOpacity = 1.0f; int fadeTimeMs = 300; }; - -#endif // TOOLBOXGRAPHICSITEM_HPP diff --git a/src/widget/translator.h b/src/widget/translator.h index eac64546b..a23e15e50 100644 --- a/src/widget/translator.h +++ b/src/widget/translator.h @@ -18,8 +18,7 @@ */ -#ifndef TRANSLATOR_H -#define TRANSLATOR_H +#pragma once #include #include @@ -41,5 +40,3 @@ private: static QMutex lock; static QTranslator* translator; }; - -#endif // TRANSLATOR_H diff --git a/src/widget/widget.h b/src/widget/widget.h index 593671a78..2c8bb4ed9 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -17,8 +17,7 @@ along with qTox. If not, see . */ -#ifndef WIDGET_H -#define WIDGET_H +#pragma once #include "ui_mainwindow.h" @@ -378,5 +377,3 @@ private: }; bool toxActivateEventHandler(const QByteArray& data); - -#endif // WIDGET_H