Browse Source

Add final specifier to classes

This allow compilers to generate more efficient code.
adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
d3d3f7dbb3
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/app/application.h
  2. 2
      src/app/qtlocalpeer/qtlockedfile.h
  3. 2
      src/base/bittorrent/private/filterparserthread.h
  4. 2
      src/base/bittorrent/private/nativesessionextension.h
  5. 2
      src/base/bittorrent/private/nativetorrentextension.h
  6. 2
      src/base/bittorrent/private/portforwarderimpl.h
  7. 2
      src/base/bittorrent/torrentcreatorthread.h
  8. 2
      src/base/bittorrent/tracker.h
  9. 2
      src/base/http/server.h
  10. 2
      src/base/net/downloadmanager.cpp
  11. 2
      src/base/net/private/downloadhandlerimpl.h
  12. 8
      src/base/private/profile_p.h
  13. 2
      src/base/rss/private/rss_parser.cpp
  14. 2
      src/base/scanfoldersmodel.h
  15. 4
      src/webui/webapplication.h

2
src/app/application.h

@ -68,7 +68,7 @@ namespace RSS
class AutoDownloader; class AutoDownloader;
} }
class Application : public BaseApplication class Application final : public BaseApplication
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(Application) Q_DISABLE_COPY(Application)

2
src/app/qtlocalpeer/qtlockedfile.h

