Skip to content

Commit

Permalink
Remove redundant namespace references (#460)
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>

Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Aug 16, 2022
1 parent 212004b commit 8bc5bed
Show file tree
Hide file tree
Showing 32 changed files with 150 additions and 150 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(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(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(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(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
12 changes: 6 additions & 6 deletions src/MainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -196,8 +196,8 @@ void MainWindow::OnSaveConfigAs(const QString &_path)
/////////////////////////////////////////////////
void MainWindow::OnStopServer()
{
std::function<void(const ignition::msgs::Boolean &, const bool)> cb =
[](const ignition::msgs::Boolean &_rep, const bool _result)
std::function<void(const msgs::Boolean &, const bool)> cb =
[](const msgs::Boolean &_rep, const bool _result)
{
if (_rep.data() && _result)
{
Expand All @@ -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
Loading

0 comments on commit 8bc5bed

Please sign in to comment.