Automatically (re)order include directives (GTK client) (#4475)
* Automatically (re)order include directives (GTK client) Include our headers first to ease IWYU enforcement. * Fix includes missing from headers (GTK client) * Fix build on Mac after includes reordering
This commit is contained in:
parent
ab9e971903
commit
5fd0aff818
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
BasedOnStyle: InheritParentConfig
|
||||
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^<libtransmission/transmission.h>'
|
||||
Priority: 3
|
||||
SortPriority: 3
|
||||
- Regex: '^<libtransmission/'
|
||||
Priority: 3
|
||||
SortPriority: 4
|
||||
- Regex: '^<(cairo|gdk|gio|glib|gtk|pango)mm[-./]'
|
||||
Priority: 5
|
||||
- Regex: '^<(fmt)/'
|
||||
Priority: 6
|
||||
- Regex: '^<(cairo|gdk|gio|glib|gtk|pango)[-./]'
|
||||
Priority: 8
|
||||
- Regex: '^<(libappindicator|libayatana-appindicator)/'
|
||||
Priority: 9
|
||||
- Regex: '^<(winsock2|ws2tcpip)\.h>'
|
||||
Priority: 10
|
||||
- Regex: '^<(arpa|sys)/'
|
||||
Priority: 11
|
||||
- Regex: '^<[a-z_]+>'
|
||||
Priority: 7
|
||||
- Regex: '.*'
|
||||
Priority: 2
|
||||
SortIncludes: CaseInsensitive
|
|
@ -3,23 +3,24 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include "Actions.h"
|
||||
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <array>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include "Actions.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
using VariantString = Glib::Variant<Glib::ustring>;
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
class Session;
|
||||
|
||||
Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder> const& builder, gpointer callback_user_data);
|
||||
|
|
|
@ -2,38 +2,9 @@
|
|||
// It may be used under the MIT (SPDX: MIT) license.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <algorithm>
|
||||
#include <csignal>
|
||||
#include <cstdlib> // exit()
|
||||
#include <ctime>
|
||||
#include <iterator> // std::back_inserter
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <giomm.h>
|
||||
#include <glib/gmessages.h>
|
||||
#ifdef G_OS_UNIX
|
||||
#include <glib-unix.h>
|
||||
#endif
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <libtransmission/log.h>
|
||||
#include <libtransmission/rpcimpl.h>
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/version.h>
|
||||
#include "Application.h"
|
||||
|
||||
#include "Actions.h"
|
||||
#include "Application.h"
|
||||
#include "DetailsDialog.h"
|
||||
#include "Dialogs.h"
|
||||
#include "FilterBar.h"
|
||||
|
@ -52,6 +23,37 @@
|
|||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/log.h>
|
||||
#include <libtransmission/rpcimpl.h>
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/version.h>
|
||||
|
||||
#include <giomm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <csignal>
|
||||
#include <cstdlib> // exit()
|
||||
#include <ctime>
|
||||
#include <iterator> // std::back_inserter
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <glib/gmessages.h>
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
#include <glib-unix.h>
|
||||
#endif
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Application : public Gtk::Application
|
||||
{
|
||||
|
|
|
@ -3,12 +3,25 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#include "DetailsDialog.h"
|
||||
|
||||
#include "Actions.h"
|
||||
#include "FaviconCache.h" // gtr_get_favicon()
|
||||
#include "FileList.h"
|
||||
#include "HigWorkarea.h" // GUI_PAD, GUI_PAD_BIG, GUI_PAD_SMALL
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/chrono.h>
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
@ -22,25 +35,12 @@
|
|||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/chrono.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include "Actions.h"
|
||||
#include "DetailsDialog.h"
|
||||
#include "FaviconCache.h" // gtr_get_favicon()
|
||||
#include "FileList.h"
|
||||
#include "HigWorkarea.h" // GUI_PAD, GUI_PAD_BIG, GUI_PAD_SMALL
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -2,19 +2,18 @@
|
|||
// It may be used under the MIT (SPDX: MIT) license.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "Dialogs.h"
|
||||
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include "Dialogs.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
/***
|
||||
****
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class Session;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,6 +3,16 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include "FaviconCache.h"
|
||||
|
||||
#include "Utils.h" /* gtr_get_host_from_url() */
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/web-utils.h>
|
||||
#include <libtransmission/web.h> // tr_sessionFetch()
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
@ -11,15 +21,6 @@
|
|||
|
||||
#include <glib/gstdio.h> /* g_remove() */
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/web.h> // tr_sessionFetch()
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include "FaviconCache.h"
|
||||
#include "Utils.h" /* gtr_get_host_from_url() */
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
namespace
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <gdkmm.h>
|
||||
#include <glibmm.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
void gtr_get_favicon(
|
||||
tr_session* session,
|
||||
|
|
|
@ -3,6 +3,21 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include "FileList.h"
|
||||
|
||||
#include "HigWorkarea.h" // GUI_PAD, GUI_PAD_BIG
|
||||
#include "IconCache.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
|
@ -14,21 +29,6 @@
|
|||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include "FileList.h"
|
||||
#include "HigWorkarea.h" // GUI_PAD, GUI_PAD_BIG
|
||||
#include "IconCache.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
namespace
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -3,6 +3,21 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include "FilterBar.h"
|
||||
|
||||
#include "FaviconCache.h" // gtr_get_favicon()
|
||||
#include "HigWorkarea.h" // GUI_PAD
|
||||
#include "ListModelAdapter.h"
|
||||
#include "Session.h" // torrent_cols
|
||||
#include "Torrent.h"
|
||||
#include "TorrentFilter.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <algorithm> // std::transform()
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
@ -10,20 +25,6 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include "FaviconCache.h" // gtr_get_favicon()
|
||||
#include "FilterBar.h"
|
||||
#include "HigWorkarea.h" // GUI_PAD
|
||||
#include "ListModelAdapter.h"
|
||||
#include "Session.h" // torrent_cols
|
||||
#include "Torrent.h"
|
||||
#include "TorrentFilter.h"
|
||||
#include "Utils.h"
|
||||
|
||||
class FilterBar::Impl
|
||||
{
|
||||
using FilterModel = IF_GTKMM4(Gtk::FilterListModel, Gtk::TreeModelFilter);
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <glibmm/extraclassinit.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include "Utils.h"
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -3,19 +3,20 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include "FreeSpaceLabel.h"
|
||||
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include "FreeSpaceLabel.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
class FreeSpaceLabel::Impl
|
||||
{
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -5,18 +5,19 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "IconCache.h"
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
#include <giomm.h>
|
||||
#include <glibmm.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <giomm.h>
|
||||
|
||||
#include "IconCache.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
using IconCache = std::map<std::string, Glib::RefPtr<Gio::Icon>, std::less<>>;
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
extern std::string_view const DirectoryMimeType;
|
||||
extern std::string_view const UnknownMimeType;
|
||||
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "Utils.h"
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "Utils.h"
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
class ListModelAdapter
|
||||
: public Gtk::TreeModel
|
||||
|
|
|
@ -2,19 +2,11 @@
|
|||
// It may be used under the MIT (SPDX: MIT) license.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h> // tr_formatter_speed_KBps()
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include "Actions.h"
|
||||
#include "FilterBar.h"
|
||||
#include "ListModelAdapter.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
|
@ -22,6 +14,15 @@
|
|||
#include "TorrentCellRenderer.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h> // tr_formatter_speed_KBps()
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
using namespace std::string_literals;
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
class Torrent;
|
||||
|
|
|
@ -3,6 +3,23 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include "MakeDialog.h"
|
||||
|
||||
#include "PathButton.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/error.h>
|
||||
#include <libtransmission/makemeta.h>
|
||||
#include <libtransmission/utils.h> /* tr_formatter_mem_B() */
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <future>
|
||||
#include <memory>
|
||||
|
@ -10,23 +27,6 @@
|
|||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <libtransmission/error.h>
|
||||
#include <libtransmission/makemeta.h>
|
||||
#include <libtransmission/utils.h> /* tr_formatter_mem_B() */
|
||||
|
||||
#include "PathButton.h"
|
||||
#include "MakeDialog.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
#if GTKMM_CHECK_VERSION(4, 0, 0)
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -3,9 +3,16 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "MessageLogWindow.h"
|
||||
|
||||
#include "Actions.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/log.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
@ -13,15 +20,9 @@
|
|||
#include <fmt/core.h>
|
||||
#include <fmt/ostream.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/log.h>
|
||||
|
||||
#include "Actions.h"
|
||||
#include "MessageLogWindow.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
class MessageLogColumnsModel : public Gtk::TreeModelColumnRecord
|
||||
{
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -3,20 +3,21 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "Notify.h"
|
||||
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <giomm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include "Notify.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <glibmm.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
|
||||
class Session;
|
||||
|
||||
void gtr_notify_init();
|
||||
|
|
|
@ -3,24 +3,25 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/file.h> /* tr_sys_path_is_same() */
|
||||
#include "OptionsDialog.h"
|
||||
|
||||
#include "FileList.h"
|
||||
#include "FreeSpaceLabel.h"
|
||||
#include "OptionsDialog.h"
|
||||
#include "PathButton.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h" /* gtr_priority_combo_get_value() */
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/file.h> /* tr_sys_path_is_same() */
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
/****
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
typedef struct tr_ctor tr_ctor;
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <vector>
|
||||
#include "PathButton.h"
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include "PathButton.h"
|
||||
#include <vector>
|
||||
|
||||
class PathButton::Impl
|
||||
{
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include "Utils.h"
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class PathButton : public IF_GTKMM4(Gtk::Button, Gtk::FileChooserButton)
|
||||
{
|
||||
|
|
20
gtk/Prefs.cc
20
gtk/Prefs.cc
|
@ -2,20 +2,20 @@
|
|||
// It may be used under the MIT (SPDX: MIT) license.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include "Prefs.h"
|
||||
|
||||
#include "PrefsDialog.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/variant.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/variant.h>
|
||||
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Utils.h"
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <libtransmission/transmission.h> /* tr_variant, tr_session */
|
||||
#include <libtransmission/quark.h>
|
||||
|
||||
#include <cstdint> // int64_t
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <libtransmission/transmission.h> /* tr_variant, tr_session */
|
||||
#include <libtransmission/quark.h>
|
||||
|
||||
void gtr_pref_init(std::string_view config_dir);
|
||||
|
||||
int64_t gtr_pref_int_get(tr_quark const key);
|
||||
|
|
|
@ -3,28 +3,29 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "PrefsDialog.h"
|
||||
|
||||
#include "FreeSpaceLabel.h"
|
||||
#include "PathButton.h"
|
||||
#include "Prefs.h"
|
||||
#include "Session.h"
|
||||
#include "SystemTrayIcon.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/version.h>
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/version.h>
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include "FreeSpaceLabel.h"
|
||||
#include "PathButton.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "SystemTrayIcon.h"
|
||||
#include "Utils.h"
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
***
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -3,21 +3,20 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "RelocateDialog.h"
|
||||
|
||||
#include "PathButton.h"
|
||||
#include "Prefs.h" /* gtr_pref_string_get */
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include "PathButton.h"
|
||||
#include "Prefs.h" /* gtr_pref_string_get */
|
||||
#include "RelocateDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
@ -5,12 +5,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -2,10 +2,34 @@
|
|||
// This file is licensed under the MIT (SPDX: MIT) license,
|
||||
// A copy of this license can be found in licenses/ .
|
||||
|
||||
#include "Session.h"
|
||||
|
||||
#include "Actions.h"
|
||||
#include "ListModelAdapter.h"
|
||||
#include "Notify.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Torrent.h"
|
||||
#include "TorrentSorter.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#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()
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cinttypes> // PRId64
|
||||
#include <cmath> // pow()
|
||||
#include <cstring> // strstr
|
||||
#include <cinttypes> // PRId64
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
@ -14,32 +38,6 @@
|
|||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <event2/buffer.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#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/web-utils.h> // tr_urlIsValid()
|
||||
#include <libtransmission/variant.h>
|
||||
|
||||
#include "Actions.h"
|
||||
#include "ListModelAdapter.h"
|
||||
#include "Notify.h"
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Torrent.h"
|
||||
#include "TorrentSorter.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
namespace
|
||||
|
|
|
@ -4,22 +4,22 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include <giomm.h>
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <libtransmission/variant.h>
|
||||
|
||||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
#include <giomm.h>
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
class Session : public Glib::Object
|
||||
{
|
||||
|
|
|
@ -3,17 +3,18 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <memory>
|
||||
#include "StatsDialog.h"
|
||||
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "StatsDialog.h"
|
||||
#include "Utils.h"
|
||||
#include <memory>
|
||||
|
||||
static auto constexpr TR_RESPONSE_RESET = int{ 1 };
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -8,11 +8,20 @@
|
|||
// We're using deprecated Gtk::StatusItem ourselves as well
|
||||
#undef GTKMM_DISABLE_DEPRECATED
|
||||
|
||||
#include <string>
|
||||
#include "SystemTrayIcon.h"
|
||||
|
||||
#include "Actions.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef HAVE_APPINDICATOR
|
||||
#ifdef APPINDICATOR_IS_AYATANA
|
||||
#include <libayatana-appindicator/app-indicator.h>
|
||||
|
@ -21,14 +30,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include "Actions.h"
|
||||
#include "Session.h"
|
||||
#include "SystemTrayIcon.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#ifdef HAVE_APPINDICATOR
|
||||
#define TR_SYS_TRAY_IMPL_APPINDICATOR
|
||||
#elif !GTKMM_CHECK_VERSION(4, 0, 0)
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
#include <memory>
|
||||
|
||||
class Session;
|
||||
|
||||
|
|
|
@ -3,17 +3,20 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include "Torrent.h"
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include "IconCache.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
|
||||
#include "IconCache.h"
|
||||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <array>
|
||||
#include <functional>
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "Flags.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <bitset>
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include "Flags.h"
|
||||
|
||||
class Torrent : public Glib::Object
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -3,6 +3,20 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include "TorrentCellRenderer.h"
|
||||
|
||||
#include "HigWorkarea.h" // GUI_PAD, GUI_PAD_SMALL
|
||||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h> /* tr_truncd() */
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <algorithm> // std::max()
|
||||
#include <cstring> // strchr()
|
||||
#include <memory>
|
||||
|
@ -10,19 +24,6 @@
|
|||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h> /* tr_truncd() */
|
||||
|
||||
#include "HigWorkarea.h" // GUI_PAD, GUI_PAD_SMALL
|
||||
#include "Torrent.h"
|
||||
#include "TorrentCellRenderer.h"
|
||||
#include "Utils.h"
|
||||
|
||||
/* #define TEST_RTL */
|
||||
|
||||
/***
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include "Utils.h"
|
||||
#include <memory>
|
||||
|
||||
class Torrent;
|
||||
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include "Torrent.h"
|
||||
#include "TorrentFilter.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
void TorrentFilter::set_activity(Activity type)
|
||||
{
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
|
||||
class Torrent;
|
||||
#include <gtkmm.h>
|
||||
|
||||
class TorrentFilter : public IF_GTKMM4(Gtk::Filter, Glib::Object)
|
||||
{
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <algorithm>
|
||||
#include "TorrentSorter.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
|
||||
#include "Torrent.h"
|
||||
#include "TorrentSorter.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
|
|
|
@ -5,12 +5,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "Torrent.h"
|
||||
#include "Utils.h"
|
||||
|
||||
class Torrent;
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
class TorrentSorter : public IF_GTKMM4(Gtk::Sorter, Glib::Object)
|
||||
{
|
||||
|
|
37
gtk/Utils.cc
37
gtk/Utils.cc
|
@ -3,6 +3,24 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
|
||||
#include <libtransmission/transmission.h> /* TR_RATIO_NA, TR_RATIO_INF */
|
||||
#include <libtransmission/error.h>
|
||||
#include <libtransmission/torrent-metainfo.h>
|
||||
#include <libtransmission/utils.h> /* tr_strratio() */
|
||||
#include <libtransmission/version.h> /* SHORT_VERSION_STRING */
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include <giomm.h> /* g_file_trash() */
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
@ -10,30 +28,13 @@
|
|||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#include <giomm.h> /* g_file_trash() */
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#if GTK_CHECK_VERSION(4, 0, 0) && defined(GDK_WINDOWING_X11)
|
||||
#include <gdk/x11/gdkx.h>
|
||||
#endif
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h> /* TR_RATIO_NA, TR_RATIO_INF */
|
||||
|
||||
#include <libtransmission/error.h>
|
||||
#include <libtransmission/torrent-metainfo.h>
|
||||
#include <libtransmission/utils.h> /* tr_strratio() */
|
||||
#include <libtransmission/version.h> /* SHORT_VERSION_STRING */
|
||||
#include <libtransmission/web-utils.h>
|
||||
|
||||
#include "Prefs.h"
|
||||
#include "PrefsDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
/***
|
||||
|
|
18
gtk/Utils.h
18
gtk/Utils.h
|
@ -5,6 +5,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <ctime>
|
||||
#include <functional>
|
||||
|
@ -16,15 +25,6 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/tr-macros.h>
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
|
|
24
gtk/main.cc
24
gtk/main.cc
|
@ -2,10 +2,14 @@
|
|||
// It may be used under the MIT (SPDX: MIT) license.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <clocale>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include "Application.h"
|
||||
#include "Notify.h"
|
||||
#include "Prefs.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/version.h>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
@ -13,14 +17,10 @@
|
|||
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <libtransmission/transmission.h>
|
||||
#include <libtransmission/utils.h>
|
||||
#include <libtransmission/version.h>
|
||||
|
||||
#include "Application.h"
|
||||
#include "Notify.h"
|
||||
#include "Prefs.h"
|
||||
#include "Utils.h"
|
||||
#include <clocale>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
@ -1008,7 +1008,7 @@ static void on_announce_error(tr_tier* tier, char const* err, tr_announce_event
|
|||
tr_logAddWarnTier(
|
||||
tier,
|
||||
fmt::format(
|
||||
ngettext(
|
||||
tr_ngettext(
|
||||
"Announce error: {error} (Retrying in {count} second)",
|
||||
"Announce error: {error} (Retrying in {count} seconds)",
|
||||
interval),
|
||||
|
|
|
@ -63,7 +63,7 @@ void save(std::string_view filename, address_range_t const* ranges, size_t n_ran
|
|||
else
|
||||
{
|
||||
tr_logAddInfo(fmt::format(
|
||||
ngettext("Blocklist '{path}' has {count} entry", "Blocklist '{path}' has {count} entries", n_ranges),
|
||||
tr_ngettext("Blocklist '{path}' has {count} entry", "Blocklist '{path}' has {count} entries", n_ranges),
|
||||
fmt::arg("path", tr_sys_path_basename(filename)),
|
||||
fmt::arg("count", n_ranges)));
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ void Blocklist::ensureLoaded() const
|
|||
}
|
||||
|
||||
tr_logAddInfo(fmt::format(
|
||||
ngettext("Blocklist '{path}' has {count} entry", "Blocklist '{path}' has {count} entries", std::size(rules_)),
|
||||
tr_ngettext("Blocklist '{path}' has {count} entry", "Blocklist '{path}' has {count} entries", std::size(rules_)),
|
||||
fmt::arg("path", tr_sys_path_basename(bin_file_)),
|
||||
fmt::arg("count", std::size(rules_))));
|
||||
}
|
||||
|
|
|
@ -706,7 +706,7 @@ static void startServer(tr_rpc_server* server)
|
|||
}
|
||||
|
||||
tr_logAddError(fmt::format(
|
||||
ngettext(
|
||||
tr_ngettext(
|
||||
"Couldn't bind to {address} after {count} attempt, giving up",
|
||||
"Couldn't bind to {address} after {count} attempts, giving up",
|
||||
ServerStartRetryCount),
|
||||
|
|
|
@ -1324,7 +1324,7 @@ static void sessionLoadTorrents(tr_session* session, tr_ctor* ctor, std::promise
|
|||
if (n_torrents != 0U)
|
||||
{
|
||||
tr_logAddInfo(fmt::format(
|
||||
ngettext("Loaded {count} torrent", "Loaded {count} torrents", n_torrents),
|
||||
tr_ngettext("Loaded {count} torrent", "Loaded {count} torrents", n_torrents),
|
||||
fmt::arg("count", n_torrents)));
|
||||
}
|
||||
|
||||
|
|
|
@ -320,7 +320,7 @@ static void onHaveAllMetainfo(tr_torrent* tor, tr_incomplete_metadata* m)
|
|||
tr_logAddWarnTor(
|
||||
tor,
|
||||
fmt::format(
|
||||
ngettext(
|
||||
tr_ngettext(
|
||||
"Couldn't parse magnet metainfo: '{error}'. Redownloading {piece_count} piece",
|
||||
"Couldn't parse magnet metainfo: '{error}'. Redownloading {piece_count} pieces",
|
||||
n),
|
||||
|
|
|
@ -35,8 +35,10 @@ struct tr_error;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_NGETTEXT)
|
||||
#define ngettext(singular, plural, count) ((count) == 1 ? (singular) : (plural))
|
||||
#if defined(HAVE_NGETTEXT)
|
||||
#define tr_ngettext ngettext
|
||||
#else
|
||||
#define tr_ngettext(singular, plural, count) ((count) == 1 ? (singular) : (plural))
|
||||
#endif
|
||||
|
||||
/* #define DISABLE_GETTEXT */
|
||||
|
@ -47,9 +49,9 @@ struct tr_error;
|
|||
#endif
|
||||
#ifdef DISABLE_GETTEXT
|
||||
#undef _
|
||||
#undef ngettext
|
||||
#undef tr_ngettext
|
||||
#define _(a) (a)
|
||||
#define ngettext(singular, plural, count) ((count) == 1 ? (singular) : (plural))
|
||||
#define tr_ngettext(singular, plural, count) ((count) == 1 ? (singular) : (plural))
|
||||
#endif
|
||||
|
||||
/****
|
||||
|
|
|
@ -223,12 +223,15 @@ int tr_main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
fmt::print(
|
||||
ngettext("{file_count:L} file, {total_size}\n", "{file_count:L} files, {total_size}\n", builder.fileCount()),
|
||||
tr_ngettext("{file_count:L} file, {total_size}\n", "{file_count:L} files, {total_size}\n", builder.fileCount()),
|
||||
fmt::arg("file_count", builder.fileCount()),
|
||||
fmt::arg("total_size", tr_formatter_size_B(builder.totalSize())));
|
||||
|
||||
fmt::print(
|
||||
ngettext("{piece_count:L} piece, {piece_size}\n", "{piece_count:L} pieces, {piece_size} each\n", builder.pieceCount()),
|
||||
tr_ngettext(
|
||||
"{piece_count:L} piece, {piece_size}\n",
|
||||
"{piece_count:L} pieces, {piece_size} each\n",
|
||||
builder.pieceCount()),
|
||||
fmt::arg("piece_count", builder.pieceCount()),
|
||||
fmt::arg("piece_size", tr_formatter_size_B(builder.pieceSize())));
|
||||
|
||||
|
|
|
@ -137,13 +137,13 @@ static std::string tr_strltime(time_t seconds)
|
|||
|
||||
auto tmpstr = std::string{};
|
||||
|
||||
auto const hstr = fmt::format(FMT_STRING("{:d} {:s}"), hours, ngettext("hour", "hours", hours));
|
||||
auto const mstr = fmt::format(FMT_STRING("{:d} {:s}"), minutes, ngettext("minute", "minutes", minutes));
|
||||
auto const sstr = fmt::format(FMT_STRING("{:d} {:s}"), seconds, ngettext("seconds", "seconds", seconds));
|
||||
auto const hstr = fmt::format(FMT_STRING("{:d} {:s}"), hours, tr_ngettext("hour", "hours", hours));
|
||||
auto const mstr = fmt::format(FMT_STRING("{:d} {:s}"), minutes, tr_ngettext("minute", "minutes", minutes));
|
||||
auto const sstr = fmt::format(FMT_STRING("{:d} {:s}"), seconds, tr_ngettext("seconds", "seconds", seconds));
|
||||
|
||||
if (days > 0)
|
||||
{
|
||||
auto const dstr = fmt::format(FMT_STRING("{:d} {:s}"), hours, ngettext("day", "days", days));
|
||||
auto const dstr = fmt::format(FMT_STRING("{:d} {:s}"), hours, tr_ngettext("day", "days", days));
|
||||
tmpstr = days >= 4 || hours == 0 ? dstr : fmt::format(FMT_STRING("{:s}, {:s}"), dstr, hstr);
|
||||
}
|
||||
else if (hours > 0)
|
||||
|
@ -159,7 +159,7 @@ static std::string tr_strltime(time_t seconds)
|
|||
tmpstr = sstr;
|
||||
}
|
||||
|
||||
auto const totstr = fmt::format(FMT_STRING("{:d} {:s}"), total_seconds, ngettext("seconds", "seconds", total_seconds));
|
||||
auto const totstr = fmt::format(FMT_STRING("{:d} {:s}"), total_seconds, tr_ngettext("seconds", "seconds", total_seconds));
|
||||
return fmt::format(FMT_STRING("{:s} ({:s})"), tmpstr, totstr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue