Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code

This commit is contained in:
wmayer 2015-07-14 19:05:39 +02:00
commit e6621ea78c
6 changed files with 12 additions and 11 deletions

View File

@ -109,7 +109,7 @@ Vector3d Command::getCenter (void)
return vec; return vec;
} }
const double Command::getValue(const std::string attr) const double Command::getValue(const std::string& attr)
{ {
std::string a(attr); std::string a(attr);
boost::to_upper(a); boost::to_upper(a);
@ -119,11 +119,11 @@ const double Command::getValue(const std::string attr)
return val; return val;
} }
const bool Command::has(const std::string attr) const bool Command::has(const std::string& attr)
{ {
std::string a(attr); std::string a(attr);
boost::to_upper(a); boost::to_upper(a);
return (bool)Parameters.count(a); return Parameters.count(a) > 0;
} }
std::string Command::toGCode (void) const std::string Command::toGCode (void) const
@ -139,7 +139,7 @@ std::string Command::toGCode (void) const
return str.str(); return str.str();
} }
void Command::setFromGCode (std::string str) void Command::setFromGCode (const std::string& str)
{ {
Parameters.clear(); Parameters.clear();
std::string mode = "none"; std::string mode = "none";

View File

@ -53,11 +53,11 @@ namespace Path
Base::Vector3d getCenter (void); // returns a 3d vector from the i,j,k parameters Base::Vector3d getCenter (void); // returns a 3d vector from the i,j,k parameters
void setCenter(const Base::Vector3d&, bool clockwise=true); // sets the center coordinates and the command name void setCenter(const Base::Vector3d&, bool clockwise=true); // sets the center coordinates and the command name
std::string toGCode (void) const; // returns a GCode string representation of the command std::string toGCode (void) const; // returns a GCode string representation of the command
void setFromGCode (std::string); // sets the parameters from the contents of the given GCode string void setFromGCode (const std::string&); // sets the parameters from the contents of the given GCode string
void setFromPlacement (const Base::Placement&); // sets the parameters from the contents of the given placement void setFromPlacement (const Base::Placement&); // sets the parameters from the contents of the given placement
const bool has(const std::string); // returns true if the given string exists in the parameters const bool has(const std::string&); // returns true if the given string exists in the parameters
Command transform(const Base::Placement); // returns a transformed copy of this command Command transform(const Base::Placement); // returns a transformed copy of this command
const double getValue(const std::string); // returns the value of a given parameter const double getValue(const std::string&); // returns the value of a given parameter
// attributes // attributes
std::string Name; std::string Name;

View File

@ -58,7 +58,6 @@ PyObject *ToolPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pytho
// constructor method // constructor method
int ToolPy::PyInit(PyObject* args, PyObject* kwd) int ToolPy::PyInit(PyObject* args, PyObject* kwd)
{ {
PyObject *pos;
char *name="Default tool"; char *name="Default tool";
char *type = "Undefined"; char *type = "Undefined";
char *mat = "Undefined"; char *mat = "Undefined";

View File

@ -40,6 +40,8 @@
using namespace PathGui; using namespace PathGui;
/* TRANSLATOR PathGui::DlgProcessorChooser */
DlgProcessorChooser::DlgProcessorChooser(std::vector<std::string> &scriptnames) DlgProcessorChooser::DlgProcessorChooser(std::vector<std::string> &scriptnames)
: QDialog(Gui::getMainWindow()), ui(new Ui_DlgProcessorChooser) : QDialog(Gui::getMainWindow()), ui(new Ui_DlgProcessorChooser)
{ {
@ -64,7 +66,7 @@ void DlgProcessorChooser::accept()
if (ui->comboBox->currentText() == tr("None")) if (ui->comboBox->currentText() == tr("None"))
entry = ""; entry = "";
else else
entry = ui->comboBox->currentText().toStdString(); entry = ui->comboBox->currentText().toUtf8().data();
QDialog::accept(); QDialog::accept();
} }
#include "moc_DlgProcessorChooser.cpp" #include "moc_DlgProcessorChooser.cpp"

View File

@ -30,7 +30,7 @@
using namespace PathGui; using namespace PathGui;
/* TRANSLATOR PartGui::DlgSettingsPathColor */ /* TRANSLATOR PathGui::DlgSettingsPathColor */
/** /**
* Constructs a DlgSettingsObjectColor which is a child of 'parent', with the * Constructs a DlgSettingsObjectColor which is a child of 'parent', with the

View File

@ -231,7 +231,7 @@ void ViewProviderPath::updateData(const App::Property* prop)
bool absolute = true; bool absolute = true;
bool first = true; bool first = true;
for (int i = 0; i < tp.getSize(); i++) { for (unsigned int i = 0; i < tp.getSize(); i++) {
Path::Command cmd = tp.getCommand(i); Path::Command cmd = tp.getCommand(i);
std::string name = cmd.Name; std::string name = cmd.Name;
Base::Vector3d next = cmd.getPlacement().getPosition(); Base::Vector3d next = cmd.getPlacement().getPosition();