Skip to content

Commit

Permalink
Remove redundant namespace references
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Aug 9, 2022
1 parent ec16040 commit f4dddd5
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 60 deletions.
4 changes: 2 additions & 2 deletions examples/plugin/custom_context_menu/CustomContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ CustomContext::~CustomContext()
}

// Register this plugin
IGNITION_ADD_PLUGIN(ignition::gui::CustomContext,
ignition::gui::Plugin);
IGNITION_ADD_PLUGIN(gui::CustomContext,
gui::Plugin);
4 changes: 2 additions & 2 deletions examples/plugin/dialog_from_plugin/DialogFromPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ DialogFromPlugin::~DialogFromPlugin()
}

// Register this plugin
IGNITION_ADD_PLUGIN(ignition::gui::DialogFromPlugin,
ignition::gui::Plugin);
IGNITION_ADD_PLUGIN(gui::DialogFromPlugin,
gui::Plugin);
4 changes: 2 additions & 2 deletions examples/plugin/hello_plugin/HelloPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ void HelloPlugin::OnButton()
}

// Register this plugin
IGNITION_ADD_PLUGIN(ignition::gui::HelloPlugin,
ignition::gui::Plugin);
IGNITION_ADD_PLUGIN(gui::HelloPlugin,
gui::Plugin);
4 changes: 2 additions & 2 deletions examples/plugin/multiple_qml/MultipleQml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ void MultipleQml::OnButton(const QString &_text)
}

// Register this plugin
IGNITION_ADD_PLUGIN(ignition::gui::MultipleQml,
ignition::gui::Plugin);
IGNITION_ADD_PLUGIN(gui::MultipleQml,
gui::Plugin);
8 changes: 4 additions & 4 deletions src/Application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ QQmlApplicationEngine *Application::Engine() const
}

/////////////////////////////////////////////////
Application *ignition::gui::App()
Application *gui::App()
{
return qobject_cast<Application *>(qGuiApp);
}
Expand Down Expand Up @@ -452,7 +452,7 @@ bool Application::LoadPlugin(const std::string &_filename,
}

// Go over all plugin names and get the first one that implements the
// ignition::gui::Plugin interface
// gui::Plugin interface
plugin::PluginPtr commonPlugin;
std::shared_ptr<gui::Plugin> plugin{nullptr};
for (auto pluginName : pluginNames)
Expand All @@ -461,7 +461,7 @@ bool Application::LoadPlugin(const std::string &_filename,
if (!commonPlugin)
continue;

plugin = commonPlugin->QueryInterfaceSharedPtr<ignition::gui::Plugin>();
plugin = commonPlugin->QueryInterfaceSharedPtr<gui::Plugin>();
if (plugin)
break;
}
Expand All @@ -482,7 +482,7 @@ bool Application::LoadPlugin(const std::string &_filename,
if (!plugin)
{
ignerr << "Failed to load plugin [" << _filename <<
"] : couldn't get [ignition::gui::Plugin] interface."
"] : couldn't get [gui::Plugin] interface."
<< std::endl;
return false;
}
Expand Down
22 changes: 11 additions & 11 deletions src/Application_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ using namespace gui;
//////////////////////////////////////////////////
TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Constructor))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

// No Qt app
EXPECT_EQ(nullptr, qGuiApp);
Expand All @@ -65,7 +65,7 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Constructor))
//////////////////////////////////////////////////
TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadPlugin))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

// No Qt app
EXPECT_EQ(nullptr, qGuiApp);
Expand Down Expand Up @@ -121,7 +121,7 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadPlugin))
EXPECT_TRUE(app.LoadPlugin("TestPlugin"));
}

// Plugin which doesn't inherit from ignition::gui::Plugin
// Plugin which doesn't inherit from gui::Plugin
{
Application app(g_argc, g_argv);
app.AddPluginPath(std::string(PROJECT_BINARY_PATH) + "/lib");
Expand Down Expand Up @@ -149,7 +149,7 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadPlugin))
//////////////////////////////////////////////////
TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadConfig))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

EXPECT_EQ(nullptr, qGuiApp);

Expand Down Expand Up @@ -199,7 +199,7 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadConfig))
//////////////////////////////////////////////////
TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadDefaultConfig))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

EXPECT_EQ(nullptr, qGuiApp);

Expand All @@ -208,12 +208,12 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadDefaultConfig))
Application app(g_argc, g_argv);

// Add test plugin to path (referenced in config)
auto testBuildPath = ignition::common::joinPaths(
auto testBuildPath = common::joinPaths(
std::string(PROJECT_BINARY_PATH), "lib");
app.AddPluginPath(testBuildPath);

// Set default config file
auto configPath = ignition::common::joinPaths(
auto configPath = common::joinPaths(
std::string(PROJECT_SOURCE_PATH), "test", "config", "test.config");
app.SetDefaultConfigPath(configPath);

Expand All @@ -224,7 +224,7 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(LoadDefaultConfig))
//////////////////////////////////////////////////
TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(CreateMainWindow))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

