Skip to content

Commit

Permalink
Made last commit non-C++11 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Jan 19, 2016
1 parent 5364a17 commit f480791
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Mesh/App/AppMeshPy.cpp
Expand Up @@ -195,7 +195,7 @@ static PyObject * exporter(PyObject *self, PyObject *args)

// If tolerance is specified via python interface, use that.
// If not, use the preference, if that exists, else default to 0.1mm.
auto hGrp(App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Mesh") );
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Mesh");
float fTolerance = hGrp->GetFloat( "MaxDeviationExport", 0.1f );

if (!PyArg_ParseTuple(args, "Oet|f", &object, "utf-8", &Name, &fTolerance))
Expand Down
5 changes: 5 additions & 0 deletions src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp
Expand Up @@ -33,6 +33,11 @@ DlgSettingsImportExport::DlgSettingsImportExport(QWidget* parent)
ui->setupUi(this);
}

DlgSettingsImportExport::~DlgSettingsImportExport()
{
// no need to delete child widgets, Qt does it all for us
}

void DlgSettingsImportExport::saveSettings()
{
ui->maxDeviationExport->onSave();
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Mesh/Gui/DlgSettingsImportExportImp.h
Expand Up @@ -38,16 +38,16 @@ class DlgSettingsImportExport : public Gui::Dialog::PreferencePage
Q_OBJECT

public:
DlgSettingsImportExport(QWidget *parent=nullptr);
~DlgSettingsImportExport() = default;
DlgSettingsImportExport(QWidget* parent = 0);
~DlgSettingsImportExport();

protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);

private:
std::auto_ptr<Ui_DlgSettingsImportExport> ui;
Ui_DlgSettingsImportExport* ui;
}; // end class DlgSettingsImportExport

} // namespace MeshGui
Expand Down

4 comments on commit f480791

@ianrrees
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that! Do we have some plan to start using C++11?

@yorikvanhavre
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry, I think there was some discussion already and everybody more or less agreed that we can start using C++11. I made this change more for my own comfort and laziness :)

@ianrrees
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for the explanation! Also noticed I should've changed that auto_ptr to a unique_ptr (it's an adaptation from one of the Part preference dialogs).

I'm slowly working on a patch to add AMF export to some of the same areas as this - it'll be more C++11 styled, so will probably end up switching some of this stuff back again if it's not a problem ;).

@yorikvanhavre
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sooner or later we need to accept the modern times :) Ok for me!

Please sign in to comment.