Use #pragma once instead of include guards

This commit is contained in:
FranciscoPombal
2020-12-10 17:56:37 +00:00
committed by sledgehammer999
parent 0b42425db5
commit fdc64d9b38
122 changed files with 122 additions and 488 deletions

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef BANDWIDTHSCHEDULER_H
#define BANDWIDTHSCHEDULER_H
#pragma once
#include <QObject>
#include <QTimer>
@@ -52,5 +51,3 @@ private:
QTimer m_timer;
bool m_lastAlternative;
};
#endif // BANDWIDTHSCHEDULER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_CACHESTATUS_H
#define BITTORRENT_CACHESTATUS_H
#pragma once
#include <QtGlobal>
@@ -42,5 +41,3 @@ namespace BitTorrent
qreal readRatio = 0.0;
};
}
#endif // BITTORRENT_CACHESTATUS_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef FILTERPARSERTHREAD_H
#define FILTERPARSERTHREAD_H
#pragma once
#include <libtorrent/ip_filter.hpp>
@@ -64,5 +63,3 @@ private:
QString m_filePath;
lt::ip_filter m_filter;
};
#endif // BITTORRENT_FILTERPARSERTHREAD_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_MAGNETURI_H
#define BITTORRENT_MAGNETURI_H
#pragma once
#include <libtorrent/add_torrent_params.hpp>
@@ -65,5 +64,3 @@ namespace BitTorrent
lt::add_torrent_params m_addTorrentParams;
};
}
#endif // BITTORRENT_MAGNETURI_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_PEERINFO_H
#define BITTORRENT_PEERINFO_H
#pragma once
#include <libtorrent/peer_info.hpp>
@@ -104,5 +103,3 @@ namespace BitTorrent
mutable QString m_country;
};
}
#endif // BITTORRENT_PEERINFO_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_SESSION_H
#define BITTORRENT_SESSION_H
#pragma once
#include <memory>
#include <vector>
@@ -801,5 +800,3 @@ namespace BitTorrent
Q_DECLARE_METATYPE(std::shared_ptr<lt::entry>)
const int sharedPtrLtEntryTypeID = qRegisterMetaType<std::shared_ptr<lt::entry>>();
#endif
#endif // BITTORRENT_SESSION_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_SESSIONSTATUS_H
#define BITTORRENT_SESSIONSTATUS_H
#pragma once
#include <QtGlobal>
@@ -74,5 +73,3 @@ namespace BitTorrent
quint64 peersCount = 0;
};
}
#endif // BITTORRENT_SESSIONSTATUS_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef SPEEDMONITOR_H
#define SPEEDMONITOR_H
#pragma once
#ifndef Q_MOC_RUN
#include <boost/circular_buffer.hpp>
@@ -86,5 +85,3 @@ private:
boost::circular_buffer<SpeedSample> m_speedSamples;
SpeedSample m_sum;
};
#endif // SPEEDMONITOR_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef STATISTICS_H
#define STATISTICS_H
#pragma once
#include <QObject>
#include <QTimer>
@@ -67,5 +66,3 @@ private:
QTimer m_timer;
};
#endif // STATISTICS_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_TORRENTCREATORTHREAD_H
#define BITTORRENT_TORRENTCREATORTHREAD_H
#pragma once
#include <libtorrent/version.hpp>
@@ -94,5 +93,3 @@ namespace BitTorrent
TorrentCreatorParams m_params;
};
}
#endif // BITTORRENT_TORRENTCREATORTHREAD_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_TORRENTINFO_H
#define BITTORRENT_TORRENTINFO_H
#pragma once
#include <libtorrent/torrent_info.hpp>
@@ -105,5 +104,3 @@ namespace BitTorrent
std::shared_ptr<lt::torrent_info> m_nativeInfo;
};
}
#endif // BITTORRENT_TORRENTINFO_H

View File

@@ -28,8 +28,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_TRACKER_H
#define BITTORRENT_TRACKER_H
#pragma once
#include <string>
@@ -106,5 +105,3 @@ namespace BitTorrent
QHash<InfoHash, TorrentStats> m_torrents;
};
}
#endif // BITTORRENT_TRACKER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BITTORRENT_TRACKERENTRY_H
#define BITTORRENT_TRACKERENTRY_H
#pragma once
#include <libtorrent/announce_entry.hpp>
@@ -73,5 +72,3 @@ namespace BitTorrent
bool operator==(const TrackerEntry &left, const TrackerEntry &right);
uint qHash(const TrackerEntry &key, uint seed);
}
#endif // BITTORRENT_TRACKERENTRY_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef FILESYSTEMWATCHER_H
#define FILESYSTEMWATCHER_H
#pragma once
#include <QDir>
#include <QFileSystemWatcher>
@@ -69,5 +68,3 @@ private:
QVector<QDir> m_watchedFolders;
QTimer m_watchTimer;
};
#endif // FILESYSTEMWATCHER_H

View File

