Skip to content

Commit

Permalink
Install default PAT file
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Jan 30, 2017
1 parent 7cb3e93 commit 722b2d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Mod/TechDraw/App/CMakeLists.txt
Expand Up @@ -157,6 +157,10 @@ SET(TechDraw_Templates
Templates/A4_Portrait_ISO7200TD.svg
)

SET(TechDraw_PATFile
PAT/FCPAT.pat
)

if(MSVC)
#add_definitions(-D_PreComp_)
#GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" TechDrawCPP_SRCS ${TechDraw_SRCS} ${Draw_SRCS} )
Expand All @@ -182,6 +186,11 @@ fc_target_copy_resource(TechDraw
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw
${TechDraw_Templates})

fc_target_copy_resource(TechDraw
${CMAKE_SOURCE_DIR}/src/Mod/TechDraw
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw
${TechDraw_PATFile})

SET_BIN_DIR(TechDraw TechDraw /Mod/TechDraw)
SET_PYTHON_PREFIX_SUFFIX(TechDraw)

Expand Down
4 changes: 3 additions & 1 deletion src/Mod/TechDraw/App/DrawGeomHatch.cpp
Expand Up @@ -393,14 +393,16 @@ void DrawGeomHatch::getParameters(void)
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");

std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/PAT/";
std::string defaultFileName = defaultDir + "FCStd.pat";
std::string defaultFileName = defaultDir + "FCPAT.pat";
QString patternFileName = QString::fromStdString(hGrp->GetASCII("FilePattern",defaultFileName.c_str()));
if (patternFileName.isEmpty()) {
patternFileName = QString::fromStdString(defaultFileName);
}
QFileInfo tfi(patternFileName);
if (tfi.isReadable()) {
FilePattern.setValue(patternFileName.toUtf8().constData());
} else {
Base::Console().Error("DrawGeomHatch: PAT file: %s Not Found\n",patternFileName.toUtf8().constData());
}
hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");
Expand Down
File renamed without changes.

0 comments on commit 722b2d1

Please sign in to comment.