Merge pull request #1296 from chelovechishko/namespaces

fix ODR violations caused by same names for different things
This commit is contained in:
G10h4ck 2018-07-09 10:55:07 +02:00 committed by GitHub
commit 4b6fd5d944
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 133 additions and 118 deletions

View file

@ -433,7 +433,7 @@ void MainWindow::initStackedPage()
#ifndef RS_RELEASE_VERSION
#ifdef PLUGINMGR
addPage(pluginsPage = new PluginsPage(ui->stackPages), grp, NULL);
addPage(pluginsPage = new gui::PluginsPage(ui->stackPages), grp, NULL);
#endif
#endif
@ -643,10 +643,10 @@ const QList<UserNotify*> &MainWindow::getUserNotifyList()
/*static*/ void MainWindow::displayLobbySystrayMsg(const QString& title,const QString& msg)
{
if (_instance == NULL)
if (_instance == NULL)
return;
if(Settings->getDisplayTrayChatLobby())
if(Settings->getDisplayTrayChatLobby())
_instance->displaySystrayMsg(title,msg) ;
}
@ -1011,7 +1011,7 @@ void SetForegroundWindowInternal(HWND hWnd)
return NULL;
}
switch (page)
switch (page)
{
case Network:
return _instance->friendsDialog->networkDialog;
@ -1457,7 +1457,7 @@ void MainWindow::externalLinkActivated(const QUrl &url)
int res = mb.exec() ;
if (res == QMessageBox::No)
if (res == QMessageBox::No)
return ;
if(dontAsk_CB->isChecked())

View file

@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
@ -39,6 +39,8 @@ class QScriptEngine;
class PluginManager;
namespace gui {
//! A demo widget for showing plugin engine in action :)
@ -46,7 +48,7 @@ class PluginManager;
//! loaded plugin widgets. All specific actions moved to
//! PluginManagerWidget class. It contains a PluginManager instance, but it's
//! supposed that in future a pluginManager will become a global variable
class PluginsPage : public MainPage
class PluginsPage : public MainPage
{
Q_OBJECT
@ -70,10 +72,10 @@ protected:
QVBoxLayout* pluginPageLayout;
QGroupBox* pluginPanel;
QVBoxLayout* pluginPanelLayout;
//! Plugin widgets will be loaded into this tabs
QTabWidget* pluginTabs ;
QVBoxLayout* pmLay;
QFrame* pmFrame;
QSpacerItem* pmSpacer;
@ -82,5 +84,7 @@ protected:
PluginManager* pluginManager;
};
} // namespace gui
#endif

View file

@ -33,7 +33,7 @@
#include "../MainWindow.h"
PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
settings::PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
: ConfigPage(parent, flags)
{
ui.setupUi(this);
@ -123,7 +123,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
if(plugin == NULL || plugin->qt_config_panel() == NULL)
item->_configure_PB->hide() ;
if(plugin != NULL){
item->enableButton->hide();
@ -159,7 +159,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
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\">&nbsp;&nbsp;Plugins</h1> \
<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 \
they will be happy to help you out!</p>") ;
}
void PluginsPage::toggleEnableAll(bool b)
void settings::PluginsPage::toggleEnableAll(bool 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;
@ -183,7 +183,7 @@ void PluginsPage::aboutPlugin(int i)
if(rsPlugins->plugin(i) != NULL && (dialog = rsPlugins->plugin(i)->qt_about_page()) != NULL)
dialog->exec() ;
}
void PluginsPage::configurePlugin(int i)
void settings::PluginsPage::configurePlugin(int i)
{
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() ;
}
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;
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;
@ -206,11 +206,11 @@ void PluginsPage::disablePlugin(const QString& hash)
}
PluginsPage::~PluginsPage()
settings::PluginsPage::~PluginsPage()
{
}
/** Loads the settings for this page */
void PluginsPage::load()
void settings::PluginsPage::load()
{
}

View file

@ -24,6 +24,8 @@
#include <retroshare-gui/configpage.h>
#include "ui_PluginsPage.h"
namespace settings {
class PluginsPage : public ConfigPage
{
Q_OBJECT
@ -52,3 +54,4 @@ class PluginsPage : public ConfigPage
Ui::PluginsPage ui;
};
} // namespace settings

View file

@ -158,7 +158,7 @@ SettingsPage::initStackedWidget()
addPage(new ForumPage()); // FORUMS
addPage(new PostedPage()); // POSTED RENAME TO LINKS
addPage(new NotifyPage()); // NOTIFY
addPage(new PluginsPage() ); // PLUGINS
addPage(new settings::PluginsPage() ); // PLUGINS
addPage(new AppearancePage()); // APPEARENCE
addPage(new SoundPage() ); // SOUND
addPage(new ServicePermissionsPage() ); // PERMISSIONS