EXPECT_EQ(nullptr, qGuiApp);

Expand Down Expand Up @@ -307,7 +307,7 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(CreateMainWindow))
//////////////////////////////////////////////////
TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Dialog))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

EXPECT_EQ(nullptr, qGuiApp);

Expand Down Expand Up @@ -380,13 +380,13 @@ TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Dialog))
/////////////////////////////////////////////////
TEST(ApplicationTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(messageHandler))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

EXPECT_EQ(nullptr, qGuiApp);

Application app(g_argc, g_argv);

// \todo Verify output, see ignition::commmon::Console_TEST for example
// \todo Verify output, see commmon::Console_TEST for example
qDebug("This came from qDebug");
qInfo("This came from qInfo");
qWarning("This came from qWarning");
Expand Down
2 changes: 1 addition & 1 deletion src/Conversions_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ TEST(ConversionsTest, Time)

// Msgs to common to msgs
{
ignition::msgs::Time t;
msgs::Time t;
t.set_sec(s);
t.set_nsec(ns);

Expand Down
2 changes: 1 addition & 1 deletion src/DragDropModel_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace gui;
/////////////////////////////////////////////////
TEST(DragDropModelTest, Mime)
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

auto model = new DragDropModel();
ASSERT_TRUE(model != nullptr);
Expand Down
10 changes: 5 additions & 5 deletions src/MainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace ignition
public: std::string controlService{"/server_control"};

/// \brief Communication node
public: ignition::transport::Node node;
public: transport::Node node;
};
}
}
Expand All @@ -86,7 +86,7 @@ using namespace gui;

/// \brief Strip last component from a path.
/// \return Original path without its last component.
/// \ToDo: Move this function to ignition::common::Filesystem
/// \ToDo: Move this function to common::Filesystem
std::string dirName(const std::string &_path)
{
std::size_t found = _path.find_last_of("/\\");
Expand All @@ -99,7 +99,7 @@ MainWindow::MainWindow()
{
// Expose the ExitAction enum to QML via ExitAction 1.0 module
qRegisterMetaType<ExitAction>("ExitAction");
qmlRegisterUncreatableMetaObject(ignition::gui::staticMetaObject,
qmlRegisterUncreatableMetaObject(gui::staticMetaObject,
"ExitAction", 1, 0, "ExitAction", "Error: namespace enum");

// Make MainWindow functions available from all QML files (using root)
Expand Down Expand Up @@ -211,7 +211,7 @@ void MainWindow::OnStopServer()
}
};

ignition::msgs::ServerControl req;
msgs::ServerControl req;
req.set_stop(true);
const auto success = this->dataPtr->node.Request(
this->dataPtr->controlService, req, cb);
Expand Down Expand Up @@ -240,7 +240,7 @@ void MainWindow::SaveConfig(const std::string &_path)
// Create the intermediate directories if needed.
// We check for errors when we try to open the file.
auto dirname = dirName(_path);
ignition::common::createDirectories(dirname);
common::createDirectories(dirname);

// Open the file
std::ofstream out(_path.c_str(), std::ios::out);
Expand Down
10 changes: 5 additions & 5 deletions src/Plugin_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using namespace gui;
// See https://github.com/ignitionrobotics/ign-gui/issues/75
TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(DeleteLater))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

Application app(g_argc, g_argv);
app.AddPluginPath(std::string(PROJECT_BINARY_PATH) + "/lib");
Expand Down Expand Up @@ -77,7 +77,7 @@ TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(DeleteLater))
/////////////////////////////////////////////////
TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(InvalidXmlText))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

Application app(g_argc, g_argv);
app.AddPluginPath(std::string(PROJECT_BINARY_PATH) + "/lib");
Expand Down Expand Up @@ -107,7 +107,7 @@ TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(InvalidXmlText))
/////////////////////////////////////////////////
TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Getters))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

Application app(g_argc, g_argv);
app.AddPluginPath(std::string(PROJECT_BINARY_PATH) + "/lib");
Expand Down Expand Up @@ -139,7 +139,7 @@ TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(Getters))
/////////////////////////////////////////////////
TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(ConfigStr))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

Application app(g_argc, g_argv);
app.AddPluginPath(
Expand Down Expand Up @@ -238,7 +238,7 @@ TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(ConfigStr))
/////////////////////////////////////////////////
TEST(PluginTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(ConfigStrInputNoPlugin))
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

Application app(g_argc, g_argv);
app.AddPluginPath(
Expand Down
4 changes: 2 additions & 2 deletions src/SearchModel_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int countRowsOfIndex(const QModelIndex &_index = QModelIndex())
/////////////////////////////////////////////////
TEST(SearchModelTest, FlatStructure)
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

// A source model
auto sourceModel = new QStandardItemModel();
Expand Down Expand Up @@ -99,7 +99,7 @@ TEST(SearchModelTest, FlatStructure)
/////////////////////////////////////////////////
TEST(SearchModelTest, NestedStructure)
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);

