Skip to content

Commit

Permalink
Merge pull request picotorrent#1156 from markmdscott/master
Browse files Browse the repository at this point in the history
Ensure PicoTorrent is compliant with both VS 2017 and VS 2019 by fully qualifying C++ namespace references
  • Loading branch information
vktr authored May 7, 2021
2 parents 4f17bec + 5a5f5d2 commit d5c6fb4
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/picotorrent/api/libpico.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ IPlugin::~IPlugin()
{
}

IPlugin* IPlugin::Load(fs::path const& p, Core::Environment* env, Core::Configuration* cfg)
IPlugin* IPlugin::Load(fs::path const& p, pt::Core::Environment* env, pt::Core::Configuration* cfg)
{
return new Plugin(
LoadLibrary(p.wstring().c_str()),
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/bittorrent/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ void Session::UpdateMetadataHandle(lt::info_hash_t hash, lt::torrent_handle hand
}
}

void Session::UpdateTorrentLabel(TorrentHandle* torrent)
void Session::UpdateTorrentLabel(pt::BitTorrent::TorrentHandle* torrent)
{
int labelId = torrent->Label();

Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/persistencemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using json = nlohmann::json;
using pt::PersistenceManager;

PersistenceManager::PersistenceManager(std::shared_ptr<Core::Database> db)
PersistenceManager::PersistenceManager(std::shared_ptr<pt::Core::Database> db)
: m_db(db)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using pt::UI::Console;

wxDEFINE_EVENT(ptEVT_FILTER_CHANGED, wxCommandEvent);

Console::Console(wxWindow* parent, wxWindowID id, Models::TorrentListModel* model)
Console::Console(wxWindow* parent, wxWindowID id, pt::UI::Models::TorrentListModel* model)
: wxPanel(parent, id),
m_input(new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT | wxTE_PROCESS_ENTER)),
m_model(model)
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/dialogs/addtorrentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

using pt::UI::Dialogs::AddTorrentDialog;

AddTorrentDialog::AddTorrentDialog(wxWindow* parent, wxWindowID id, lt::add_torrent_params& params, std::shared_ptr<Core::Database> db, std::shared_ptr<Core::Configuration> cfg, std::shared_ptr<BitTorrent::Session> session)
AddTorrentDialog::AddTorrentDialog(wxWindow* parent, wxWindowID id, lt::add_torrent_params& params, std::shared_ptr<pt::Core::Database> db, std::shared_ptr<pt::Core::Configuration> cfg, std::shared_ptr<pt::BitTorrent::Session> session)
: wxDialog(parent, id, GetTorrentDisplayName(params), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
m_params(params),
m_db(db),
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/dialogs/preferencesadvancedpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static std::map<std::string, std::map<std::string, Property>> properties =
}
};

PreferencesAdvancedPage::PreferencesAdvancedPage(wxWindow* parent, std::shared_ptr<Core::Configuration> cfg)
PreferencesAdvancedPage::PreferencesAdvancedPage(wxWindow* parent, std::shared_ptr<pt::Core::Configuration> cfg)
: wxPanel(parent),
m_cfg(cfg)
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/dialogs/preferencesconnectionpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct Item

using pt::UI::Dialogs::PreferencesConnectionPage;

PreferencesConnectionPage::PreferencesConnectionPage(wxWindow* parent, std::shared_ptr<Core::Configuration> cfg)
PreferencesConnectionPage::PreferencesConnectionPage(wxWindow* parent, std::shared_ptr<pt::Core::Configuration> cfg)
: wxPanel(parent, wxID_ANY),
m_parent(parent),
m_cfg(cfg)
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/dialogs/preferencesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

using pt::UI::Dialogs::PreferencesDialog;

