mirror of
https://github.com/transmission/transmission
synced 2024-12-21 23:32:35 +00:00
fix: misc-include-cleaner clang-tidy warnings (#6502)
This commit is contained in:
parent
8d4dcece89
commit
9d433ff8b4
27 changed files with 27 additions and 61 deletions
|
@ -12,6 +12,7 @@ Checks: >
|
|||
-cppcoreguidelines-narrowing-conversions,
|
||||
hicpp-*,
|
||||
misc-*,
|
||||
-misc-include-cleaner,
|
||||
modernize-*,
|
||||
-modernize-use-trailing-return-type,
|
||||
performance-*,
|
||||
|
|
|
@ -10,24 +10,21 @@
|
|||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/quark.h>
|
||||
|
||||
#include <giomm/liststore.h>
|
||||
#include <giomm/menuattributeiter.h>
|
||||
#include <giomm/menulinkiter.h>
|
||||
#include <giomm/simpleaction.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <glibmm/variant.h>
|
||||
|
||||
#include <array>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
|
||||
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
||||
#include <giomm/liststore.h>
|
||||
#include <giomm/menuattributeiter.h>
|
||||
#include <giomm/menulinkiter.h>
|
||||
#include <gtkmm/shortcut.h>
|
||||
#include <gtkmm/shortcutaction.h>
|
||||
#include <gtkmm/shortcuttrigger.h>
|
||||
|
|
|
@ -74,7 +74,6 @@
|
|||
#include <sstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include <fmt/core.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/log.h>
|
||||
|
||||
#include <giomm/simpleaction.h>
|
||||
|
|
|
@ -8,14 +8,16 @@
|
|||
#include "Utils.h"
|
||||
|
||||
#include <giomm/file.h>
|
||||
#include <glibmm/error.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <glibmm/property.h>
|
||||
#include <gtkmm/box.h>
|
||||
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
||||
#include <glibmm/error.h>
|
||||
#include <glibmm/property.h>
|
||||
#include <gtkmm/filechooserdialog.h>
|
||||
#include <gtkmm/image.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <gtkmm/separator.h>
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "Percents.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
std::string Percents::to_string() const
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/version.h>
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include <glibmm/date.h>
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <libtransmission/log.h>
|
||||
#include <libtransmission/rpcimpl.h>
|
||||
#include <libtransmission/torrent-metainfo.h>
|
||||
#include <libtransmission/tr-assert.h>
|
||||
#include <libtransmission/utils.h> // tr_time()
|
||||
#include <libtransmission/variant.h>
|
||||
#include <libtransmission/web-utils.h> // tr_urlIsValid()
|
||||
|
|
|
@ -36,16 +36,10 @@
|
|||
#include <cstring> // strchr()
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
/* #define TEST_RTL */
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
// ---
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -240,7 +234,7 @@ void set_error_color(
|
|||
Gtk::Widget& widget,
|
||||
Gtk::CellRendererState flags)
|
||||
{
|
||||
static auto const error_color_name = Glib::ustring("tr_error_color"s);
|
||||
static auto const error_color_name = Glib::ustring{ "tr_error_color" };
|
||||
|
||||
auto color = Gdk::RGBA();
|
||||
if (torrent.get_error_code() != 0 && (flags & TR_GTK_CELL_RENDERER_STATE(SELECTED)) == Gtk::CellRendererState{} &&
|
||||
|
@ -256,9 +250,9 @@ void set_error_color(
|
|||
|
||||
std::optional<Gdk::RGBA> get_progress_bar_color(Torrent const& torrent, Gtk::Widget const& widget)
|
||||
{
|
||||
static auto const down_color_name = Glib::ustring("tr_transfer_down_color"s);
|
||||
static auto const up_color_name = Glib::ustring("tr_transfer_up_color"s);
|
||||
static auto const idle_color_name = Glib::ustring("tr_transfer_idle_color"s);
|
||||
static auto const down_color_name = Glib::ustring{ "tr_transfer_down_color" };
|
||||
static auto const up_color_name = Glib::ustring{ "tr_transfer_up_color" };
|
||||
static auto const idle_color_name = Glib::ustring{ "tr_transfer_idle_color" };
|
||||
|
||||
auto const* color_name = &idle_color_name;
|
||||
switch (torrent.get_activity())
|
||||
|
|
19
gtk/Utils.cc
19
gtk/Utils.cc
|
@ -26,8 +26,6 @@
|
|||
#include <glibmm/quark.h>
|
||||
#include <glibmm/spawn.h>
|
||||
#include <gtkmm/cellrenderertext.h>
|
||||
#include <gtkmm/eventcontroller.h>
|
||||
#include <gtkmm/gesture.h>
|
||||
#include <gtkmm/liststore.h>
|
||||
#include <gtkmm/messagedialog.h>
|
||||
#include <gtkmm/treemodel.h>
|
||||
|
@ -35,6 +33,8 @@
|
|||
|
||||
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
||||
#include <gdkmm/clipboard.h>
|
||||
#include <gtkmm/eventcontroller.h>
|
||||
#include <gtkmm/gesture.h>
|
||||
#include <gtkmm/gestureclick.h>
|
||||
#else
|
||||
#include <gdkmm/window.h>
|
||||
|
@ -45,7 +45,6 @@
|
|||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <stack>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
@ -54,6 +53,8 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#if GTK_CHECK_VERSION(4, 0, 0) && defined(GDK_WINDOWING_X11)
|
||||
#include <optional>
|
||||
|
||||
#include <gdk/x11/gdkx.h>
|
||||
#endif
|
||||
|
||||
|
@ -645,9 +646,7 @@ void gtr_open_uri(Glib::ustring const& uri)
|
|||
}
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
// ---
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -735,9 +734,7 @@ void gtr_priority_combo_init(Gtk::ComboBox& combo)
|
|||
});
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
// ---
|
||||
|
||||
void gtr_widget_set_visible(Gtk::Widget& widget, bool is_visible)
|
||||
{
|
||||
|
@ -847,9 +844,7 @@ void gtr_window_raise([[maybe_unused]] Gtk::Window& window)
|
|||
#endif
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
// ---
|
||||
|
||||
void gtr_unrecognized_url_dialog(Gtk::Widget& parent, Glib::ustring const& url)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,7 @@ Checks: >
|
|||
cppcoreguidelines-virtual-class-destructor,
|
||||
google-explicit-constructor,
|
||||
misc-*,
|
||||
-misc-include-cleaner,
|
||||
-misc-no-recursion,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
modernize-*,
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <small/map.hpp>
|
||||
|
||||
#include "libtransmission/transmission.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <cstdint> // uint8_t
|
||||
#include <iterator> // std::distance(), std::next(), std::prev()
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <numeric> // std::accumulate()
|
||||
#include <utility> // std::make_pair()
|
||||
#include <vector>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <cstddef>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <utility> // std::move
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <cstdint>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h> // fmt::ptr
|
||||
|
||||
#include <libutp/utp.h>
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ Checks: >
|
|||
-hicpp-multiway-paths-covered,
|
||||
-hicpp-signed-bitwise,
|
||||
misc-*,
|
||||
-misc-include-cleaner,
|
||||
-misc-no-recursion,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
modernize-*,
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <libtransmission/version.h>
|
||||
|
||||
#include "AddData.h"
|
||||
#include "Formatter.h"
|
||||
#include "InteropHelper.h"
|
||||
#include "MainWindow.h"
|
||||
#include "OptionsDialog.h"
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <libtransmission/values.h>
|
||||
|
||||
#include "Formatter.h"
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#endif
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/variant.h>
|
||||
|
||||
#include "CustomVariantType.h"
|
||||
|
@ -30,9 +29,7 @@
|
|||
using ::trqt::variant_helpers::dictAdd;
|
||||
using ::trqt::variant_helpers::getValue;
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
// ---
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -513,9 +510,7 @@ QDateTime Prefs::getDateTime(int key) const
|
|||
return values_[key].toDateTime();
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
// ---
|
||||
|
||||
void Prefs::toggleBool(int key)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "RpcQueue.h"
|
||||
#include "SessionDialog.h"
|
||||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
#include "VariantHelpers.h"
|
||||
|
||||
using ::trqt::variant_helpers::dictAdd;
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
#include <QPixmapCache>
|
||||
#include <QStyleOptionProgressBar>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include "StyleHelper.h"
|
||||
|
|
|
@ -21,13 +21,10 @@
|
|||
#include <QStyle>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h> // tr_formatter
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
// ---
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <QUrl>
|
||||
|
||||
#include "Application.h" // qApp
|
||||
#include "Filters.h"
|
||||
#include "Speed.h"
|
||||
#include "Torrent.h"
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ Checks: >
|
|||
bugprone-*,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-unchecked-optional-access,
|
||||
cert-*,
|
||||
clang-analyzer-optin*,
|
||||
cppcoreguidelines-*,
|
||||
|
@ -21,6 +22,7 @@ Checks: >
|
|||
hicpp-*,
|
||||
-hicpp-signed-bitwise,
|
||||
misc-*,
|
||||
-misc-include-cleaner,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
modernize-*,
|
||||
-modernize-use-trailing-return-type,
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cmath> // sqrt()
|
||||
#include <cstdlib> // setenv(), unsetenv()
|
||||
|
|
Loading…
Reference in a new issue