// A source model
auto sourceModel = new QStandardItemModel();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grid_3d/Grid3D_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ TEST(Grid3DTest, CRUD)

tinyxml2::XMLDocument pluginDoc;
pluginDoc.Parse(pluginStr);
EXPECT_TRUE(ignition::gui::loadPlugin("Grid3D",
EXPECT_TRUE(gui::loadPlugin("Grid3D",
pluginDoc.FirstChildElement("plugin")));

// Create main window
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/key_publisher/KeyPublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ namespace gui
class KeyPublisherPrivate
{
/// \brief Node for communication
public: ignition::transport::Node node;
public: transport::Node node;

/// \brief Publisher
public: ignition::transport::Node::Publisher pub;
public: transport::Node::Publisher pub;

/// \brief Topic
public: std::string topic = "keyboard/keypress";
Expand All @@ -50,7 +50,7 @@ namespace gui
/// \param[in] key_press Pointer to the keyevent
public: void KeyPub(QKeyEvent *_keyPress)
{
ignition::msgs::Int32 Msg;
msgs::Int32 Msg;
Msg.set_data(_keyPress->key());
pub.Publish(Msg);
}
Expand All @@ -65,7 +65,7 @@ using namespace gui;
KeyPublisher::KeyPublisher(): Plugin(), dataPtr(new KeyPublisherPrivate)
{
// Advertise publisher node
this->dataPtr->pub = this->dataPtr->node.Advertise<ignition::msgs::Int32>
this->dataPtr->pub = this->dataPtr->node.Advertise<msgs::Int32>
(this->dataPtr->topic);
}

Expand All @@ -80,8 +80,8 @@ void KeyPublisher::LoadConfig(const tinyxml2::XMLElement *)
if (this->title.empty())
this->title = "Key publisher";

ignition::gui::App()->findChild
<ignition::gui::MainWindow *>()->QuickWindow()->installEventFilter(this);
gui::App()->findChild
<gui::MainWindow *>()->QuickWindow()->installEventFilter(this);
}

/////////////////////////////////////////////////
Expand All @@ -96,5 +96,5 @@ bool KeyPublisher::eventFilter(QObject *_obj, QEvent *_event)
}

// Register this plugin
IGNITION_ADD_PLUGIN(ignition::gui::KeyPublisher,
ignition::gui::Plugin)
IGNITION_ADD_PLUGIN(gui::KeyPublisher,
gui::Plugin)
2 changes: 1 addition & 1 deletion src/plugins/topic_viewer/TopicViewer_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ TEST(TopicViewerTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Model))
EXPECT_NE(nullptr, win);

// Get plugin
auto plugins = win->findChildren<plugins::TopicViewer *>();
auto plugins = win->findChildren<TopicViewer *>();
ASSERT_EQ(plugins.size(), 1);

auto plugin = plugins[0];
Expand Down
12 changes: 6 additions & 6 deletions test/integration/ExamplesBuild_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,24 @@ void ExamplesBuild::Build(const std::string &_type)

// Path to examples of the given type
auto examplesDir = std::string(PROJECT_SOURCE_PATH) + "/examples/" + _type;
ASSERT_TRUE(ignition::common::exists(examplesDir));
ASSERT_TRUE(common::exists(examplesDir));

// Iterate over directory
ignition::common::DirIter endIter;
for (ignition::common::DirIter dirIter(examplesDir);
common::DirIter endIter;
for (common::DirIter dirIter(examplesDir);
dirIter != endIter; ++dirIter)
{
auto base = ignition::common::basename(*dirIter);
auto base = common::basename(*dirIter);

// Source directory for this example
auto sourceDir = examplesDir + "/" + base;
ASSERT_TRUE(ignition::common::exists(sourceDir));
ASSERT_TRUE(common::exists(sourceDir));
igndbg << "Source: " << sourceDir << std::endl;

// Create a temp build directory
std::string tmpBuildDir;
ASSERT_TRUE(createAndSwitchToTempDir(tmpBuildDir));
EXPECT_TRUE(ignition::common::exists(tmpBuildDir));
EXPECT_TRUE(common::exists(tmpBuildDir));
igndbg << "Build directory: " << tmpBuildDir<< std::endl;

char cmd[1024];
Expand Down
2 changes: 1 addition & 1 deletion test/integration/Examples_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ TEST(ExampleTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Configs))
"examples", "config");

// Load each config file
ignition::common::DirIter endIter;
common::DirIter endIter;
for (common::DirIter file(exampleConfigPath); file != endIter; ++file)
{
Application app(g_argc, g_argv);
Expand Down
Loading

0 comments on commit f4dddd5

Please sign in to comment.