PreferencesDialog::PreferencesDialog(wxWindow* parent, std::shared_ptr<Core::Configuration> cfg)
PreferencesDialog::PreferencesDialog(wxWindow* parent, std::shared_ptr<pt::Core::Configuration> cfg)
: wxDialog(parent, wxID_ANY, i18n("preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
m_book(new wxSimplebook(this, wxID_ANY)),
m_general(new PreferencesGeneralPage(m_book, cfg)),
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/dialogs/preferencesdownloadspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using pt::UI::Dialogs::PreferencesDownloadsPage;

PreferencesDownloadsPage::PreferencesDownloadsPage(wxWindow* parent, std::shared_ptr<Core::Configuration> cfg)
PreferencesDownloadsPage::PreferencesDownloadsPage(wxWindow* parent, std::shared_ptr<pt::Core::Configuration> cfg)
: wxPanel(parent, wxID_ANY),
m_cfg(cfg)
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/dialogs/preferencesgeneralpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct AutoRunKey
using pt::Core::Configuration;
using pt::UI::Dialogs::PreferencesGeneralPage;

PreferencesGeneralPage::PreferencesGeneralPage(wxWindow* parent, std::shared_ptr<Core::Configuration> cfg)
PreferencesGeneralPage::PreferencesGeneralPage(wxWindow* parent, std::shared_ptr<pt::Core::Configuration> cfg)
: wxPanel(parent),
m_cfg(cfg)
{
Expand Down
4 changes: 2 additions & 2 deletions src/picotorrent/ui/filters/pqltorrentfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class FilterVisitor : public pt::PQL::QueryBaseVisitor
}
};

PqlTorrentFilter::PqlTorrentFilter(std::function<bool(BitTorrent::TorrentStatus const&)> const& filter)
PqlTorrentFilter::PqlTorrentFilter(std::function<bool(pt::BitTorrent::TorrentStatus const&)> const& filter)
: m_filter(filter)
{
}
Expand Down Expand Up @@ -416,7 +416,7 @@ std::unique_ptr<pt::UI::Filters::TorrentFilter> PqlTorrentFilter::Create(std::st
return nullptr;
}

bool PqlTorrentFilter::Includes(BitTorrent::TorrentHandle const& torrent)
bool PqlTorrentFilter::Includes(pt::BitTorrent::TorrentHandle const& torrent)
{
TorrentStatus ts = torrent.Status();
return m_filter(ts);
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/mainframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const char* WindowTitle = "PicoTorrent";

#define LABEL_ICON_SIZE 16

MainFrame::MainFrame(std::shared_ptr<Core::Environment> env, std::shared_ptr<Core::Database> db, std::shared_ptr<Core::Configuration> cfg, pt::CommandLineOptions const& options)
MainFrame::MainFrame(std::shared_ptr<pt::Core::Environment> env, std::shared_ptr<pt::Core::Database> db, std::shared_ptr<pt::Core::Configuration> cfg, pt::CommandLineOptions const& options)
: wxFrame(nullptr, wxID_ANY, WindowTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, "MainFrame"),
m_env(env),
m_db(db),
Expand Down
6 changes: 3 additions & 3 deletions src/picotorrent/ui/models/torrentlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TorrentListModel::~TorrentListModel()
{
}

void TorrentListModel::AddTorrent(BitTorrent::TorrentHandle* torrent)
void TorrentListModel::AddTorrent(pt::BitTorrent::TorrentHandle* torrent)
{
m_torrents.insert({ torrent->InfoHash(), torrent });
ApplyFilter();
Expand All @@ -41,7 +41,7 @@ void TorrentListModel::ClearLabelFilter()
ApplyFilter();
}

void TorrentListModel::SetFilter(std::unique_ptr<Filters::TorrentFilter> filter)
void TorrentListModel::SetFilter(std::unique_ptr<pt::UI::Filters::TorrentFilter> filter)
{
m_filter = std::move(filter);
ApplyFilter();
Expand Down Expand Up @@ -640,7 +640,7 @@ void TorrentListModel::ApplyFilter()
ApplyFilter(filter);
}

void TorrentListModel::ApplyFilter(std::vector<BitTorrent::TorrentHandle*> torrents)
void TorrentListModel::ApplyFilter(std::vector<pt::BitTorrent::TorrentHandle*> torrents)
{
const std::function<bool(TorrentHandle*)> show = [this](TorrentHandle* torrent)
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/models/trackerlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void TrackerListModel::ResetTrackers()
this->Cleared();
}

void TrackerListModel::Update(BitTorrent::TorrentHandle* torrent)
void TrackerListModel::Update(pt::BitTorrent::TorrentHandle* torrent)
{
if (m_dht == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/torrentcontextmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace fs = std::filesystem;
using pt::UI::TorrentContextMenu;

TorrentContextMenu::TorrentContextMenu(wxWindow* parent, std::shared_ptr<Core::Configuration> cfg, std::vector<BitTorrent::TorrentHandle*> const& selectedTorrents)
TorrentContextMenu::TorrentContextMenu(wxWindow* parent, std::shared_ptr<pt::Core::Configuration> cfg, std::vector<pt::BitTorrent::TorrentHandle*> const& selectedTorrents)
: wxMenu(),
m_parent(parent)
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/torrentdetailsfilespanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TorrentDetailsFilesPanel::TorrentDetailsFilesPanel(wxWindow* parent, wxWindowID
this->Bind(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, &TorrentDetailsFilesPanel::ShowFileContextMenu, this, wxID_ANY);
}

void TorrentDetailsFilesPanel::Refresh(BitTorrent::TorrentHandle* torrent)
void TorrentDetailsFilesPanel::Refresh(pt::BitTorrent::TorrentHandle* torrent)
{
if (!torrent->IsValid())
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/torrentdetailsoverviewpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ TorrentDetailsOverviewPanel::TorrentDetailsOverviewPanel(wxWindow* parent, wxWin
this->SetScrollRate(5, 5);
}

void TorrentDetailsOverviewPanel::Refresh(BitTorrent::TorrentHandle* torrent)
void TorrentDetailsOverviewPanel::Refresh(pt::BitTorrent::TorrentHandle* torrent)
{
auto status = torrent->Status();

Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/torrentdetailspeerspanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TorrentDetailsPeersPanel::TorrentDetailsPeersPanel(wxWindow* parent, wxWindowID
this->SetSizerAndFit(mainSizer);
}

void TorrentDetailsPeersPanel::Refresh(BitTorrent::TorrentHandle* torrent)
void TorrentDetailsPeersPanel::Refresh(pt::BitTorrent::TorrentHandle* torrent)
{
if (!torrent->IsValid())
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/torrentdetailstrackerspanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TorrentDetailsTrackersPanel::TorrentDetailsTrackersPanel(wxWindow* parent, wxWin
this->Bind(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, &TorrentDetailsTrackersPanel::ShowTrackerContextMenu, this);
}

void TorrentDetailsTrackersPanel::Refresh(BitTorrent::TorrentHandle* torrent)
void TorrentDetailsTrackersPanel::Refresh(pt::BitTorrent::TorrentHandle* torrent)
{
if (!torrent->IsValid())
{
Expand Down
4 changes: 2 additions & 2 deletions src/picotorrent/ui/torrentdetailsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

using pt::UI::TorrentDetailsView;

TorrentDetailsView::TorrentDetailsView(wxWindow* parent, wxWindowID id, std::shared_ptr<Core::Configuration> cfg)
TorrentDetailsView::TorrentDetailsView(wxWindow* parent, wxWindowID id, std::shared_ptr<pt::Core::Configuration> cfg)
: wxNotebook(parent, id),
m_cfg(cfg),
m_overview(new TorrentDetailsOverviewPanel(this, wxID_ANY)),
Expand All @@ -31,7 +31,7 @@ TorrentDetailsView::~TorrentDetailsView()
{
}

void TorrentDetailsView::Refresh(std::map<lt::info_hash_t, BitTorrent::TorrentHandle*> const& torrents)
void TorrentDetailsView::Refresh(std::map<lt::info_hash_t, pt::BitTorrent::TorrentHandle*> const& torrents)
{
if (torrents.size() != 1)
{
Expand Down
2 changes: 1 addition & 1 deletion src/picotorrent/ui/torrentlistview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using pt::UI::TorrentListView;
using pt::UI::Models::TorrentListModel;

TorrentListView::TorrentListView(wxWindow* parent, wxWindowID id, Models::TorrentListModel* model)
TorrentListView::TorrentListView(wxWindow* parent, wxWindowID id, pt::UI::Models::TorrentListModel* model)
: wxDataViewCtrl(parent, id, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE, wxDefaultValidator, "TorrentListView"),
m_model(model)
{
Expand Down

0 comments on commit d5c6fb4

Please sign in to comment.