diff --git a/gtk/Application.cc b/gtk/Application.cc index 1835c0f3f..9d710f03c 100644 --- a/gtk/Application.cc +++ b/gtk/Application.cc @@ -121,10 +121,12 @@ class Application::Impl { public: Impl(Application& app, std::string const& config_dir, bool start_paused, bool start_iconified); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl() = default; - TR_DISABLE_COPY_MOVE(Impl) - void open_files(std::vector> const& files); void on_startup(); diff --git a/gtk/Application.h b/gtk/Application.h index b825a5e02..6c33ab552 100644 --- a/gtk/Application.h +++ b/gtk/Application.h @@ -4,8 +4,6 @@ #pragma once -#include - #include #include #include @@ -19,10 +17,12 @@ class Application : public Gtk::Application { public: Application(std::string const& config_dir, bool start_paused, bool start_iconified); + Application(Application&&) = delete; + Application(Application const&) = delete; + Application& operator=(Application&&) = delete; + Application& operator=(Application const&) = delete; ~Application() override; - TR_DISABLE_COPY_MOVE(Application) - friend void gtr_actions_handler(Glib::ustring const& action_name, gpointer user_data); protected: diff --git a/gtk/DetailsDialog.cc b/gtk/DetailsDialog.cc index 4200412ba..aedd287ff 100644 --- a/gtk/DetailsDialog.cc +++ b/gtk/DetailsDialog.cc @@ -79,10 +79,12 @@ class DetailsDialog::Impl { public: Impl(DetailsDialog& dialog, Glib::RefPtr const& builder, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - void set_torrents(std::vector const& torrent_ids); void refresh(); @@ -2188,10 +2190,12 @@ public: DetailsDialog& parent, Glib::RefPtr const& core, tr_torrent const* torrent); + EditTrackersDialog(EditTrackersDialog&&) = delete; + EditTrackersDialog(EditTrackersDialog const&) = delete; + EditTrackersDialog& operator=(EditTrackersDialog&&) = delete; + EditTrackersDialog& operator=(EditTrackersDialog const&) = delete; ~EditTrackersDialog() override = default; - TR_DISABLE_COPY_MOVE(EditTrackersDialog) - static std::unique_ptr create( DetailsDialog& parent, Glib::RefPtr const& core, @@ -2307,10 +2311,12 @@ public: DetailsDialog& parent, Glib::RefPtr const& core, tr_torrent const* torrent); + AddTrackerDialog(AddTrackerDialog&&) = delete; + AddTrackerDialog(AddTrackerDialog const&) = delete; + AddTrackerDialog& operator=(AddTrackerDialog&&) = delete; + AddTrackerDialog& operator=(AddTrackerDialog const&) = delete; ~AddTrackerDialog() override = default; - TR_DISABLE_COPY_MOVE(AddTrackerDialog) - static std::unique_ptr create( DetailsDialog& parent, Glib::RefPtr const& core, diff --git a/gtk/DetailsDialog.h b/gtk/DetailsDialog.h index 2eb1a2e3b..9c9843db2 100644 --- a/gtk/DetailsDialog.h +++ b/gtk/DetailsDialog.h @@ -6,7 +6,6 @@ #pragma once #include -#include #include #include @@ -26,10 +25,12 @@ public: Glib::RefPtr const& builder, Gtk::Window& parent, Glib::RefPtr const& core); + DetailsDialog(DetailsDialog&&) = delete; + DetailsDialog(DetailsDialog const&) = delete; + DetailsDialog& operator=(DetailsDialog&&) = delete; + DetailsDialog& operator=(DetailsDialog const&) = delete; ~DetailsDialog() override; - TR_DISABLE_COPY_MOVE(DetailsDialog) - static std::unique_ptr create(Gtk::Window& parent, Glib::RefPtr const& core); void set_torrents(std::vector const& torrent_ids); diff --git a/gtk/FileList.cc b/gtk/FileList.cc index e292ea9e8..ab7e05ffd 100644 --- a/gtk/FileList.cc +++ b/gtk/FileList.cc @@ -101,10 +101,12 @@ public: Glib::ustring const& view_name, Glib::RefPtr const& core, tr_torrent_id_t torrent_id); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - void set_torrent(tr_torrent_id_t torrent_id); void reset_torrent(); diff --git a/gtk/FileList.h b/gtk/FileList.h index 5930f1a5b..dc3e896db 100644 --- a/gtk/FileList.h +++ b/gtk/FileList.h @@ -6,7 +6,6 @@ #pragma once #include -#include #include #include @@ -26,10 +25,12 @@ public: Glib::ustring const& view_name, Glib::RefPtr const& core, tr_torrent_id_t torrent_id); + FileList(FileList&&) = delete; + FileList(FileList const&) = delete; + FileList& operator=(FileList&&) = delete; + FileList& operator=(FileList const&) = delete; ~FileList() override; - TR_DISABLE_COPY_MOVE(FileList) - void clear(); void set_torrent(tr_torrent_id_t torrent_id); diff --git a/gtk/FilterBar.cc b/gtk/FilterBar.cc index e2a993b27..2fb695702 100644 --- a/gtk/FilterBar.cc +++ b/gtk/FilterBar.cc @@ -58,10 +58,12 @@ class FilterBar::Impl public: Impl(FilterBar& widget, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - [[nodiscard]] Glib::RefPtr get_filter_model() const; private: diff --git a/gtk/FilterBar.h b/gtk/FilterBar.h index c7459aa63..8c7c2447c 100644 --- a/gtk/FilterBar.h +++ b/gtk/FilterBar.h @@ -7,8 +7,6 @@ #include "GtkCompat.h" -#include - #include #include #include @@ -40,10 +38,12 @@ public: public: FilterBar(); FilterBar(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + FilterBar(FilterBar&&) = delete; + FilterBar(FilterBar const&) = delete; + FilterBar& operator=(FilterBar&&) = delete; + FilterBar& operator=(FilterBar const&) = delete; ~FilterBar() override; - TR_DISABLE_COPY_MOVE(FilterBar) - Glib::RefPtr get_filter_model() const; private: diff --git a/gtk/FilterBase.h b/gtk/FilterBase.h index 93e06af37..399c52f11 100644 --- a/gtk/FilterBase.h +++ b/gtk/FilterBase.h @@ -7,8 +7,6 @@ #include "GtkCompat.h" -#include - #if GTKMM_CHECK_VERSION(4, 0, 0) #include #else @@ -34,10 +32,12 @@ public: public: FilterBase() = default; + FilterBase(FilterBase&&) = delete; + FilterBase(FilterBase const&) = delete; + FilterBase& operator=(FilterBase&&) = delete; + FilterBase& operator=(FilterBase const&) = delete; ~FilterBase() override = default; - TR_DISABLE_COPY_MOVE(FilterBase) - virtual bool match(T const& item) const = 0; virtual bool matches_all() const; diff --git a/gtk/FreeSpaceLabel.cc b/gtk/FreeSpaceLabel.cc index a786f72b4..15053158e 100644 --- a/gtk/FreeSpaceLabel.cc +++ b/gtk/FreeSpaceLabel.cc @@ -23,10 +23,12 @@ class FreeSpaceLabel::Impl { public: Impl(FreeSpaceLabel& label, Glib::RefPtr const& core, std::string_view dir); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - void set_dir(std::string_view dir); private: diff --git a/gtk/FreeSpaceLabel.h b/gtk/FreeSpaceLabel.h index 7a03af3bc..fe9fd834b 100644 --- a/gtk/FreeSpaceLabel.h +++ b/gtk/FreeSpaceLabel.h @@ -3,8 +3,6 @@ // or any future license endorsed by Mnemosyne LLC. // License text can be found in the licenses/ folder. -#include - #include #include #include @@ -23,10 +21,12 @@ public: Glib::RefPtr const& builder, Glib::RefPtr const& core, std::string_view dir = {}); + FreeSpaceLabel(FreeSpaceLabel&&) = delete; + FreeSpaceLabel(FreeSpaceLabel const&) = delete; + FreeSpaceLabel& operator=(FreeSpaceLabel&&) = delete; + FreeSpaceLabel& operator=(FreeSpaceLabel const&) = delete; ~FreeSpaceLabel() override; - TR_DISABLE_COPY_MOVE(FreeSpaceLabel) - void set_dir(std::string_view dir); private: diff --git a/gtk/MainWindow.cc b/gtk/MainWindow.cc index 0c592f286..526f1074e 100644 --- a/gtk/MainWindow.cc +++ b/gtk/MainWindow.cc @@ -93,10 +93,12 @@ public: Glib::RefPtr const& builder, Glib::RefPtr const& actions, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - [[nodiscard]] Glib::RefPtr get_selection() const; void refresh(); diff --git a/gtk/MainWindow.h b/gtk/MainWindow.h index 0168b57e7..58f7fb873 100644 --- a/gtk/MainWindow.h +++ b/gtk/MainWindow.h @@ -4,8 +4,6 @@ #pragma once -#include - #include #include #include @@ -26,10 +24,12 @@ public: Gtk::Application& app, Glib::RefPtr const& actions, Glib::RefPtr const& core); + MainWindow(MainWindow&&) = delete; + MainWindow(MainWindow const&) = delete; + MainWindow& operator=(MainWindow&&) = delete; + MainWindow& operator=(MainWindow const&) = delete; ~MainWindow() override; - TR_DISABLE_COPY_MOVE(MainWindow) - static std::unique_ptr create( Gtk::Application& app, Glib::RefPtr const& actions, diff --git a/gtk/MakeDialog.cc b/gtk/MakeDialog.cc index 3d0aea21e..f10d96ff3 100644 --- a/gtk/MakeDialog.cc +++ b/gtk/MakeDialog.cc @@ -71,10 +71,12 @@ public: std::future future, std::string_view target, Glib::RefPtr const& core); + MakeProgressDialog(MakeProgressDialog&&) = delete; + MakeProgressDialog(MakeProgressDialog const&) = delete; + MakeProgressDialog& operator=(MakeProgressDialog&&) = delete; + MakeProgressDialog& operator=(MakeProgressDialog const&) = delete; ~MakeProgressDialog() override; - TR_DISABLE_COPY_MOVE(MakeProgressDialog) - static std::unique_ptr create( std::string_view target, tr_metainfo_builder& metainfo_builder, @@ -110,10 +112,12 @@ class MakeDialog::Impl { public: Impl(MakeDialog& dialog, Glib::RefPtr const& builder, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl() = default; - TR_DISABLE_COPY_MOVE(Impl) - private: void onSourceToggled(Gtk::CheckButton* tb, PathButton* chooser); void onChooserChosen(PathButton* chooser); diff --git a/gtk/MakeDialog.h b/gtk/MakeDialog.h index a5f04070a..fb0372761 100644 --- a/gtk/MakeDialog.h +++ b/gtk/MakeDialog.h @@ -5,8 +5,6 @@ #pragma once -#include - #include #include #include @@ -24,10 +22,12 @@ public: Glib::RefPtr const& builder, Gtk::Window& parent, Glib::RefPtr const& core); + MakeDialog(MakeDialog&&) = delete; + MakeDialog(MakeDialog const&) = delete; + MakeDialog& operator=(MakeDialog&&) = delete; + MakeDialog& operator=(MakeDialog const&) = delete; ~MakeDialog() override; - TR_DISABLE_COPY_MOVE(MakeDialog) - static std::unique_ptr create(Gtk::Window& parent, Glib::RefPtr const& core); private: diff --git a/gtk/MessageLogWindow.cc b/gtk/MessageLogWindow.cc index f677c4278..8da3f257a 100644 --- a/gtk/MessageLogWindow.cc +++ b/gtk/MessageLogWindow.cc @@ -65,10 +65,12 @@ class MessageLogWindow::Impl { public: Impl(MessageLogWindow& window, Glib::RefPtr const& builder, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - private: bool onRefresh(); diff --git a/gtk/MessageLogWindow.h b/gtk/MessageLogWindow.h index a0312dc92..b4355ef98 100644 --- a/gtk/MessageLogWindow.h +++ b/gtk/MessageLogWindow.h @@ -5,8 +5,6 @@ #pragma once -#include - #include #include #include @@ -23,10 +21,12 @@ public: Glib::RefPtr const& builder, Gtk::Window& parent, Glib::RefPtr const& core); + MessageLogWindow(MessageLogWindow&&) = delete; + MessageLogWindow(MessageLogWindow const&) = delete; + MessageLogWindow& operator=(MessageLogWindow&&) = delete; + MessageLogWindow& operator=(MessageLogWindow const&) = delete; ~MessageLogWindow() override; - TR_DISABLE_COPY_MOVE(MessageLogWindow) - static std::unique_ptr create(Gtk::Window& parent, Glib::RefPtr const& core); private: diff --git a/gtk/OptionsDialog.cc b/gtk/OptionsDialog.cc index e745f8f7f..ff35197d7 100644 --- a/gtk/OptionsDialog.cc +++ b/gtk/OptionsDialog.cc @@ -73,10 +73,12 @@ public: Glib::RefPtr const& builder, Glib::RefPtr const& core, std::unique_ptr ctor); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - private: void sourceChanged(PathButton* b); void downloadDirChanged(PathButton* b); diff --git a/gtk/OptionsDialog.h b/gtk/OptionsDialog.h index 5682167f5..b8bc109c8 100644 --- a/gtk/OptionsDialog.h +++ b/gtk/OptionsDialog.h @@ -5,8 +5,6 @@ #pragma once -#include - #include #include #include @@ -28,10 +26,12 @@ public: Glib::RefPtr const& builder, Gtk::Window& parent, Glib::RefPtr const& core); + TorrentUrlChooserDialog(TorrentUrlChooserDialog&&) = delete; + TorrentUrlChooserDialog(TorrentUrlChooserDialog const&) = delete; + TorrentUrlChooserDialog& operator=(TorrentUrlChooserDialog&&) = delete; + TorrentUrlChooserDialog& operator=(TorrentUrlChooserDialog const&) = delete; ~TorrentUrlChooserDialog() override = default; - TR_DISABLE_COPY_MOVE(TorrentUrlChooserDialog) - static std::unique_ptr create(Gtk::Window& parent, Glib::RefPtr const& core); private: @@ -41,10 +41,12 @@ private: class TorrentFileChooserDialog : public Gtk::FileChooserNative { public: + TorrentFileChooserDialog(TorrentFileChooserDialog&&) = delete; + TorrentFileChooserDialog(TorrentFileChooserDialog const&) = delete; + TorrentFileChooserDialog& operator=(TorrentFileChooserDialog&&) = delete; + TorrentFileChooserDialog& operator=(TorrentFileChooserDialog const&) = delete; ~TorrentFileChooserDialog() override = default; - TR_DISABLE_COPY_MOVE(TorrentFileChooserDialog) - static std::unique_ptr create(Gtk::Window& parent, Glib::RefPtr const& core); protected: @@ -63,10 +65,12 @@ public: Gtk::Window& parent, Glib::RefPtr const& core, std::unique_ptr ctor); + OptionsDialog(OptionsDialog&&) = delete; + OptionsDialog(OptionsDialog const&) = delete; + OptionsDialog& operator=(OptionsDialog&&) = delete; + OptionsDialog& operator=(OptionsDialog const&) = delete; ~OptionsDialog() override; - TR_DISABLE_COPY_MOVE(OptionsDialog) - static std::unique_ptr create( Gtk::Window& parent, Glib::RefPtr const& core, diff --git a/gtk/PathButton.cc b/gtk/PathButton.cc index ce75ab4c0..6782547b7 100644 --- a/gtk/PathButton.cc +++ b/gtk/PathButton.cc @@ -27,10 +27,12 @@ class PathButton::Impl { public: explicit Impl(PathButton& widget); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl() = default; - TR_DISABLE_COPY_MOVE(Impl) - #if GTKMM_CHECK_VERSION(4, 0, 0) std::string const& get_filename() const; void set_filename(std::string const& value); diff --git a/gtk/PathButton.h b/gtk/PathButton.h index af28d36b4..b637d193d 100644 --- a/gtk/PathButton.h +++ b/gtk/PathButton.h @@ -7,8 +7,6 @@ #include "GtkCompat.h" -#include - #include #include #include @@ -33,10 +31,12 @@ class PathButton : public IF_GTKMM4(Gtk::Button, Gtk::FileChooserButton) public: PathButton(); PathButton(BaseObjectType* cast_item, Glib::RefPtr const& builder); + PathButton(PathButton&&) = delete; + PathButton(PathButton const&) = delete; + PathButton& operator=(PathButton&&) = delete; + PathButton& operator=(PathButton const&) = delete; ~PathButton() override; - TR_DISABLE_COPY_MOVE(PathButton) - void set_shortcut_folders(std::list const& value); #if GTKMM_CHECK_VERSION(4, 0, 0) diff --git a/gtk/PrefsDialog.cc b/gtk/PrefsDialog.cc index c04990ad2..d7514f096 100644 --- a/gtk/PrefsDialog.cc +++ b/gtk/PrefsDialog.cc @@ -61,10 +61,12 @@ class PrefsDialog::Impl { public: Impl(PrefsDialog& dialog, Glib::RefPtr const& builder, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl() = default; - TR_DISABLE_COPY_MOVE(Impl) - private: void response_cb(int response); @@ -97,10 +99,12 @@ class PageBase : public Gtk::Box { public: PageBase(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + PageBase(PageBase&&) = delete; + PageBase(PageBase const&) = delete; + PageBase& operator=(PageBase&&) = delete; + PageBase& operator=(PageBase const&) = delete; ~PageBase() override; - TR_DISABLE_COPY_MOVE(PageBase) - Gtk::CheckButton* init_check_button(Glib::ustring const& name, tr_quark key); Gtk::SpinButton* init_spin_button(Glib::ustring const& name, tr_quark key, int low, int high, int step); Gtk::SpinButton* init_spin_button_double(Glib::ustring const& name, tr_quark key, double low, double high, double step); @@ -399,10 +403,12 @@ class DownloadingPage : public PageBase { public: DownloadingPage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + DownloadingPage(DownloadingPage&&) = delete; + DownloadingPage(DownloadingPage const&) = delete; + DownloadingPage& operator=(DownloadingPage&&) = delete; + DownloadingPage& operator=(DownloadingPage const&) = delete; ~DownloadingPage() override; - TR_DISABLE_COPY_MOVE(DownloadingPage) - private: void on_core_prefs_changed(tr_quark key); @@ -463,9 +469,11 @@ class SeedingPage : public PageBase { public: SeedingPage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + SeedingPage(SeedingPage&&) = delete; + SeedingPage(SeedingPage const&) = delete; + SeedingPage& operator=(SeedingPage&&) = delete; + SeedingPage& operator=(SeedingPage const&) = delete; ~SeedingPage() override = default; - - TR_DISABLE_COPY_MOVE(SeedingPage) }; SeedingPage::SeedingPage( @@ -490,9 +498,11 @@ class DesktopPage : public PageBase { public: DesktopPage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + DesktopPage(DesktopPage&&) = delete; + DesktopPage(DesktopPage const&) = delete; + DesktopPage& operator=(DesktopPage&&) = delete; + DesktopPage& operator=(DesktopPage const&) = delete; ~DesktopPage() override = default; - - TR_DISABLE_COPY_MOVE(DesktopPage) }; DesktopPage::DesktopPage( @@ -527,10 +537,12 @@ class PrivacyPage : public PageBase public: PrivacyPage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + PrivacyPage(PrivacyPage&&) = delete; + PrivacyPage(PrivacyPage const&) = delete; + PrivacyPage& operator=(PrivacyPage&&) = delete; + PrivacyPage& operator=(PrivacyPage const&) = delete; ~PrivacyPage() override; - TR_DISABLE_COPY_MOVE(PrivacyPage) - private: void updateBlocklistText(); void onBlocklistUpdated(bool success); @@ -639,10 +651,12 @@ class RemotePage : public PageBase public: RemotePage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + RemotePage(RemotePage&&) = delete; + RemotePage(RemotePage const&) = delete; + RemotePage& operator=(RemotePage&&) = delete; + RemotePage& operator=(RemotePage const&) = delete; ~RemotePage() override = default; - TR_DISABLE_COPY_MOVE(RemotePage) - private: void refreshWhitelist(); void onAddressEdited(Glib::ustring const& path, Glib::ustring const& address); @@ -836,9 +850,11 @@ class SpeedPage : public PageBase { public: SpeedPage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + SpeedPage(SpeedPage&&) = delete; + SpeedPage(SpeedPage const&) = delete; + SpeedPage& operator=(SpeedPage&&) = delete; + SpeedPage& operator=(SpeedPage const&) = delete; ~SpeedPage() override = default; - - TR_DISABLE_COPY_MOVE(SpeedPage) }; SpeedPage::SpeedPage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core) @@ -876,10 +892,12 @@ class NetworkPage : public PageBase { public: NetworkPage(BaseObjectType* cast_item, Glib::RefPtr const& builder, Glib::RefPtr const& core); + NetworkPage(NetworkPage&&) = delete; + NetworkPage(NetworkPage const&) = delete; + NetworkPage& operator=(NetworkPage&&) = delete; + NetworkPage& operator=(NetworkPage const&) = delete; ~NetworkPage() override; - TR_DISABLE_COPY_MOVE(NetworkPage) - private: enum PortTestStatus : uint8_t { diff --git a/gtk/PrefsDialog.h b/gtk/PrefsDialog.h index d72d7796d..752a1a6d0 100644 --- a/gtk/PrefsDialog.h +++ b/gtk/PrefsDialog.h @@ -5,8 +5,6 @@ #pragma once -#include - #include #include #include @@ -24,10 +22,12 @@ public: Glib::RefPtr const& builder, Gtk::Window& parent, Glib::RefPtr const& core); + PrefsDialog(PrefsDialog&&) = delete; + PrefsDialog(PrefsDialog const&) = delete; + PrefsDialog& operator=(PrefsDialog&&) = delete; + PrefsDialog& operator=(PrefsDialog const&) = delete; ~PrefsDialog() override; - TR_DISABLE_COPY_MOVE(PrefsDialog) - static std::unique_ptr create(Gtk::Window& parent, Glib::RefPtr const& core); private: diff --git a/gtk/RelocateDialog.cc b/gtk/RelocateDialog.cc index d50223f3d..a96fe1b51 100644 --- a/gtk/RelocateDialog.cc +++ b/gtk/RelocateDialog.cc @@ -37,10 +37,12 @@ public: Glib::RefPtr const& builder, Glib::RefPtr const& core, std::vector const& torrent_ids); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - private: void onResponse(int response); bool onTimer(); diff --git a/gtk/RelocateDialog.h b/gtk/RelocateDialog.h index ad6650439..de34681a7 100644 --- a/gtk/RelocateDialog.h +++ b/gtk/RelocateDialog.h @@ -6,7 +6,6 @@ #pragma once #include -#include #include #include @@ -27,10 +26,12 @@ public: Gtk::Window& parent, Glib::RefPtr const& core, std::vector const& torrent_ids); + RelocateDialog(RelocateDialog&&) = delete; + RelocateDialog(RelocateDialog const&) = delete; + RelocateDialog& operator=(RelocateDialog&&) = delete; + RelocateDialog& operator=(RelocateDialog const&) = delete; ~RelocateDialog() override; - TR_DISABLE_COPY_MOVE(RelocateDialog) - static std::unique_ptr create( Gtk::Window& parent, Glib::RefPtr const& core, diff --git a/gtk/Session.cc b/gtk/Session.cc index e6c8a976e..b180b4062 100644 --- a/gtk/Session.cc +++ b/gtk/Session.cc @@ -62,10 +62,12 @@ class Session::Impl { public: Impl(Session& core, tr_session* session); + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - tr_session* close(); Glib::RefPtr> get_raw_model() const; diff --git a/gtk/Session.h b/gtk/Session.h index 6a72e36b6..8a022345f 100644 --- a/gtk/Session.h +++ b/gtk/Session.h @@ -9,7 +9,6 @@ #include #include -#include #include #include @@ -31,6 +30,11 @@ class Session : public Glib::Object { public: + Session(Session&&) = delete; + Session(Session const&) = delete; + Session& operator=(Session&&) = delete; + Session& operator=(Session const&) = delete; + enum ErrorCode : uint16_t { ERR_ADD_TORRENT_ERR = 1, @@ -50,8 +54,6 @@ public: public: ~Session() override; - TR_DISABLE_COPY_MOVE(Session) - static Glib::RefPtr create(tr_session* session); tr_session* close(); diff --git a/gtk/SorterBase.h b/gtk/SorterBase.h index 6bd19e1fe..bf0a43915 100644 --- a/gtk/SorterBase.h +++ b/gtk/SorterBase.h @@ -7,8 +7,6 @@ #include "GtkCompat.h" -#include - #if GTKMM_CHECK_VERSION(4, 0, 0) #include #else @@ -33,10 +31,12 @@ public: public: SorterBase() = default; + SorterBase(SorterBase&&) = delete; + SorterBase(SorterBase const&) = delete; + SorterBase& operator=(SorterBase&&) = delete; + SorterBase& operator=(SorterBase const&) = delete; ~SorterBase() override = default; - TR_DISABLE_COPY_MOVE(SorterBase) - virtual int compare(T const& lhs, T const& rhs) const = 0; #if !GTKMM_CHECK_VERSION(4, 0, 0) diff --git a/gtk/StatsDialog.cc b/gtk/StatsDialog.cc index 83d7dd7ae..e4a4f4a8c 100644 --- a/gtk/StatsDialog.cc +++ b/gtk/StatsDialog.cc @@ -26,10 +26,12 @@ class StatsDialog::Impl { public: Impl(StatsDialog& dialog, Glib::RefPtr const& builder, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - private: bool updateStats(); void dialogResponse(int response); diff --git a/gtk/StatsDialog.h b/gtk/StatsDialog.h index 89f089a6d..3831a09b9 100644 --- a/gtk/StatsDialog.h +++ b/gtk/StatsDialog.h @@ -5,8 +5,6 @@ #pragma once -#include - #include #include #include @@ -24,10 +22,12 @@ public: Glib::RefPtr const& builder, Gtk::Window& parent, Glib::RefPtr const& core); + StatsDialog(StatsDialog&&) = delete; + StatsDialog(StatsDialog const&) = delete; + StatsDialog& operator=(StatsDialog&&) = delete; + StatsDialog& operator=(StatsDialog const&) = delete; ~StatsDialog() override; - TR_DISABLE_COPY_MOVE(StatsDialog) - static std::unique_ptr create(Gtk::Window& parent, Glib::RefPtr const& core); private: diff --git a/gtk/SystemTrayIcon.cc b/gtk/SystemTrayIcon.cc index f603ee401..4025eb368 100644 --- a/gtk/SystemTrayIcon.cc +++ b/gtk/SystemTrayIcon.cc @@ -69,10 +69,12 @@ class SystemTrayIcon::Impl { public: Impl(Gtk::Window& main_window, Glib::RefPtr const& core); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - void refresh(); private: diff --git a/gtk/SystemTrayIcon.h b/gtk/SystemTrayIcon.h index 28d98c0a6..7376d0842 100644 --- a/gtk/SystemTrayIcon.h +++ b/gtk/SystemTrayIcon.h @@ -5,8 +5,6 @@ #pragma once -#include - #include #include @@ -18,10 +16,12 @@ class SystemTrayIcon { public: SystemTrayIcon(Gtk::Window& main_window, Glib::RefPtr const& core); + SystemTrayIcon(SystemTrayIcon&&) = delete; + SystemTrayIcon(SystemTrayIcon const&) = delete; + SystemTrayIcon& operator=(SystemTrayIcon&&) = delete; + SystemTrayIcon& operator=(SystemTrayIcon const&) = delete; ~SystemTrayIcon(); - TR_DISABLE_COPY_MOVE(SystemTrayIcon) - void refresh(); static bool is_available(); diff --git a/gtk/TorrentCellRenderer.cc b/gtk/TorrentCellRenderer.cc index 1f7634fbc..cf54d9b84 100644 --- a/gtk/TorrentCellRenderer.cc +++ b/gtk/TorrentCellRenderer.cc @@ -60,10 +60,12 @@ class TorrentCellRenderer::Impl { public: explicit Impl(TorrentCellRenderer& renderer); + Impl(Impl&&) = delete; + Impl(Impl const&) = delete; + Impl& operator=(Impl&&) = delete; + Impl& operator=(Impl const&) = delete; ~Impl(); - TR_DISABLE_COPY_MOVE(Impl) - Gtk::Requisition get_size_compact(Gtk::Widget& widget) const; Gtk::Requisition get_size_full(Gtk::Widget& widget) const; diff --git a/gtk/TorrentCellRenderer.h b/gtk/TorrentCellRenderer.h index c00e841fe..d8c6554ed 100644 --- a/gtk/TorrentCellRenderer.h +++ b/gtk/TorrentCellRenderer.h @@ -7,8 +7,6 @@ #include "GtkCompat.h" -#include - #include #include @@ -20,10 +18,12 @@ class TorrentCellRenderer : public Gtk::CellRenderer { public: TorrentCellRenderer(); + TorrentCellRenderer(TorrentCellRenderer&&) = delete; + TorrentCellRenderer(TorrentCellRenderer const&) = delete; + TorrentCellRenderer& operator=(TorrentCellRenderer&&) = delete; + TorrentCellRenderer& operator=(TorrentCellRenderer const&) = delete; ~TorrentCellRenderer() override; - TR_DISABLE_COPY_MOVE(TorrentCellRenderer) - Glib::PropertyProxy property_torrent(); Glib::PropertyProxy property_bar_height(); diff --git a/gtk/Utils.h b/gtk/Utils.h index dceae2dea..2d9d818c6 100644 --- a/gtk/Utils.h +++ b/gtk/Utils.h @@ -8,7 +8,6 @@ #include "GtkCompat.h" #include -#include #include #include diff --git a/libtransmission/announcer-udp.cc b/libtransmission/announcer-udp.cc index f2f03d76c..325026c4d 100644 --- a/libtransmission/announcer-udp.cc +++ b/libtransmission/announcer-udp.cc @@ -42,6 +42,7 @@ #include "libtransmission/peer-mgr.h" // for tr_pex::fromCompact4() #include "libtransmission/tr-assert.h" #include "libtransmission/tr-buffer.h" +#include "libtransmission/tr-macros.h" #include "libtransmission/tr-strbuf.h" #include "libtransmission/utils.h" #include "libtransmission/web-utils.h" diff --git a/libtransmission/peer-mgr-wishlist.cc b/libtransmission/peer-mgr-wishlist.cc index ed1df88c5..3cc4f477a 100644 --- a/libtransmission/peer-mgr-wishlist.cc +++ b/libtransmission/peer-mgr-wishlist.cc @@ -18,6 +18,7 @@ #include "libtransmission/bitfield.h" #include "libtransmission/crypto-utils.h" // for tr_salt_shaker +#include "libtransmission/tr-macros.h" #include "libtransmission/peer-mgr-wishlist.h" // Asserts in this file are expensive, so hide them in #ifdef diff --git a/libtransmission/torrent.cc b/libtransmission/torrent.cc index ca7dc82c5..beb6f7a89 100644 --- a/libtransmission/torrent.cc +++ b/libtransmission/torrent.cc @@ -23,6 +23,7 @@ #include #include "libtransmission/transmission.h" +#include "libtransmission/tr-macros.h" #include "libtransmission/announcer.h" #include "libtransmission/bandwidth.h" diff --git a/libtransmission/tr-macros.h b/libtransmission/tr-macros.h index 873027442..1eb57ff07 100644 --- a/libtransmission/tr-macros.h +++ b/libtransmission/tr-macros.h @@ -64,12 +64,6 @@ #define TR_UNLIKELY(x) (x) #endif -#define TR_DISABLE_COPY_MOVE(Class) \ - Class& operator=(Class const&) = delete; \ - Class& operator=(Class&&) = delete; \ - Class(Class const&) = delete; \ - Class(Class&&) = delete; - // --- #define TR_INET6_ADDRSTRLEN 46 diff --git a/qt/AboutDialog.h b/qt/AboutDialog.h index 9fcfc9105..87f105b39 100644 --- a/qt/AboutDialog.h +++ b/qt/AboutDialog.h @@ -7,8 +7,6 @@ #include -#include - #include "BaseDialog.h" #include "ui_AboutDialog.h" @@ -18,10 +16,13 @@ class Session; class AboutDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(AboutDialog) public: explicit AboutDialog(Session& session, QWidget* parent = nullptr); + AboutDialog(AboutDialog&&) = delete; + AboutDialog(AboutDialog const&) = delete; + AboutDialog& operator=(AboutDialog&&) = delete; + AboutDialog& operator=(AboutDialog const&) = delete; private slots: void showCredits(); diff --git a/qt/Application.h b/qt/Application.h index f1004875a..daf8b83e6 100644 --- a/qt/Application.h +++ b/qt/Application.h @@ -17,7 +17,6 @@ #include #include -#include #include #include "AddData.h" @@ -35,7 +34,6 @@ class WatchDir; class Application : public QApplication { Q_OBJECT - TR_DISABLE_COPY_MOVE(Application) public: Application( @@ -45,6 +43,10 @@ public: QStringList const& filenames, int& argc, char** argv); + Application(Application&&) = delete; + Application(Application const&) = delete; + Application& operator=(Application&&) = delete; + Application& operator=(Application const&) = delete; ~Application() override; void raise() const; diff --git a/qt/ColumnResizer.h b/qt/ColumnResizer.h index c033d973e..f5b3dc865 100644 --- a/qt/ColumnResizer.h +++ b/qt/ColumnResizer.h @@ -10,17 +10,18 @@ #include #include -#include - class QGridLayout; class ColumnResizer : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(ColumnResizer) public: explicit ColumnResizer(QObject* parent = nullptr); + ColumnResizer(ColumnResizer&&) = delete; + ColumnResizer(ColumnResizer const&) = delete; + ColumnResizer& operator=(ColumnResizer&&) = delete; + ColumnResizer& operator=(ColumnResizer const&) = delete; void addLayout(QGridLayout* layout); diff --git a/qt/DetailsDialog.h b/qt/DetailsDialog.h index 1fc2fe024..89556b0f7 100644 --- a/qt/DetailsDialog.h +++ b/qt/DetailsDialog.h @@ -12,8 +12,6 @@ #include #include -#include - #include "BaseDialog.h" #include "Session.h" #include "Typedefs.h" @@ -34,10 +32,13 @@ class TrackerModelFilter; class DetailsDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(DetailsDialog) public: DetailsDialog(Session&, Prefs&, TorrentModel const&, QWidget* parent = nullptr); + DetailsDialog(DetailsDialog&&) = delete; + DetailsDialog(DetailsDialog const&) = delete; + DetailsDialog& operator=(DetailsDialog&&) = delete; + DetailsDialog& operator=(DetailsDialog const&) = delete; ~DetailsDialog() override; void setIds(torrent_ids_t const& ids); diff --git a/qt/FileTreeDelegate.h b/qt/FileTreeDelegate.h index 9939e1ce7..3720363ea 100644 --- a/qt/FileTreeDelegate.h +++ b/qt/FileTreeDelegate.h @@ -7,18 +7,19 @@ #include -#include - class FileTreeDelegate : public QItemDelegate { Q_OBJECT - TR_DISABLE_COPY_MOVE(FileTreeDelegate) public: explicit FileTreeDelegate(QObject* parent = nullptr) : QItemDelegate{ parent } { } + FileTreeDelegate(FileTreeDelegate&&) = delete; + FileTreeDelegate(FileTreeDelegate const&) = delete; + FileTreeDelegate& operator=(FileTreeDelegate&&) = delete; + FileTreeDelegate& operator=(FileTreeDelegate const&) = delete; // QAbstractItemDelegate QSize sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const override; diff --git a/qt/FileTreeItem.h b/qt/FileTreeItem.h index d8441fe46..07ffb7c0e 100644 --- a/qt/FileTreeItem.h +++ b/qt/FileTreeItem.h @@ -14,15 +14,14 @@ #include #include -#include - #include "Utils.h" // for std::hash #include "Typedefs.h" +#include "libtransmission/tr-macros.h" + class FileTreeItem { Q_DECLARE_TR_FUNCTIONS(FileTreeItem) - TR_DISABLE_COPY_MOVE(FileTreeItem) public: static auto constexpr Low = int{ 1 << 0 }; @@ -36,6 +35,10 @@ public: { } + FileTreeItem& operator=(FileTreeItem&&) = delete; + FileTreeItem& operator=(FileTreeItem const&) = delete; + FileTreeItem(FileTreeItem&&) = delete; + FileTreeItem(FileTreeItem const&) = delete; ~FileTreeItem(); void appendChild(FileTreeItem* child); diff --git a/qt/FileTreeModel.h b/qt/FileTreeModel.h index b9f8708f4..c780faa67 100644 --- a/qt/FileTreeModel.h +++ b/qt/FileTreeModel.h @@ -12,8 +12,6 @@ #include -#include - #include "Typedefs.h" // file_indices_t class FileTreeItem; @@ -21,7 +19,6 @@ class FileTreeItem; class FileTreeModel final : public QAbstractItemModel { Q_OBJECT - TR_DISABLE_COPY_MOVE(FileTreeModel) public: enum @@ -44,6 +41,10 @@ public: }; FileTreeModel(QObject* parent = nullptr, bool is_editable = true); + FileTreeModel& operator=(FileTreeModel&&) = delete; + FileTreeModel& operator=(FileTreeModel const&) = delete; + FileTreeModel(FileTreeModel&&) = delete; + FileTreeModel(FileTreeModel const&) = delete; ~FileTreeModel() override; void setEditable(bool editable); diff --git a/qt/FileTreeView.h b/qt/FileTreeView.h index a0358eea9..87924caa8 100644 --- a/qt/FileTreeView.h +++ b/qt/FileTreeView.h @@ -7,8 +7,6 @@ #include -#include - #include "Torrent.h" // FileList #include "Typedefs.h" // file_indices_t @@ -22,10 +20,13 @@ class FileTreeModel; class FileTreeView : public QTreeView { Q_OBJECT - TR_DISABLE_COPY_MOVE(FileTreeView) public: FileTreeView(QWidget* parent = nullptr, bool editable = true); + FileTreeView(FileTreeView&&) = delete; + FileTreeView(FileTreeView const&) = delete; + FileTreeView& operator=(FileTreeView&&) = delete; + FileTreeView& operator=(FileTreeView const&) = delete; void clear(); void update(FileList const& files, bool update_fields = true); diff --git a/qt/FilterBar.h b/qt/FilterBar.h index 0a5bf291e..fbdc357fc 100644 --- a/qt/FilterBar.h +++ b/qt/FilterBar.h @@ -14,8 +14,6 @@ #include #include -#include - #include "Torrent.h" #include "Typedefs.h" @@ -30,10 +28,13 @@ class TorrentModel; class FilterBar : public QWidget { Q_OBJECT - TR_DISABLE_COPY_MOVE(FilterBar) public: FilterBar(Prefs& prefs, TorrentModel const& torrents, TorrentFilter const& filter, QWidget* parent = nullptr); + FilterBar(FilterBar&&) = delete; + FilterBar(FilterBar const&) = delete; + FilterBar& operator=(FilterBar&&) = delete; + FilterBar& operator=(FilterBar const&) = delete; public slots: void clear(); diff --git a/qt/FilterBarComboBox.h b/qt/FilterBarComboBox.h index 6228f2b57..24acc8e52 100644 --- a/qt/FilterBarComboBox.h +++ b/qt/FilterBarComboBox.h @@ -7,12 +7,9 @@ #include -#include - class FilterBarComboBox : public QComboBox { Q_OBJECT - TR_DISABLE_COPY_MOVE(FilterBarComboBox) public: enum @@ -23,6 +20,10 @@ public: }; explicit FilterBarComboBox(QWidget* parent = nullptr); + FilterBarComboBox(FilterBarComboBox&&) = delete; + FilterBarComboBox(FilterBarComboBox const&) = delete; + FilterBarComboBox& operator=(FilterBarComboBox&&) = delete; + FilterBarComboBox& operator=(FilterBarComboBox const&) = delete; // QWidget QSize minimumSizeHint() const override; diff --git a/qt/FilterBarComboBoxDelegate.h b/qt/FilterBarComboBoxDelegate.h index 506ed8e35..7023aaf85 100644 --- a/qt/FilterBarComboBoxDelegate.h +++ b/qt/FilterBarComboBoxDelegate.h @@ -7,18 +7,19 @@ #include -#include - class QAbstractItemModel; class QComboBox; class FilterBarComboBoxDelegate : public QItemDelegate { Q_OBJECT - TR_DISABLE_COPY_MOVE(FilterBarComboBoxDelegate) public: FilterBarComboBoxDelegate(QObject* parent, QComboBox* combo); + FilterBarComboBoxDelegate(FilterBarComboBoxDelegate&&) = delete; + FilterBarComboBoxDelegate(FilterBarComboBoxDelegate const&) = delete; + FilterBarComboBoxDelegate& operator=(FilterBarComboBoxDelegate&&) = delete; + FilterBarComboBoxDelegate& operator=(FilterBarComboBoxDelegate const&) = delete; static bool isSeparator(QModelIndex const& index); static void setSeparator(QAbstractItemModel* model, QModelIndex const& index); diff --git a/qt/FreeSpaceLabel.h b/qt/FreeSpaceLabel.h index 8dab96c08..7be9cae52 100644 --- a/qt/FreeSpaceLabel.h +++ b/qt/FreeSpaceLabel.h @@ -9,8 +9,6 @@ #include #include -#include - class Session; extern "C" @@ -21,10 +19,13 @@ extern "C" class FreeSpaceLabel : public QLabel { Q_OBJECT - TR_DISABLE_COPY_MOVE(FreeSpaceLabel) public: explicit FreeSpaceLabel(QWidget* parent = nullptr); + FreeSpaceLabel(FreeSpaceLabel&&) = delete; + FreeSpaceLabel(FreeSpaceLabel const&) = delete; + FreeSpaceLabel& operator=(FreeSpaceLabel&&) = delete; + FreeSpaceLabel& operator=(FreeSpaceLabel const&) = delete; void setSession(Session& session); void setPath(QString const& path); diff --git a/qt/IconToolButton.h b/qt/IconToolButton.h index 98b8e7d5e..1ab3705e4 100644 --- a/qt/IconToolButton.h +++ b/qt/IconToolButton.h @@ -7,15 +7,16 @@ #include -#include - class IconToolButton : public QToolButton { Q_OBJECT - TR_DISABLE_COPY_MOVE(IconToolButton) public: explicit IconToolButton(QWidget* parent = nullptr); + IconToolButton(IconToolButton&&) = delete; + IconToolButton(IconToolButton const&) = delete; + IconToolButton& operator=(IconToolButton&&) = delete; + IconToolButton& operator=(IconToolButton const&) = delete; // QWidget QSize sizeHint() const override; diff --git a/qt/InteropObject.h b/qt/InteropObject.h index 6118d44fe..76466f3b6 100644 --- a/qt/InteropObject.h +++ b/qt/InteropObject.h @@ -7,12 +7,9 @@ #include -#include - class InteropObject : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(InteropObject) #ifdef ENABLE_DBUS_INTEROP Q_CLASSINFO("D-Bus Interface", "com.transmissionbt.Transmission") @@ -28,6 +25,10 @@ class InteropObject : public QObject public: explicit InteropObject(QObject* parent = nullptr); + InteropObject& operator=(InteropObject&&) = delete; + InteropObject& operator=(InteropObject const&) = delete; + InteropObject(InteropObject&&) = delete; + InteropObject(InteropObject const&) = delete; public slots: bool PresentWindow() const; diff --git a/qt/LicenseDialog.h b/qt/LicenseDialog.h index df2083f2a..6f80f965f 100644 --- a/qt/LicenseDialog.h +++ b/qt/LicenseDialog.h @@ -5,18 +5,19 @@ #pragma once -#include - #include "BaseDialog.h" #include "ui_LicenseDialog.h" class LicenseDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(LicenseDialog) public: explicit LicenseDialog(QWidget* parent = nullptr); + LicenseDialog(LicenseDialog&&) = delete; + LicenseDialog(LicenseDialog const&) = delete; + LicenseDialog& operator=(LicenseDialog&&) = delete; + LicenseDialog& operator=(LicenseDialog const&) = delete; private: Ui::LicenseDialog ui_ = {}; diff --git a/qt/MainWindow.h b/qt/MainWindow.h index ed17a6976..772cebe87 100644 --- a/qt/MainWindow.h +++ b/qt/MainWindow.h @@ -17,8 +17,6 @@ #include #include -#include - #include "Filters.h" #include "Speed.h" #include "TorrentFilter.h" @@ -50,10 +48,13 @@ extern "C" class MainWindow : public QMainWindow { Q_OBJECT - TR_DISABLE_COPY_MOVE(MainWindow) public: MainWindow(Session&, Prefs&, TorrentModel&, bool minimized); + MainWindow(MainWindow&&) = delete; + MainWindow(MainWindow const&) = delete; + MainWindow& operator=(MainWindow&&) = delete; + MainWindow& operator=(MainWindow const&) = delete; [[nodiscard]] constexpr QSystemTrayIcon& trayIcon() noexcept { diff --git a/qt/MakeDialog.h b/qt/MakeDialog.h index 43fa656f3..0cd71d7b2 100644 --- a/qt/MakeDialog.h +++ b/qt/MakeDialog.h @@ -7,7 +7,6 @@ #include -#include #include #include "BaseDialog.h" @@ -19,10 +18,13 @@ class Session; class MakeDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(MakeDialog) public: MakeDialog(Session&, QWidget* parent = nullptr); + MakeDialog(MakeDialog&&) = delete; + MakeDialog(MakeDialog const&) = delete; + MakeDialog& operator=(MakeDialog&&) = delete; + MakeDialog& operator=(MakeDialog const&) = delete; protected: // QWidget diff --git a/qt/OptionsDialog.h b/qt/OptionsDialog.h index f2b967c3d..bd5667ab1 100644 --- a/qt/OptionsDialog.h +++ b/qt/OptionsDialog.h @@ -13,8 +13,6 @@ #include #include -#include - #include "AddData.h" // AddData #include "BaseDialog.h" #include "Torrent.h" // FileList @@ -36,10 +34,13 @@ extern "C" class OptionsDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(OptionsDialog) public: OptionsDialog(Session& session, Prefs const& prefs, AddData addme, QWidget* parent = nullptr); + OptionsDialog& operator=(OptionsDialog&&) = delete; + OptionsDialog& operator=(OptionsDialog const&) = delete; + OptionsDialog(OptionsDialog&&) = delete; + OptionsDialog(OptionsDialog const&) = delete; ~OptionsDialog() override; private slots: diff --git a/qt/PathButton.h b/qt/PathButton.h index 398cf1e54..bf7143733 100644 --- a/qt/PathButton.h +++ b/qt/PathButton.h @@ -7,12 +7,9 @@ #include -#include - class PathButton : public QToolButton { Q_OBJECT - TR_DISABLE_COPY_MOVE(PathButton) public: enum Mode @@ -22,6 +19,10 @@ public: }; explicit PathButton(QWidget* parent = nullptr); + PathButton(PathButton&&) = delete; + PathButton(PathButton const&) = delete; + PathButton& operator=(PathButton&&) = delete; + PathButton& operator=(PathButton const&) = delete; void setMode(Mode mode); void setTitle(QString const& title); diff --git a/qt/Prefs.h b/qt/Prefs.h index e395329e0..d873b0e50 100644 --- a/qt/Prefs.h +++ b/qt/Prefs.h @@ -12,7 +12,6 @@ #include #include -#include class QDateTime; @@ -24,7 +23,6 @@ extern "C" class Prefs : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(Prefs) public: enum @@ -132,6 +130,10 @@ public: }; explicit Prefs(QString config_dir); + Prefs(Prefs&&) = delete; + Prefs(Prefs const&) = delete; + Prefs& operator=(Prefs&&) = delete; + Prefs& operator=(Prefs const&) = delete; ~Prefs() override; [[nodiscard]] constexpr auto isCore(int key) const noexcept diff --git a/qt/PrefsDialog.h b/qt/PrefsDialog.h index c2781f4e8..e80b5bbe2 100644 --- a/qt/PrefsDialog.h +++ b/qt/PrefsDialog.h @@ -9,8 +9,6 @@ #include #include -#include - #include "BaseDialog.h" #include "Prefs.h" #include "Session.h" @@ -23,10 +21,13 @@ class QString; class PrefsDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(PrefsDialog) public: PrefsDialog(Session&, Prefs&, QWidget* parent = nullptr); + PrefsDialog& operator=(PrefsDialog&&) = delete; + PrefsDialog& operator=(PrefsDialog const&) = delete; + PrefsDialog(PrefsDialog&&) = delete; + PrefsDialog(PrefsDialog const&) = delete; private slots: void focusChanged(QWidget* old, QWidget* cur); diff --git a/qt/RelocateDialog.h b/qt/RelocateDialog.h index 4aa70969d..5c2f5093e 100644 --- a/qt/RelocateDialog.h +++ b/qt/RelocateDialog.h @@ -5,8 +5,6 @@ #pragma once -#include - #include "BaseDialog.h" #include "Typedefs.h" #include "ui_RelocateDialog.h" @@ -17,10 +15,13 @@ class TorrentModel; class RelocateDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(RelocateDialog) public: RelocateDialog(Session&, TorrentModel const&, torrent_ids_t ids, QWidget* parent = nullptr); + RelocateDialog(RelocateDialog&&) = delete; + RelocateDialog(RelocateDialog const&) = delete; + RelocateDialog& operator=(RelocateDialog&&) = delete; + RelocateDialog& operator=(RelocateDialog const&) = delete; private slots: void onSetLocation(); diff --git a/qt/RpcClient.h b/qt/RpcClient.h index a12d30cbe..419f9f644 100644 --- a/qt/RpcClient.h +++ b/qt/RpcClient.h @@ -50,10 +50,13 @@ using RpcResponseFuture = QFuture; class RpcClient : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(RpcClient) public: explicit RpcClient(QObject* parent = nullptr); + RpcClient(RpcClient&&) = delete; + RpcClient(RpcClient const&) = delete; + RpcClient& operator=(RpcClient&&) = delete; + RpcClient& operator=(RpcClient const&) = delete; [[nodiscard]] constexpr auto const& url() const noexcept { diff --git a/qt/RpcQueue.h b/qt/RpcQueue.h index a798ae196..782e8daf4 100644 --- a/qt/RpcQueue.h +++ b/qt/RpcQueue.h @@ -15,17 +15,18 @@ #include #include -#include - #include "RpcClient.h" class RpcQueue : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(RpcQueue) public: explicit RpcQueue(QObject* parent = nullptr); + RpcQueue(RpcQueue&&) = delete; + RpcQueue(RpcQueue const&) = delete; + RpcQueue& operator=(RpcQueue&&) = delete; + RpcQueue& operator=(RpcQueue const&) = delete; constexpr void setTolerateErrors(bool tolerate_errors = true) { diff --git a/qt/Session.h b/qt/Session.h index e00993db5..27328a45c 100644 --- a/qt/Session.h +++ b/qt/Session.h @@ -20,7 +20,6 @@ #include #include -#include #include "RpcClient.h" #include "RpcQueue.h" @@ -38,10 +37,13 @@ extern "C" class Session : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(Session) public: Session(QString config_dir, Prefs& prefs); + Session(Session&&) = delete; + Session(Session const&) = delete; + Session& operator=(Session&&) = delete; + Session& operator=(Session const&) = delete; ~Session() override; void stop(); diff --git a/qt/SessionDialog.h b/qt/SessionDialog.h index ee20ac586..a2fa74810 100644 --- a/qt/SessionDialog.h +++ b/qt/SessionDialog.h @@ -7,8 +7,6 @@ #include -#include - #include "BaseDialog.h" #include "ui_SessionDialog.h" @@ -18,10 +16,13 @@ class Session; class SessionDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(SessionDialog) public: SessionDialog(Session& session, Prefs& prefs, QWidget* parent = nullptr); + SessionDialog(SessionDialog&&) = delete; + SessionDialog(SessionDialog const&) = delete; + SessionDialog& operator=(SessionDialog&&) = delete; + SessionDialog& operator=(SessionDialog const&) = delete; public slots: // QDialog diff --git a/qt/SqueezeLabel.h b/qt/SqueezeLabel.h index b23767812..d4e10c249 100644 --- a/qt/SqueezeLabel.h +++ b/qt/SqueezeLabel.h @@ -43,16 +43,17 @@ #include -#include - class SqueezeLabel : public QLabel { Q_OBJECT - TR_DISABLE_COPY_MOVE(SqueezeLabel) public: explicit SqueezeLabel(QWidget* parent = nullptr); explicit SqueezeLabel(QString const& text, QWidget* parent = nullptr); + SqueezeLabel(SqueezeLabel&&) = delete; + SqueezeLabel(SqueezeLabel const&) = delete; + SqueezeLabel& operator=(SqueezeLabel&&) = delete; + SqueezeLabel& operator=(SqueezeLabel const&) = delete; protected: // QWidget diff --git a/qt/StatsDialog.h b/qt/StatsDialog.h index a70eeded3..181b35d90 100644 --- a/qt/StatsDialog.h +++ b/qt/StatsDialog.h @@ -7,8 +7,6 @@ #include -#include - #include "BaseDialog.h" #include "ui_StatsDialog.h" @@ -17,10 +15,13 @@ class Session; class StatsDialog : public BaseDialog { Q_OBJECT - TR_DISABLE_COPY_MOVE(StatsDialog) public: explicit StatsDialog(Session&, QWidget* parent = nullptr); + StatsDialog(StatsDialog&&) = delete; + StatsDialog(StatsDialog const&) = delete; + StatsDialog& operator=(StatsDialog&&) = delete; + StatsDialog& operator=(StatsDialog const&) = delete; // QWidget void setVisible(bool visible) override; diff --git a/qt/Torrent.h b/qt/Torrent.h index 562e8598e..600dab379 100644 --- a/qt/Torrent.h +++ b/qt/Torrent.h @@ -21,8 +21,8 @@ #include #include +#include "libtransmission/tr-macros.h" #include -#include #include "IconCache.h" #include "Speed.h" @@ -147,10 +147,13 @@ public: class Torrent : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(Torrent) public: Torrent(Prefs const&, int id); + Torrent(Torrent&&) = delete; + Torrent(Torrent const&) = delete; + Torrent& operator=(Torrent&&) = delete; + Torrent& operator=(Torrent const&) = delete; [[nodiscard]] constexpr auto getBandwidthPriority() const noexcept { diff --git a/qt/TorrentDelegate.h b/qt/TorrentDelegate.h index 06f2ded3c..c1b178333 100644 --- a/qt/TorrentDelegate.h +++ b/qt/TorrentDelegate.h @@ -9,8 +9,6 @@ #include -#include - class QStyle; class QStyleOptionProgressBar; @@ -19,10 +17,13 @@ class Torrent; class TorrentDelegate : public QStyledItemDelegate { Q_OBJECT - TR_DISABLE_COPY_MOVE(TorrentDelegate) public: explicit TorrentDelegate(QObject* parent = nullptr); + TorrentDelegate& operator=(TorrentDelegate&&) = delete; + TorrentDelegate& operator=(TorrentDelegate const&) = delete; + TorrentDelegate(TorrentDelegate&&) = delete; + TorrentDelegate(TorrentDelegate const&) = delete; // QAbstractItemDelegate QSize sizeHint(QStyleOptionViewItem const& option, QModelIndex const& index) const override; diff --git a/qt/TorrentDelegateMin.h b/qt/TorrentDelegateMin.h index e3358ae67..a69ee1f83 100644 --- a/qt/TorrentDelegateMin.h +++ b/qt/TorrentDelegateMin.h @@ -5,20 +5,21 @@ #pragma once -#include - #include "TorrentDelegate.h" class TorrentDelegateMin : public TorrentDelegate { Q_OBJECT - TR_DISABLE_COPY_MOVE(TorrentDelegateMin) public: explicit TorrentDelegateMin(QObject* parent = nullptr) : TorrentDelegate{ parent } { } + TorrentDelegateMin(TorrentDelegateMin&&) = delete; + TorrentDelegateMin(TorrentDelegateMin const&) = delete; + TorrentDelegateMin& operator=(TorrentDelegateMin&&) = delete; + TorrentDelegateMin& operator=(TorrentDelegateMin const&) = delete; protected: // TorrentDelegate diff --git a/qt/TorrentFilter.h b/qt/TorrentFilter.h index c89dff9cf..562b1a62b 100644 --- a/qt/TorrentFilter.h +++ b/qt/TorrentFilter.h @@ -10,8 +10,6 @@ #include #include -#include - #include "Filters.h" class QString; @@ -23,7 +21,6 @@ class Torrent; class TorrentFilter : public QSortFilterProxyModel { Q_OBJECT - TR_DISABLE_COPY_MOVE(TorrentFilter) public: enum TextMode @@ -34,6 +31,11 @@ public: }; explicit TorrentFilter(Prefs const& prefs); + TorrentFilter(TorrentFilter&&) = delete; + TorrentFilter(TorrentFilter const&) = delete; + TorrentFilter& operator=(TorrentFilter&&) = delete; + TorrentFilter& operator=(TorrentFilter const&) = delete; + [[nodiscard]] std::array countTorrentsPerMode() const; protected: diff --git a/qt/TorrentModel.h b/qt/TorrentModel.h index 8a195b583..5e2a882c2 100644 --- a/qt/TorrentModel.h +++ b/qt/TorrentModel.h @@ -11,8 +11,6 @@ #include -#include - #include "Torrent.h" #include "Typedefs.h" @@ -27,7 +25,6 @@ extern "C" class TorrentModel : public QAbstractListModel { Q_OBJECT - TR_DISABLE_COPY_MOVE(TorrentModel) public: enum Role @@ -36,6 +33,10 @@ public: }; explicit TorrentModel(Prefs const& prefs); + TorrentModel& operator=(TorrentModel&&) = delete; + TorrentModel& operator=(TorrentModel const&) = delete; + TorrentModel(TorrentModel&&) = delete; + TorrentModel(TorrentModel const&) = delete; ~TorrentModel() override; void clear(); diff --git a/qt/TorrentView.h b/qt/TorrentView.h index e8df6b5cb..936a75ea8 100644 --- a/qt/TorrentView.h +++ b/qt/TorrentView.h @@ -7,15 +7,16 @@ #include -#include - class TorrentView : public QListView { Q_OBJECT - TR_DISABLE_COPY_MOVE(TorrentView) public: explicit TorrentView(QWidget* parent = nullptr); + TorrentView(TorrentView&&) = delete; + TorrentView(TorrentView const&) = delete; + TorrentView& operator=(TorrentView&&) = delete; + TorrentView& operator=(TorrentView const&) = delete; public slots: void setHeaderText(QString const& text); diff --git a/qt/TrackerDelegate.h b/qt/TrackerDelegate.h index 67cd0a81f..2eafbc533 100644 --- a/qt/TrackerDelegate.h +++ b/qt/TrackerDelegate.h @@ -7,8 +7,6 @@ #include -#include - class QStyle; class Session; @@ -17,13 +15,16 @@ struct TrackerInfo; class TrackerDelegate : public QItemDelegate { Q_OBJECT - TR_DISABLE_COPY_MOVE(TrackerDelegate) public: explicit TrackerDelegate(QObject* parent = nullptr) : QItemDelegate{ parent } { } + TrackerDelegate(TrackerDelegate&&) = delete; + TrackerDelegate(TrackerDelegate const&) = delete; + TrackerDelegate& operator=(TrackerDelegate&&) = delete; + TrackerDelegate& operator=(TrackerDelegate const&) = delete; void setShowMore(bool b); diff --git a/qt/TrackerModel.h b/qt/TrackerModel.h index bd1972462..afba8314e 100644 --- a/qt/TrackerModel.h +++ b/qt/TrackerModel.h @@ -9,8 +9,6 @@ #include -#include - #include "Torrent.h" #include "Typedefs.h" @@ -27,7 +25,6 @@ Q_DECLARE_METATYPE(TrackerInfo) class TrackerModel : public QAbstractListModel { Q_OBJECT - TR_DISABLE_COPY_MOVE(TrackerModel) public: enum Role @@ -36,6 +33,10 @@ public: }; TrackerModel() = default; + TrackerModel(TrackerModel&&) = delete; + TrackerModel(TrackerModel const&) = delete; + TrackerModel& operator=(TrackerModel&&) = delete; + TrackerModel& operator=(TrackerModel const&) = delete; void refresh(TorrentModel const&, torrent_ids_t const& ids); int find(int torrent_id, QString const& url) const; diff --git a/qt/TrackerModelFilter.h b/qt/TrackerModelFilter.h index d93ce76a9..55251c399 100644 --- a/qt/TrackerModelFilter.h +++ b/qt/TrackerModelFilter.h @@ -7,15 +7,16 @@ #include -#include - class TrackerModelFilter : public QSortFilterProxyModel { Q_OBJECT - TR_DISABLE_COPY_MOVE(TrackerModelFilter) public: explicit TrackerModelFilter(QObject* parent = nullptr); + TrackerModelFilter(TrackerModelFilter&&) = delete; + TrackerModelFilter(TrackerModelFilter const&) = delete; + TrackerModelFilter& operator=(TrackerModelFilter&&) = delete; + TrackerModelFilter& operator=(TrackerModelFilter const&) = delete; void setShowBackupTrackers(bool); diff --git a/qt/WatchDir.h b/qt/WatchDir.h index 180c46baa..d764c1f3b 100644 --- a/qt/WatchDir.h +++ b/qt/WatchDir.h @@ -12,17 +12,18 @@ #include #include -#include - class TorrentModel; class WatchDir : public QObject { Q_OBJECT - TR_DISABLE_COPY_MOVE(WatchDir) public: explicit WatchDir(TorrentModel const&); + WatchDir(WatchDir&&) = delete; + WatchDir(WatchDir const&) = delete; + WatchDir& operator=(WatchDir&&) = delete; + WatchDir& operator=(WatchDir const&) = delete; void setPath(QString const& path, bool is_enabled); diff --git a/tests/libtransmission/torrent-files-test.cc b/tests/libtransmission/torrent-files-test.cc index 9334ea158..c49700bb6 100644 --- a/tests/libtransmission/torrent-files-test.cc +++ b/tests/libtransmission/torrent-files-test.cc @@ -15,6 +15,7 @@ #include #include +#include "libtransmission/tr-macros.h" #include #include "gtest/gtest.h" diff --git a/tests/libtransmission/watchdir-test.cc b/tests/libtransmission/watchdir-test.cc index 139fee9c8..40fc2f8a8 100644 --- a/tests/libtransmission/watchdir-test.cc +++ b/tests/libtransmission/watchdir-test.cc @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include