mirror of
https://github.com/transmission/transmission.git
synced 2026-02-14 23:19:34 +00:00
refactor: add new transmission::app namespace (#7964)
Move `FavIconCache` into a new `transmission::app` namespace. I intend to add a couple more pieces into libtransmission to avoid code duplication between the Qt and GTK apps. We should consider making another module for these pieces if they start to pile up; but for now, let's cordon them into their own namespace.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <glibmm/main.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
|
||||
using namespace transmission::app;
|
||||
using Icon = Glib::RefPtr<Gdk::Pixbuf>;
|
||||
|
||||
template<>
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include <utility>
|
||||
|
||||
using namespace std::literals;
|
||||
using namespace transmission::app;
|
||||
|
||||
class Session::Impl
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
tr_torrent* find_torrent(tr_torrent_id_t id) const;
|
||||
|
||||
FaviconCache<Glib::RefPtr<Gdk::Pixbuf>>& favicon_cache() const;
|
||||
transmission::app::FaviconCache<Glib::RefPtr<Gdk::Pixbuf>>& favicon_cache() const;
|
||||
|
||||
/******
|
||||
*******
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include <libtransmission/web-utils.h>
|
||||
#include <libtransmission/web.h>
|
||||
|
||||
namespace transmission::app
|
||||
{
|
||||
|
||||
template<typename Icon>
|
||||
class FaviconCache
|
||||
{
|
||||
@@ -245,3 +248,5 @@ private:
|
||||
|
||||
std::map<std::string /*sitename*/, Icon, std::less<>> icons_;
|
||||
};
|
||||
|
||||
} // namespace transmission::app
|
||||
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
QTranslator qt_translator_;
|
||||
QTranslator app_translator_;
|
||||
|
||||
FaviconCache<QPixmap> favicon_cache_;
|
||||
transmission::app::FaviconCache<QPixmap> favicon_cache_;
|
||||
};
|
||||
|
||||
#define trApp dynamic_cast<Application*>(Application::instance())
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <QPixmap>
|
||||
#include <QStandardPaths>
|
||||
|
||||
using namespace transmission::app;
|
||||
using Icon = QPixmap;
|
||||
|
||||
template<>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "TrackerModel.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace transmission::app;
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
|
||||
Reference in New Issue
Block a user