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

TechDraw: Fix 'template doesn't exist' error #13794

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/App/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
App::Color Preferences::normalColor()
{
App::Color fcColor;
fcColor.setPackedValue(getPreferenceGroup("Colors")->GetUnsigned("NormalColor", 0x000000FF));//#000000 black

Check warning on line 82 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

0x000000FF is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
return fcColor;
}

Expand All @@ -90,7 +90,7 @@
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("View");
unsigned int defColor = hGrp->GetUnsigned("SelectionColor", 0x00FF00FF);//#00FF00 lime

Check warning on line 93 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

0x00FF00FF is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

App::Color fcColor;
fcColor.setPackedValue(getPreferenceGroup("Colors")->GetUnsigned("SelectColor", defColor));
Expand All @@ -104,7 +104,7 @@
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("View");
unsigned int defColor = hGrp->GetUnsigned("HighlightColor", 0xFFFF00FF);//#FFFF00 yellow

Check warning on line 107 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

0xFFFF00FF is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

App::Color fcColor;
fcColor.setPackedValue(getPreferenceGroup("Colors")->GetUnsigned("PreSelectColor", defColor));
Expand All @@ -114,18 +114,18 @@
App::Color Preferences::vertexColor()
{
App::Color fcColor;
fcColor.setPackedValue(getPreferenceGroup("Decorations")->GetUnsigned("VertexColor", 0x000000FF));//#000000 black

Check warning on line 117 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

0x000000FF is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
return fcColor;
}

double Preferences::vertexScale()
{
return getPreferenceGroup("General")->GetFloat("VertexScale", 3.0);

Check warning on line 123 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

3.0 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
}

int Preferences::scaleType()
{
return getPreferenceGroup("General")->GetInt("DefaultScaleType", 0);

Check warning on line 128 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

narrowing conversion from 'long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions]
}

double Preferences::scale()
Expand All @@ -134,7 +134,7 @@
if (prefScaleType == 0) {//page scale
return getPreferenceGroup("General")->GetFloat("DefaultPageScale", 1.0);
}
else if (prefScaleType == 1) {//custom scale

Check warning on line 137 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

do not use 'else' after 'return' [readability-else-after-return]
return getPreferenceGroup("General")->GetFloat("DefaultViewScale", 1.0);
}
return 1.0;
Expand All @@ -152,17 +152,17 @@

int Preferences::projectionAngle()
{
return getPreferenceGroup("General")->GetInt("ProjectionAngle", 0); //First Angle

Check warning on line 155 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

narrowing conversion from 'long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions]
}

int Preferences::lineGroup()
{
return getPreferenceGroup("Decorations")->GetInt("LineGroup", 3); // FC 0.70mm

Check warning on line 160 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

narrowing conversion from 'long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions]
}

int Preferences::balloonArrow()
{
return getPreferenceGroup("Decorations")->GetInt("BalloonArrow", 0);

Check warning on line 165 in src/Mod/TechDraw/App/Preferences.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

narrowing conversion from 'long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions]
}

double Preferences::balloonKinkLength()
Expand All @@ -178,7 +178,7 @@
QString Preferences::defaultTemplate()
{
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/Templates/";
std::string defaultFileName = defaultDir + "A4_LandscapeTD.svg";
std::string defaultFileName = defaultDir + "A4_Landscape_TD.svg";
std::string prefFileName = getPreferenceGroup("Files")->GetASCII("TemplateFile", defaultFileName.c_str());
if (prefFileName.empty()) {
prefFileName = defaultFileName;
Expand Down