@ -77,7 +77,7 @@
namespace QtLP_Private namespace QtLP_Private
{ {
class QtLockedFile : public QFile class QtLockedFile final : public QFile
{ {
public: public:
enum LockMode enum LockMode

2
src/base/bittorrent/private/filterparserthread.h

@ -35,7 +35,7 @@
class QDataStream; class QDataStream;
class FilterParserThread : public QThread class FilterParserThread final : public QThread
{ {
Q_OBJECT Q_OBJECT

2
src/base/bittorrent/private/nativesessionextension.h

@ -31,7 +31,7 @@
#include <libtorrent/extensions.hpp> #include <libtorrent/extensions.hpp>
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
class NativeSessionExtension : public lt::plugin class NativeSessionExtension final : public lt::plugin
{ {
#if (LIBTORRENT_VERSION_NUM >= 10200) #if (LIBTORRENT_VERSION_NUM >= 10200)
lt::feature_flags_t implemented_features() override; lt::feature_flags_t implemented_features() override;

2
src/base/bittorrent/private/nativetorrentextension.h

@ -32,7 +32,7 @@
#include <libtorrent/torrent_handle.hpp> #include <libtorrent/torrent_handle.hpp>
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
class NativeTorrentExtension : public lt::torrent_plugin class NativeTorrentExtension final : public lt::torrent_plugin
{ {
public: public:
explicit NativeTorrentExtension(const lt::torrent_handle &torrentHandle); explicit NativeTorrentExtension(const lt::torrent_handle &torrentHandle);

2
src/base/bittorrent/private/portforwarderimpl.h

@ -44,7 +44,7 @@ using LTPortMapping = int;
using LTPortMapping = lt::port_mapping_t; using LTPortMapping = lt::port_mapping_t;
#endif #endif
class PortForwarderImpl : public Net::PortForwarder class PortForwarderImpl final : public Net::PortForwarder
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(PortForwarderImpl) Q_DISABLE_COPY(PortForwarderImpl)

2
src/base/bittorrent/torrentcreatorthread.h

@ -48,7 +48,7 @@ namespace BitTorrent
QStringList urlSeeds; QStringList urlSeeds;
}; };
class TorrentCreatorThread : public QThread class TorrentCreatorThread final : public QThread
{ {
Q_OBJECT Q_OBJECT

2
src/base/bittorrent/tracker.h

@ -70,7 +70,7 @@ namespace BitTorrent
// *Basic* Bittorrent tracker implementation // *Basic* Bittorrent tracker implementation
// [BEP-3] The BitTorrent Protocol Specification // [BEP-3] The BitTorrent Protocol Specification
// also see: https://wiki.theory.org/index.php/BitTorrentSpecification#Tracker_HTTP.2FHTTPS_Protocol // also see: https://wiki.theory.org/index.php/BitTorrentSpecification#Tracker_HTTP.2FHTTPS_Protocol
class Tracker : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder class Tracker final : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(Tracker) Q_DISABLE_COPY(Tracker)

2
src/base/http/server.h

@ -41,7 +41,7 @@ namespace Http
class IRequestHandler; class IRequestHandler;
class Connection; class Connection;
class Server : public QTcpServer class Server final : public QTcpServer
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(Server) Q_DISABLE_COPY(Server)

2
src/base/net/downloadmanager.cpp

@ -52,7 +52,7 @@ namespace
// Disguise as Firefox to avoid web server banning // Disguise as Firefox to avoid web server banning
const char DEFAULT_USER_AGENT[] = "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"; const char DEFAULT_USER_AGENT[] = "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0";
class NetworkCookieJar : public QNetworkCookieJar class NetworkCookieJar final : public QNetworkCookieJar
{ {
public: public:
explicit NetworkCookieJar(QObject *parent = nullptr) explicit NetworkCookieJar(QObject *parent = nullptr)

2
src/base/net/private/downloadhandlerimpl.h

@ -36,7 +36,7 @@
class QObject; class QObject;
class QUrl; class QUrl;
class DownloadHandlerImpl : public Net::DownloadHandler class DownloadHandlerImpl final : public Net::DownloadHandler
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(DownloadHandlerImpl) Q_DISABLE_COPY(DownloadHandlerImpl)

8
src/base/private/profile_p.h

@ -63,7 +63,7 @@ namespace Private
}; };
/// Default implementation. Takes paths from system /// Default implementation. Takes paths from system
class DefaultProfile : public Profile class DefaultProfile final : public Profile
{ {
public: public:
explicit DefaultProfile(const QString &configurationName); explicit DefaultProfile(const QString &configurationName);
@ -86,7 +86,7 @@ namespace Private
}; };
/// Custom tree: creates directories under the specified root directory /// Custom tree: creates directories under the specified root directory
class CustomProfile : public Profile class CustomProfile final : public Profile
{ {
public: public:
CustomProfile(const QString &rootPath, const QString &configurationName); CustomProfile(const QString &rootPath, const QString &configurationName);
@ -114,14 +114,14 @@ namespace Private
virtual ~PathConverter() = default; virtual ~PathConverter() = default;
}; };
class NoConvertConverter : public PathConverter class NoConvertConverter final : public PathConverter
{ {
public: public:
QString toPortablePath(const QString &path) const override; QString toPortablePath(const QString &path) const override;
QString fromPortablePath(const QString &portablePath) const override; QString fromPortablePath(const QString &portablePath) const override;
}; };
class Converter : public PathConverter class Converter final : public PathConverter
{ {
public: public:
explicit Converter(const QString &basePath); explicit Converter(const QString &basePath);

2
src/base/rss/private/rss_parser.cpp

@ -44,7 +44,7 @@
namespace namespace
{ {
class XmlStreamEntityResolver : public QXmlStreamEntityResolver class XmlStreamEntityResolver final : public QXmlStreamEntityResolver
{ {
public: public:
QString resolveUndeclaredEntity(const QString &name) override QString resolveUndeclaredEntity(const QString &name) override

2
src/base/scanfoldersmodel.h

@ -36,7 +36,7 @@ class QStringList;
class FileSystemWatcher; class FileSystemWatcher;
class ScanFoldersModel : public QAbstractListModel class ScanFoldersModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(ScanFoldersModel) Q_DISABLE_COPY(ScanFoldersModel)

4
src/webui/webapplication.h

@ -50,7 +50,7 @@ class WebApplication;
constexpr char C_SID[] = "SID"; // name of session id cookie constexpr char C_SID[] = "SID"; // name of session id cookie
class WebSession : public ISession class WebSession final : public ISession
{ {
public: public:
explicit WebSession(const QString &sid); explicit WebSession(const QString &sid);
@ -69,7 +69,7 @@ private:
QVariantHash m_data; QVariantHash m_data;
}; };
class WebApplication class WebApplication final
: public QObject, public Http::IRequestHandler, public ISessionManager : public QObject, public Http::IRequestHandler, public ISessionManager
, private Http::ResponseBuilder , private Http::ResponseBuilder
{ {

Loading…
Cancel
Save