Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runSofa] Fix compilation when SofaGuiQt is not activated #599

Merged
merged 2 commits into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions applications/projects/runSofa/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ using sofa::helper::logging::MainPerComponentLoggingMessageHandler ;
#include <windows.h>
#endif

#include <sofa/gui/qt/GuiDataRepository.h>
using sofa::gui::qt::GuiDataRepository ;
#include <sofa/gui/GuiDataRepository.h>
using sofa::gui::GuiDataRepository ;

using sofa::helper::system::DataRepository;
using sofa::helper::system::PluginRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ namespace sofa
{
namespace gui
{
namespace qt
{

FileRepository GuiDataRepository("GUI_DATA_PATH", Utils::getSofaPathTo("share/sofa/gui/qt/resources").c_str());
FileRepository GuiDataRepository("GUI_DATA_PATH", Utils::getSofaPathTo("share/sofa/gui/common/resources").c_str());

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
namespace sofa
{
namespace gui
{
namespace qt
{
extern SOFA_HELPER_API sofa::helper::system::FileRepository GuiDataRepository;
}
}
}
2 changes: 2 additions & 0 deletions applications/sofa/gui/SofaGuiCommon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set(HEADER_FILES
../SofaGUI.h
../ViewerFactory.h
../GUIManager.h
../GuiDataRepository.h
)

set(SOURCE_FILES
Expand All @@ -25,6 +26,7 @@ set(SOURCE_FILES
../PickHandler.cpp
../GUIManager.cpp
../ViewerFactory.cpp
../GuiDataRepository.cpp
)

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
Expand Down
2 changes: 0 additions & 2 deletions applications/sofa/gui/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ set(MOC_HEADER_FILES

# these header files do not need MOCcing
set(HEADER_FILES
GuiDataRepository.h
FileManagement.h
GraphListenerQListView.h
PickHandlerCallBacks.h
Expand Down Expand Up @@ -83,7 +82,6 @@ set(SOURCE_FILES
WDoubleLineEdit.cpp
viewer/SofaViewer.cpp
panels/QDocBrowser.cpp
GuiDataRepository.cpp
)

set(UI_FILES
Expand Down
9 changes: 9 additions & 0 deletions applications/sofa/gui/qt/RealGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ using sofa::helper::system::SetDirectory ;
#include <sofa/helper/system/FileSystem.h>
using sofa::helper::system::FileSystem ;

#include <sofa/helper/Utils.h>
using sofa::helper::Utils;

#include <sofa/helper/system/FileRepository.h>
using sofa::helper::system::DataRepository ;

#include <sofa/gui/GuiDataRepository.h>
using sofa::gui::GuiDataRepository;

#include <sofa/simulation/SceneLoaderFactory.h>
using sofa::simulation::SceneLoaderFactory ;

Expand Down Expand Up @@ -238,6 +244,9 @@ void RealGUI::CreateApplication(int /*_argc*/, char** /*_argv*/)
argv[1]=NULL;
application = new QSOFAApplication ( *argc,argv );

//Initialize GUI resources path
GuiDataRepository.addFirstPath(Utils::getSofaPathTo("share/sofa/gui/qt/resources").c_str());

//force locale to Standard C
//(must be done immediatly after the QApplication has been created)
QLocale locale(QLocale::C);
Expand Down
2 changes: 1 addition & 1 deletion applications/sofa/gui/qt/panels/QDocBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using sofa::helper::system::FileSystem ;

#include "QDocBrowser.h"
#include "../RealGUI.h"
#include "../GuiDataRepository.h"
#include <sofa/gui/GuiDataRepository.h>

namespace sofa
{
Expand Down