mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
add missing namespaces
This commit is contained in:
parent
39c88ea247
commit
b3dddeafdf
@ -1584,12 +1584,16 @@ bool p3PeerMgrIMPL::setDynDNS(const RsPeerId &id, const std::string &dyndns)
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace pqi {
|
||||||
|
|
||||||
struct ZeroedInt
|
struct ZeroedInt
|
||||||
{
|
{
|
||||||
ZeroedInt() { n=0 ;}
|
ZeroedInt() { n=0 ;}
|
||||||
int n ;
|
int n ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, const sockaddr_storage &addr)
|
bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, const sockaddr_storage &addr)
|
||||||
{
|
{
|
||||||
// The algorithm is the following:
|
// The algorithm is the following:
|
||||||
@ -1673,7 +1677,7 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons
|
|||||||
|
|
||||||
bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_storage& addr, uint32_t& count)
|
bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_storage& addr, uint32_t& count)
|
||||||
{
|
{
|
||||||
std::map<sockaddr_storage,ZeroedInt> addr_counts ;
|
std::map<sockaddr_storage, pqi::ZeroedInt> addr_counts ;
|
||||||
|
|
||||||
for(std::map<RsPeerId,sockaddr_storage>::iterator it(mReportedOwnAddresses.begin());it!=mReportedOwnAddresses.end();++it)
|
for(std::map<RsPeerId,sockaddr_storage>::iterator it(mReportedOwnAddresses.begin());it!=mReportedOwnAddresses.end();++it)
|
||||||
++addr_counts[it->second].n ;
|
++addr_counts[it->second].n ;
|
||||||
@ -1684,7 +1688,7 @@ bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_sto
|
|||||||
|
|
||||||
count = 0 ;
|
count = 0 ;
|
||||||
|
|
||||||
for(std::map<sockaddr_storage,ZeroedInt>::const_iterator it(addr_counts.begin());it!=addr_counts.end();++it)
|
for(std::map<sockaddr_storage, pqi::ZeroedInt>::const_iterator it(addr_counts.begin());it!=addr_counts.end();++it)
|
||||||
{
|
{
|
||||||
if(uint32_t(it->second.n) > count)
|
if(uint32_t(it->second.n) > count)
|
||||||
{
|
{
|
||||||
|
@ -113,6 +113,8 @@ void p3BanList::setAutoRangeLimit(int n)
|
|||||||
IndicateConfigChanged();
|
IndicateConfigChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace services {
|
||||||
|
|
||||||
class ZeroedInt
|
class ZeroedInt
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -120,6 +122,8 @@ class ZeroedInt
|
|||||||
uint32_t n ;
|
uint32_t n ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
BanListPeer::BanListPeer()
|
BanListPeer::BanListPeer()
|
||||||
{
|
{
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
@ -220,14 +224,14 @@ void p3BanList::autoFigureOutBanRanges()
|
|||||||
std::cerr << "Automatically figuring out IP ranges from banned IPs." << std::endl;
|
std::cerr << "Automatically figuring out IP ranges from banned IPs." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::map<sockaddr_storage,ZeroedInt> range_map ;
|
std::map<sockaddr_storage, services::ZeroedInt> range_map ;
|
||||||
|
|
||||||
for(std::map<sockaddr_storage,BanListPeer>::iterator it(mBanSet.begin());it!=mBanSet.end();++it)
|
for(std::map<sockaddr_storage,BanListPeer>::iterator it(mBanSet.begin());it!=mBanSet.end();++it)
|
||||||
++range_map[makeBitsRange(it->first,1)].n ;
|
++range_map[makeBitsRange(it->first,1)].n ;
|
||||||
|
|
||||||
time_t now = time(NULL) ;
|
time_t now = time(NULL) ;
|
||||||
|
|
||||||
for(std::map<sockaddr_storage,ZeroedInt>::const_iterator it=range_map.begin();it!=range_map.end();++it)
|
for(std::map<sockaddr_storage, services::ZeroedInt>::const_iterator it=range_map.begin();it!=range_map.end();++it)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_BANLIST
|
#ifdef DEBUG_BANLIST
|
||||||
std::cerr << "Ban range: " << sockaddr_storage_iptostring(it->first) << " : " << it->second.n << std::endl;
|
std::cerr << "Ban range: " << sockaddr_storage_iptostring(it->first) << " : " << it->second.n << std::endl;
|
||||||
|
@ -433,7 +433,7 @@ void MainWindow::initStackedPage()
|
|||||||
|
|
||||||
#ifndef RS_RELEASE_VERSION
|
#ifndef RS_RELEASE_VERSION
|
||||||
#ifdef PLUGINMGR
|
#ifdef PLUGINMGR
|
||||||
addPage(pluginsPage = new PluginsPage(ui->stackPages), grp, NULL);
|
addPage(pluginsPage = new gui::PluginsPage(ui->stackPages), grp, NULL);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ class QScriptEngine;
|
|||||||
|
|
||||||
class PluginManager;
|
class PluginManager;
|
||||||
|
|
||||||
|
namespace gui {
|
||||||
|
|
||||||
|
|
||||||
//! A demo widget for showing plugin engine in action :)
|
//! A demo widget for showing plugin engine in action :)
|
||||||
|
|
||||||
@ -82,5 +84,7 @@ protected:
|
|||||||
PluginManager* pluginManager;
|
PluginManager* pluginManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace gui
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "../MainWindow.h"
|
#include "../MainWindow.h"
|
||||||
|
|
||||||
PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
|
settings::PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
|
||||||
: ConfigPage(parent, flags)
|
: ConfigPage(parent, flags)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
@ -159,7 +159,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
|
|||||||
|
|
||||||
QObject::connect(ui.enableAll,SIGNAL(toggled(bool)),this,SLOT(toggleEnableAll(bool))) ;
|
QObject::connect(ui.enableAll,SIGNAL(toggled(bool)),this,SLOT(toggleEnableAll(bool))) ;
|
||||||
}
|
}
|
||||||
QString PluginsPage::helpText() const
|
QString settings::PluginsPage::helpText() const
|
||||||
{
|
{
|
||||||
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\"> Plugins</h1> \
|
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\"> Plugins</h1> \
|
||||||
<p>Plugins are loaded from the directories listed in the bottom list.</p> \
|
<p>Plugins are loaded from the directories listed in the bottom list.</p> \
|
||||||
@ -171,11 +171,11 @@ QString PluginsPage::helpText() const
|
|||||||
<p>If you want to develop your own plugins, contact the developpers team \
|
<p>If you want to develop your own plugins, contact the developpers team \
|
||||||
they will be happy to help you out!</p>") ;
|
they will be happy to help you out!</p>") ;
|
||||||
}
|
}
|
||||||
void PluginsPage::toggleEnableAll(bool b)
|
void settings::PluginsPage::toggleEnableAll(bool b)
|
||||||
{
|
{
|
||||||
rsPlugins->allowAllPlugins(b) ;
|
rsPlugins->allowAllPlugins(b) ;
|
||||||
}
|
}
|
||||||
void PluginsPage::aboutPlugin(int i)
|
void settings::PluginsPage::aboutPlugin(int i)
|
||||||
{
|
{
|
||||||
std::cerr << "Launching about window for plugin " << i << std::endl;
|
std::cerr << "Launching about window for plugin " << i << std::endl;
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ void PluginsPage::aboutPlugin(int i)
|
|||||||
if(rsPlugins->plugin(i) != NULL && (dialog = rsPlugins->plugin(i)->qt_about_page()) != NULL)
|
if(rsPlugins->plugin(i) != NULL && (dialog = rsPlugins->plugin(i)->qt_about_page()) != NULL)
|
||||||
dialog->exec() ;
|
dialog->exec() ;
|
||||||
}
|
}
|
||||||
void PluginsPage::configurePlugin(int i)
|
void settings::PluginsPage::configurePlugin(int i)
|
||||||
{
|
{
|
||||||
std::cerr << "Launching configuration window for plugin " << i << std::endl;
|
std::cerr << "Launching configuration window for plugin " << i << std::endl;
|
||||||
|
|
||||||
@ -191,14 +191,14 @@ void PluginsPage::configurePlugin(int i)
|
|||||||
rsPlugins->plugin(i)->qt_config_panel()->show() ;
|
rsPlugins->plugin(i)->qt_config_panel()->show() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginsPage::enablePlugin(const QString& hash)
|
void settings::PluginsPage::enablePlugin(const QString& hash)
|
||||||
{
|
{
|
||||||
std::cerr << "Switching status of plugin " << hash.toStdString() << " to enable" << std::endl;
|
std::cerr << "Switching status of plugin " << hash.toStdString() << " to enable" << std::endl;
|
||||||
|
|
||||||
rsPlugins->enablePlugin(RsFileHash(hash.toStdString()) );
|
rsPlugins->enablePlugin(RsFileHash(hash.toStdString()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginsPage::disablePlugin(const QString& hash)
|
void settings::PluginsPage::disablePlugin(const QString& hash)
|
||||||
{
|
{
|
||||||
std::cerr << "Switching status of plugin " << hash.toStdString() << " to disable " << std::endl;
|
std::cerr << "Switching status of plugin " << hash.toStdString() << " to disable " << std::endl;
|
||||||
|
|
||||||
@ -206,11 +206,11 @@ void PluginsPage::disablePlugin(const QString& hash)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PluginsPage::~PluginsPage()
|
settings::PluginsPage::~PluginsPage()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Loads the settings for this page */
|
/** Loads the settings for this page */
|
||||||
void PluginsPage::load()
|
void settings::PluginsPage::load()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include <retroshare-gui/configpage.h>
|
#include <retroshare-gui/configpage.h>
|
||||||
#include "ui_PluginsPage.h"
|
#include "ui_PluginsPage.h"
|
||||||
|
|
||||||
|
namespace settings {
|
||||||
|
|
||||||
class PluginsPage : public ConfigPage
|
class PluginsPage : public ConfigPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -52,3 +54,4 @@ class PluginsPage : public ConfigPage
|
|||||||
Ui::PluginsPage ui;
|
Ui::PluginsPage ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace settings
|
||||||
|
@ -158,7 +158,7 @@ SettingsPage::initStackedWidget()
|
|||||||
addPage(new ForumPage()); // FORUMS
|
addPage(new ForumPage()); // FORUMS
|
||||||
addPage(new PostedPage()); // POSTED RENAME TO LINKS
|
addPage(new PostedPage()); // POSTED RENAME TO LINKS
|
||||||
addPage(new NotifyPage()); // NOTIFY
|
addPage(new NotifyPage()); // NOTIFY
|
||||||
addPage(new PluginsPage() ); // PLUGINS
|
addPage(new settings::PluginsPage() ); // PLUGINS
|
||||||
addPage(new AppearancePage()); // APPEARENCE
|
addPage(new AppearancePage()); // APPEARENCE
|
||||||
addPage(new SoundPage() ); // SOUND
|
addPage(new SoundPage() ); // SOUND
|
||||||
addPage(new ServicePermissionsPage() ); // PERMISSIONS
|
addPage(new ServicePermissionsPage() ); // PERMISSIONS
|
||||||
|
Loading…
Reference in New Issue
Block a user