diff --git a/gtk/util.c b/gtk/util.c index 42c97602b..1efc8064c 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -583,19 +583,6 @@ void gtr_dialog_set_content(GtkDialog* dialog, GtkWidget* content) **** ***/ -void gtr_http_failure_dialog(GtkWidget* parent, char const* url, long response_code) -{ - GtkWindow* window = getWindow(parent); - - GtkWidget* w = gtk_message_dialog_new(window, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("Error opening \"%s\""), url); - - gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(w), _("Server returned \"%1$ld %2$s\""), response_code, - tr_webGetResponseStr(response_code)); - - g_signal_connect_swapped(w, "response", G_CALLBACK(gtk_widget_destroy), w); - gtk_widget_show(w); -} - void gtr_unrecognized_url_dialog(GtkWidget* parent, char const* url) { char const* xt = "xt=urn:btih"; diff --git a/gtk/util.h b/gtk/util.h index ba0383a63..55f3c0df9 100644 --- a/gtk/util.h +++ b/gtk/util.h @@ -133,8 +133,6 @@ void gtr_freespace_label_set_dir(GtkWidget* label, char const* dir); void gtr_unrecognized_url_dialog(GtkWidget* parent, char const* url); -void gtr_http_failure_dialog(GtkWidget* parent, char const* url, long response_code); - void gtr_add_torrent_error_dialog(GtkWidget* window_or_child, int err, tr_torrent* duplicate_torrent, char const* filename); /* pop up the context menu if a user right-clicks. diff --git a/libtransmission/announcer.c b/libtransmission/announcer.c index f02b56962..1df0299f4 100644 --- a/libtransmission/announcer.c +++ b/libtransmission/announcer.c @@ -204,11 +204,6 @@ static struct tr_scrape_info* tr_announcerGetScrapeInfo(struct tr_announcer* ann return info; } -bool tr_announcerHasBacklog(struct tr_announcer const* announcer) -{ - return announcer->slotsAvailable < 1; -} - static void onUpkeepTimer(evutil_socket_t foo UNUSED, short bar UNUSED, void* vannouncer); void tr_announcerInit(tr_session* session) diff --git a/libtransmission/announcer.h b/libtransmission/announcer.h index 4df805663..72a69b86d 100644 --- a/libtransmission/announcer.h +++ b/libtransmission/announcer.h @@ -67,8 +67,6 @@ void tr_announcerClose(tr_session*); struct tr_torrent_tiers* tr_announcerAddTorrent(tr_torrent* torrent, tr_tracker_callback cb, void* cbdata); -bool tr_announcerHasBacklog(struct tr_announcer const*); - void tr_announcerResetTorrent(struct tr_announcer*, tr_torrent*); void tr_announcerRemoveTorrent(struct tr_announcer*, tr_torrent*); diff --git a/libtransmission/error.c b/libtransmission/error.c index 4331a985d..c28abe0f3 100644 --- a/libtransmission/error.c +++ b/libtransmission/error.c @@ -11,20 +11,6 @@ #include "tr-assert.h" #include "utils.h" -tr_error* tr_error_new(int code, char const* message_format, ...) -{ - TR_ASSERT(message_format != NULL); - - tr_error* error; - va_list args; - - va_start(args, message_format); - error = tr_error_new_valist(code, message_format, args); - va_end(args); - - return error; -} - tr_error* tr_error_new_literal(int code, char const* message) { TR_ASSERT(message != NULL); diff --git a/libtransmission/error.h b/libtransmission/error.h index 5a8b3dbdf..0e96f06bc 100644 --- a/libtransmission/error.h +++ b/libtransmission/error.h @@ -32,17 +32,6 @@ typedef struct tr_error } tr_error; -/** - * @brief Create new error object using `printf`-style formatting. - * - * @param[in] code Error code (platform-specific). - * @param[in] message_format Error message format string. - * @param[in] ... Format arguments. - * - * @return Newly allocated error object on success, `NULL` otherwise. - */ -tr_error* tr_error_new(int code, char const* message_format, ...) TR_GNUC_PRINTF(2, 3); - /** * @brief Create new error object using literal error message. * diff --git a/libtransmission/handshake.c b/libtransmission/handshake.c index c1c4654c8..bab0e2d28 100644 --- a/libtransmission/handshake.c +++ b/libtransmission/handshake.c @@ -81,12 +81,6 @@ enum #define HANDSHAKE_SET_DHT(bits) ((void)0) #endif -/* http://www.azureuswiki.com/index.php/Extension_negotiation_protocol - these macros are to be used if both extended messaging and the - azureus protocol is supported, they indicate which protocol is preferred */ -#define HANDSHAKE_GET_EXTPREF(reserved) ((reserved)[5] & 0x03) -#define HANDSHAKE_SET_EXTPREF(reserved, val) ((reserved)[5] |= 0x03 & (val)) - /** *** **/ @@ -1252,14 +1246,6 @@ tr_handshake* tr_handshakeNew(tr_peerIo* io, tr_encryption_mode encryptionMode, return handshake; } -struct tr_peerIo* tr_handshakeGetIO(tr_handshake* handshake) -{ - TR_ASSERT(handshake != NULL); - TR_ASSERT(handshake->io != NULL); - - return handshake->io; -} - struct tr_peerIo* tr_handshakeStealIO(tr_handshake* handshake) { TR_ASSERT(handshake != NULL); diff --git a/libtransmission/handshake.h b/libtransmission/handshake.h index 593e3c489..5a2aef601 100644 --- a/libtransmission/handshake.h +++ b/libtransmission/handshake.h @@ -36,8 +36,6 @@ tr_address const* tr_handshakeGetAddr(struct tr_handshake const* handshake, tr_p void tr_handshakeAbort(tr_handshake* handshake); -struct tr_peerIo* tr_handshakeGetIO(tr_handshake* handshake); - struct tr_peerIo* tr_handshakeStealIO(tr_handshake* handshake); /** @} */ diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index b617ecf5d..d1239cc16 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -2204,19 +2204,6 @@ void tr_peerMgrAddPex(tr_torrent* tor, uint8_t from, tr_pex const* pex, int8_t s } } -void tr_peerMgrMarkAllAsSeeds(tr_torrent* tor) -{ - tr_swarm* s = tor->swarm; - int const n = tr_ptrArraySize(&s->pool); - struct peer_atom** it = (struct peer_atom**)tr_ptrArrayBase(&s->pool); - struct peer_atom** end = it + n; - - while (it != end) - { - atomSetSeed(s, *it++); - } -} - tr_pex* tr_peerMgrCompactToPex(void const* compact, size_t compactLen, uint8_t const* added_f, size_t added_f_len, size_t* pexCount) { @@ -2267,24 +2254,6 @@ tr_pex* tr_peerMgrCompact6ToPex(void const* compact, size_t compactLen, uint8_t return pex; } -tr_pex* tr_peerMgrArrayToPex(void const* array, size_t arrayLen, size_t* pexCount) -{ - size_t n = arrayLen / (sizeof(tr_address) + 2); - uint8_t const* walk = array; - tr_pex* pex = tr_new0(tr_pex, n); - - for (size_t i = 0; i < n; ++i) - { - memcpy(&pex[i].addr, walk, sizeof(tr_address)); - memcpy(&pex[i].port, walk + sizeof(tr_address), 2); - pex[i].flags = 0x00; - walk += sizeof(tr_address) + 2; - } - - *pexCount = n; - return pex; -} - /** *** **/ diff --git a/libtransmission/peer-mgr.h b/libtransmission/peer-mgr.h index 5191e966d..2dd414a97 100644 --- a/libtransmission/peer-mgr.h +++ b/libtransmission/peer-mgr.h @@ -95,15 +95,11 @@ tr_pex* tr_peerMgrCompactToPex(void const* compact, size_t compactLen, uint8_t c tr_pex* tr_peerMgrCompact6ToPex(void const* compact, size_t compactLen, uint8_t const* added_f, size_t added_f_len, size_t* pexCount); -tr_pex* tr_peerMgrArrayToPex(void const* array, size_t arrayLen, size_t* setme_pex_count); - /** * @param seedProbability [0..100] for likelihood that the peer is a seed; -1 for unknown */ void tr_peerMgrAddPex(tr_torrent* tor, uint8_t from, tr_pex const* pex, int8_t seedProbability); -void tr_peerMgrMarkAllAsSeeds(tr_torrent* tor); - enum { TR_PEERS_CONNECTED, diff --git a/libtransmission/session.c b/libtransmission/session.c index 94faf446d..398ce7d76 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -1782,11 +1782,6 @@ void tr_sessionSetAltSpeedFunc(tr_session* session, tr_altSpeedFunc func, void* session->turtle.callbackUserData = userData; } -void tr_sessionClearAltSpeedFunc(tr_session* session) -{ - tr_sessionSetAltSpeedFunc(session, NULL, NULL); -} - /*** **** ***/ diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 33e880c0f..c34e1d6df 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -566,7 +566,6 @@ tr_sched_day tr_sessionGetAltSpeedDay(tr_session const*); typedef void (* tr_altSpeedFunc)(tr_session*, bool active, bool userDriven, void*); -void tr_sessionClearAltSpeedFunc(tr_session*); void tr_sessionSetAltSpeedFunc(tr_session*, tr_altSpeedFunc, void*); bool tr_sessionGetActiveSpeedLimit_KBps(tr_session const* session, tr_direction dir, double* setme); diff --git a/qt/FaviconCache.cc b/qt/FaviconCache.cc index 42d7e514c..cad9c496d 100644 --- a/qt/FaviconCache.cc +++ b/qt/FaviconCache.cc @@ -79,11 +79,6 @@ void FaviconCache::ensureCacheDirHasBeenScanned() **** ***/ -QString FaviconCache::getDisplayName(QUrl const& url) -{ - return getDisplayName(getKey(url)); -} - QString FaviconCache::getDisplayName(QString const& key) { auto name = key; diff --git a/qt/FaviconCache.h b/qt/FaviconCache.h index 3ce0618b5..6e3e1e4b5 100644 --- a/qt/FaviconCache.h +++ b/qt/FaviconCache.h @@ -36,7 +36,6 @@ public: // Returns the key. QString add(QUrl const& url); - static QString getDisplayName(QUrl const& url); static QString getDisplayName(QString const& key); static QString getKey(QUrl const& url); static QString getKey(QString const& displayName); diff --git a/qt/FilterBarComboBox.cc b/qt/FilterBarComboBox.cc index c07fa71a3..81a7a1473 100644 --- a/qt/FilterBarComboBox.cc +++ b/qt/FilterBarComboBox.cc @@ -30,20 +30,6 @@ FilterBarComboBox::FilterBarComboBox(QWidget* parent) : setSizeAdjustPolicy(QComboBox::AdjustToContents); } -int FilterBarComboBox::currentCount() const -{ - int count = 0; - - QModelIndex const modelIndex = model()->index(currentIndex(), 0, rootModelIndex()); - - if (modelIndex.isValid()) - { - count = modelIndex.data(CountRole).toInt(); - } - - return count; -} - QSize FilterBarComboBox::minimumSizeHint() const { QFontMetrics fm(fontMetrics()); diff --git a/qt/FilterBarComboBox.h b/qt/FilterBarComboBox.h index 514c2df49..f3d47dbf1 100644 --- a/qt/FilterBarComboBox.h +++ b/qt/FilterBarComboBox.h @@ -25,8 +25,6 @@ public: public: FilterBarComboBox(QWidget* parent = nullptr); - int currentCount() const; - // QWidget QSize minimumSizeHint() const override; QSize sizeHint() const override; diff --git a/qt/RpcQueue.cc b/qt/RpcQueue.cc index c33f2e3af..6e4b9d1c1 100644 --- a/qt/RpcQueue.cc +++ b/qt/RpcQueue.cc @@ -17,11 +17,6 @@ RpcQueue::RpcQueue(QObject* parent) : connect(&myFutureWatcher, SIGNAL(finished()), SLOT(stepFinished())); } -RpcResponseFuture RpcQueue::future() -{ - return myPromise.future(); -} - void RpcQueue::stepFinished() { RpcResponse result; diff --git a/qt/RpcQueue.h b/qt/RpcQueue.h index 098d9f62d..6976d0459 100644 --- a/qt/RpcQueue.h +++ b/qt/RpcQueue.h @@ -43,8 +43,6 @@ public: myQueue.enqueue(qMakePair(normalizeFunc(func), normalizeErrorHandler(errorHandler))); } - RpcResponseFuture future(); - // The first function in queue is ran synchronously // (hence it may be e. g. a lambda capturing local variables by reference). void run(); diff --git a/qt/Torrent.cc b/qt/Torrent.cc index 833485697..99c599f89 100644 --- a/qt/Torrent.cc +++ b/qt/Torrent.cc @@ -407,19 +407,6 @@ bool Torrent::getSeedRatio(double& ratio) const return isLimited; } -bool Torrent::hasFileSubstring(QString const& substr) const -{ - for (TorrentFile const& file : myFiles) - { - if (file.filename.contains(substr, Qt::CaseInsensitive)) - { - return true; - } - } - - return false; -} - bool Torrent::hasTrackerSubstring(QString const& substr) const { for (auto const& s : trackers()) @@ -519,14 +506,6 @@ int Torrent::compareETA(Torrent const& that) const return 0; } -int Torrent::compareTracker(Torrent const& that) const -{ - Q_UNUSED(that) - - // FIXME - return 0; -} - /*** **** ***/ diff --git a/qt/Torrent.h b/qt/Torrent.h index cefe9ad66..a3fd39b82 100644 --- a/qt/Torrent.h +++ b/qt/Torrent.h @@ -342,7 +342,6 @@ public: return getSize(FAILED_EVER); } - int compareTracker(Torrent const&) const; int compareSeedRatio(Torrent const&) const; int compareRatio(Torrent const&) const; int compareETA(Torrent const&) const; @@ -432,7 +431,6 @@ public: return getDouble(PERCENT_VERIFIED); } - bool hasFileSubstring(QString const& substr) const; bool hasTrackerSubstring(QString const& substr) const; Speed uploadLimit() const diff --git a/qt/TorrentFilter.cc b/qt/TorrentFilter.cc index b3a2f0389..acb54e3e3 100644 --- a/qt/TorrentFilter.cc +++ b/qt/TorrentFilter.cc @@ -313,11 +313,6 @@ bool TorrentFilter::filterAcceptsRow(int sourceRow, QModelIndex const& sourcePar return accepts; } -int TorrentFilter::hiddenRowCount() const -{ - return sourceModel()->rowCount() - rowCount(); -} - void TorrentFilter::countTorrentsPerMode(int* setmeCounts) const { std::fill_n(setmeCounts, static_cast(FilterMode::NUM_MODES), 0); diff --git a/qt/TorrentFilter.h b/qt/TorrentFilter.h index b1ad4961b..5eecea466 100644 --- a/qt/TorrentFilter.h +++ b/qt/TorrentFilter.h @@ -33,8 +33,6 @@ public: TorrentFilter(Prefs const& prefs); virtual ~TorrentFilter(); - int hiddenRowCount() const; - void countTorrentsPerMode(int* setmeCounts) const; protected: diff --git a/qt/TorrentModel.cc b/qt/TorrentModel.cc index c01fc5472..6a3ae39f7 100644 --- a/qt/TorrentModel.cc +++ b/qt/TorrentModel.cc @@ -349,11 +349,6 @@ std::optional TorrentModel::getRow(int id) const return row; } -std::optional TorrentModel::getRow(Torrent const* tor) const -{ - return getRow(tor->id()); -} - Torrent* TorrentModel::getTorrentFromId(int id) { auto const row = getRow(id); diff --git a/qt/TorrentModel.h b/qt/TorrentModel.h index 1a4c57e02..d910a9240 100644 --- a/qt/TorrentModel.h +++ b/qt/TorrentModel.h @@ -68,7 +68,6 @@ private: void rowsEmitChanged(torrent_ids_t const& ids); std::optional getRow(int id) const; - std::optional getRow(Torrent const* tor) const; using span_t = std::pair; std::vector getSpans(torrent_ids_t const& ids) const; diff --git a/qt/TrackerDelegate.cc b/qt/TrackerDelegate.cc index 873cd8a1c..b36d72dbc 100644 --- a/qt/TrackerDelegate.cc +++ b/qt/TrackerDelegate.cc @@ -86,13 +86,6 @@ ItemLayout::ItemLayout(QString const& text, bool suppressColors, Qt::LayoutDirec } // namespace -QSize TrackerDelegate::margin(QStyle const& style) const -{ - Q_UNUSED(style) - - return myMargin; -} - /*** **** ***/ diff --git a/qt/TrackerDelegate.h b/qt/TrackerDelegate.h index ebdb1789e..a4ab054f0 100644 --- a/qt/TrackerDelegate.h +++ b/qt/TrackerDelegate.h @@ -34,7 +34,6 @@ public: protected: QString getText(TrackerInfo const&) const; - QSize margin(QStyle const& style) const; QSize sizeHint(QStyleOptionViewItem const&, TrackerInfo const&) const; void drawTracker(QPainter*, QStyleOptionViewItem const&, TrackerInfo const&) const;