@@ -28,8 +28,7 @@
*/
#ifndef HTTP_CONNECTION_H
#define HTTP_CONNECTION_H
#pragma once
#include <QElapsedTimer>
#include <QObject>
@@ -66,5 +65,3 @@ namespace Http
QElapsedTimer m_idleTimer;
};
}
#endif // HTTP_CONNECTION_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef HTTP_IREQUESTHANDLER_H
#define HTTP_IREQUESTHANDLER_H
#pragma once
namespace Http
{
@@ -42,5 +41,3 @@ namespace Http
virtual Response processRequest(const Request &request, const Environment &env) = 0;
};
}
#endif // HTTP_IREQUESTHANDLER_H

View File

@@ -28,8 +28,7 @@
* exception statement from your version.
*/
#ifndef HTTP_REQUESTPARSER_H
#define HTTP_REQUESTPARSER_H
#pragma once
#include "types.h"
@@ -70,5 +69,3 @@ namespace Http
Request m_request;
};
}
#endif // HTTP_REQUESTPARSER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef HTTP_RESPONSEBUILDER_H
#define HTTP_RESPONSEBUILDER_H
#pragma once
#include "types.h"
@@ -50,5 +49,3 @@ namespace Http
Response m_response;
};
}
#endif // HTTP_RESPONSEBUILDER_H

View File

@@ -28,8 +28,7 @@
*/
#ifndef HTTP_RESPONSEGENERATOR_H
#define HTTP_RESPONSEGENERATOR_H
#pragma once
class QByteArray;
class QString;
@@ -42,5 +41,3 @@ namespace Http
QString httpDate();
void compressContent(Response &response);
}
#endif // HTTP_RESPONSEGENERATOR_H

View File

@@ -28,8 +28,7 @@
*/
#ifndef HTTP_SERVER_H
#define HTTP_SERVER_H
#pragma once
#include <QSet>
#include <QSslCertificate>
@@ -67,5 +66,3 @@ namespace Http
QSslKey m_key;
};
}
#endif // HTTP_SERVER_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef HTTP_TYPES_H
#define HTTP_TYPES_H
#pragma once
#include <QHostAddress>
#include <QString>
@@ -127,5 +126,3 @@ namespace Http
}
};
}
#endif // HTTP_TYPES_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef ICONPROVIDER_H
#define ICONPROVIDER_H
#pragma once
#include <QObject>
@@ -51,5 +50,3 @@ protected:
static IconProvider *m_instance;
};
#endif // ICONPROVIDER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef QBT_INDEXRANGE_H
#define QBT_INDEXRANGE_H
#pragma once
#include <QtGlobal>
@@ -169,5 +168,3 @@ private:
IndexType m_first;
IndexDiffType m_size;
};
#endif // QBT_INDEXRANGE_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef LOGGER_H
#define LOGGER_H
#pragma once
#include <boost/circular_buffer.hpp>
@@ -103,5 +102,3 @@ private:
// Helper function
void LogMsg(const QString &message, const Log::MsgType &type = Log::NORMAL);
#endif // LOGGER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef DNSUPDATER_H
#define DNSUPDATER_H
#pragma once
#include <QDateTime>
#include <QHostAddress>
@@ -84,5 +83,3 @@ namespace Net
QString m_password;
};
}
#endif // DNSUPDATER_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef NET_DOWNLOADMANAGER_H
#define NET_DOWNLOADMANAGER_H
#pragma once
#include <QHash>
#include <QNetworkAccessManager>
@@ -159,5 +158,3 @@ namespace Net
connect(handler, &DownloadHandler::finished, context, slot);
}
}
#endif // NET_DOWNLOADMANAGER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef GEOIPDATABASE_H
#define GEOIPDATABASE_H
#pragma once
#include <QCoreApplication>
#include <QtGlobal>
@@ -100,5 +99,3 @@ private:
quint32 m_size;
uchar *m_data;
};
#endif // GEOIPDATABASE_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef NET_GEOIPMANAGER_H
#define NET_GEOIPMANAGER_H
#pragma once
#include <QObject>
@@ -73,5 +72,3 @@ namespace Net
static GeoIPManager *m_instance;
};
}
#endif // NET_GEOIPMANAGER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef NET_PORTFORWARDER_H
#define NET_PORTFORWARDER_H
#pragma once
#include <QObject>
@@ -53,5 +52,3 @@ namespace Net
static PortForwarder *m_instance;
};
}
#endif // NET_PORTFORWARDER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef NET_PROXYCONFIGURATIONMANAGER_H
#define NET_PROXYCONFIGURATIONMANAGER_H
#pragma once
#include <QObject>
@@ -85,5 +84,3 @@ namespace Net
bool m_isProxyOnlyForTorrents;
};
}
#endif // NET_PROXYCONFIGURATIONMANAGER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef NET_REVERSERESOLUTION_H
#define NET_REVERSERESOLUTION_H
#pragma once
#include <QCache>
#include <QObject>
@@ -60,5 +59,3 @@ namespace Net
QCache<QHostAddress, QString> m_cache; // <IP, HostName>
};
}
#endif // NET_REVERSERESOLUTION_H

View File

@@ -30,8 +30,7 @@
* This code is based on QxtSmtp from libqxt (http://libqxt.org)
*/
#ifndef SMTP_H
#define SMTP_H
#pragma once
#include <QAbstractSocket>
#include <QByteArray>
@@ -119,5 +118,3 @@ namespace Net
QString m_password;
};
}
#endif // SMTP_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef PREFERENCES_H
#define PREFERENCES_H
#pragma once
#include <QtContainerFwd>
#include <QVariant>
@@ -403,5 +402,3 @@ public slots:
void apply();
};
#endif // PREFERENCES_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef QBT_PROFILE_H
#define QBT_PROFILE_H
#pragma once
#include <memory>
@@ -82,5 +81,3 @@ private:
};
QString specialFolderLocation(SpecialFolder folder);
#endif // QBT_PROFILE_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef QBT_PROFILE_P_H
#define QBT_PROFILE_P_H
#pragma once
#include <QDir>
#include <QStandardPaths>
@@ -132,5 +131,3 @@ namespace Private
QDir m_baseDir;
};
}
#endif // QBT_PROFILE_P_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef SCANFOLDERSMODEL_H
#define SCANFOLDERSMODEL_H
#pragma once
#include <QAbstractListModel>
#include <QList>
@@ -110,5 +109,3 @@ private:
QList<PathData*> m_pathList;
FileSystemWatcher *m_fsWatcher;
};
#endif // SCANFOLDERSMODEL_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef SETTINGSSTORAGE_H
#define SETTINGSSTORAGE_H
#pragma once
#include <QObject>
#include <QReadWriteLock>
@@ -61,5 +60,3 @@ private:
QTimer m_timer;
mutable QReadWriteLock m_lock;
};
#endif // SETTINGSSTORAGE_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef SETTINGVALUE_H
#define SETTINGVALUE_H
#pragma once
#include <type_traits>
@@ -114,5 +113,3 @@ private:
const QString m_keyName;
T m_value;
};
#endif // SETTINGVALUE_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef TORRENTFILTER_H
#define TORRENTFILTER_H
#pragma once
#include <QSet>
#include <QString>
@@ -102,5 +101,3 @@ private:
QString m_tag;
InfoHashSet m_hashSet;
};
#endif // TORRENTFILTER_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef TRISTATEBOOL_H
#define TRISTATEBOOL_H
#pragma once
class TriStateBool
{
@@ -68,5 +67,3 @@ constexpr bool operator!=(const TriStateBool &left, const TriStateBool &right)
{
return !(left == right);
}
#endif // TRISTATEBOOL_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef TYPES_H
#define TYPES_H
#pragma once
#include <QtContainerFwd>
@@ -42,5 +41,3 @@ enum class ShutdownDialogAction
};
typedef QMap<QString, QString> QStringMap;
#endif // TYPES_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef UTILS_FS_H
#define UTILS_FS_H
#pragma once
/**
* Utility functions related to file system.
@@ -79,5 +78,3 @@ namespace Utils
#endif
}
}
#endif // UTILS_FS_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef UTILS_GZIP_H
#define UTILS_GZIP_H
#pragma once
class QByteArray;
@@ -40,5 +39,3 @@ namespace Utils
QByteArray decompress(const QByteArray &data, bool *ok = nullptr);
}
}
#endif // UTILS_GZIP_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef UTILS_MISC_H
#define UTILS_MISC_H
#pragma once
#include <QtGlobal>
@@ -108,5 +107,3 @@ namespace Utils
#endif // Q_OS_WIN
}
}
#endif // UTILS_MISC_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef BASE_UTILS_NET_H
#define BASE_UTILS_NET_H
#pragma once
#include <QHostAddress>
#include <QtContainerFwd>
@@ -57,5 +56,3 @@ namespace Utils
bool isSSLKeyValid(const QByteArray &data);
}
}
#endif // BASE_UTILS_NET_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef UTILS_RANDOM_H
#define UTILS_RANDOM_H
#pragma once
#include <cstdint>
#include <limits>
@@ -39,5 +38,3 @@ namespace Utils
uint32_t rand(uint32_t min = 0, uint32_t max = std::numeric_limits<uint32_t>::max());
}
}
#endif // UTILS_FS_H

View File

@@ -27,8 +27,7 @@
* exception statement from your version.
*/
#ifndef UTILS_STRING_H
#define UTILS_STRING_H
#pragma once
#include <QChar>
#include <QString>
@@ -74,5 +73,3 @@ namespace Utils
QString join(const QVector<QStringRef> &strings, const QString &separator);
}
}
#endif // UTILS_STRING_H

View File

@@ -26,8 +26,7 @@
* exception statement from your version.
*/
#ifndef QBITTORRENT_UTILS_VERSION_H
#define QBITTORRENT_UTILS_VERSION_H
#pragma once
#include <array>
#include <stdexcept>
@@ -212,5 +211,3 @@ namespace Utils
return !(left < right);
}
}
#endif // QBITTORRENT_UTILS_VERSION_H