QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
This commit is contained in:
committed by
wmayer
parent
0695552cff
commit
c275b35d48
@@ -61,10 +61,10 @@ static PyObject * open(PyObject *self, PyObject *args)
|
||||
PY_TRY {
|
||||
std::string path = App::GetApplication().getHomePath();
|
||||
path += "Mod/Path/PathScripts/";
|
||||
QDir dir1(QString::fromUtf8(path.c_str()), QString::fromAscii("*_pre.py"));
|
||||
QDir dir1(QString::fromUtf8(path.c_str()), QString::fromLatin1("*_pre.py"));
|
||||
std::string cMacroPath = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro")
|
||||
->GetASCII("MacroPath",App::Application::getUserAppDataDir().c_str());
|
||||
QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromAscii("*_pre.py"));
|
||||
QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromLatin1("*_pre.py"));
|
||||
QFileInfoList list = dir1.entryInfoList();
|
||||
list << dir2.entryInfoList();
|
||||
std::vector<std::string> scripts;
|
||||
@@ -90,7 +90,7 @@ static PyObject * open(PyObject *self, PyObject *args)
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
QFileInfo fileInfo = list.at(i);
|
||||
if (fileInfo.baseName().toStdString() == selected) {
|
||||
if (fileInfo.absoluteFilePath().contains(QString::fromAscii("PathScripts"))) {
|
||||
if (fileInfo.absoluteFilePath().contains(QString::fromLatin1("PathScripts"))) {
|
||||
pre << "from PathScripts import " << selected;
|
||||
} else {
|
||||
pre << "import " << selected;
|
||||
@@ -122,10 +122,10 @@ static PyObject * importer(PyObject *self, PyObject *args)
|
||||
PY_TRY {
|
||||
std::string path = App::GetApplication().getHomePath();
|
||||
path += "Mod/Path/PathScripts/";
|
||||
QDir dir1(QString::fromUtf8(path.c_str()), QString::fromAscii("*_pre.py"));
|
||||
QDir dir1(QString::fromUtf8(path.c_str()), QString::fromLatin1("*_pre.py"));
|
||||
std::string cMacroPath = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro")
|
||||
->GetASCII("MacroPath",App::Application::getUserAppDataDir().c_str());
|
||||
QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromAscii("*_pre.py"));
|
||||
QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromLatin1("*_pre.py"));
|
||||
QFileInfoList list = dir1.entryInfoList();
|
||||
list << dir2.entryInfoList();
|
||||
std::vector<std::string> scripts;
|
||||
@@ -160,7 +160,7 @@ static PyObject * importer(PyObject *self, PyObject *args)
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
QFileInfo fileInfo = list.at(i);
|
||||
if (fileInfo.baseName().toStdString() == selected) {
|
||||
if (fileInfo.absoluteFilePath().contains(QString::fromAscii("PathScripts"))) {
|
||||
if (fileInfo.absoluteFilePath().contains(QString::fromLatin1("PathScripts"))) {
|
||||
pre << "from PathScripts import " << selected;
|
||||
} else {
|
||||
pre << "import " << selected;
|
||||
@@ -192,10 +192,10 @@ static PyObject * exporter(PyObject *self, PyObject *args)
|
||||
Py_Error(Base::BaseExceptionFreeCADError, "No object to export");
|
||||
std::string path = App::GetApplication().getHomePath();
|
||||
path += "Mod/Path/PathScripts/";
|
||||
QDir dir1(QString::fromUtf8(path.c_str()), QString::fromAscii("*_post.py"));
|
||||
QDir dir1(QString::fromUtf8(path.c_str()), QString::fromLatin1("*_post.py"));
|
||||
std::string cMacroPath = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro")
|
||||
->GetASCII("MacroPath",App::Application::getUserAppDataDir().c_str());
|
||||
QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromAscii("*_post.py"));
|
||||
QDir dir2(QString::fromUtf8(cMacroPath.c_str()), QString::fromLatin1("*_post.py"));
|
||||
QFileInfoList list = dir1.entryInfoList();
|
||||
list << dir2.entryInfoList();
|
||||
std::vector<std::string> scripts;
|
||||
@@ -230,7 +230,7 @@ static PyObject * exporter(PyObject *self, PyObject *args)
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
QFileInfo fileInfo = list.at(i);
|
||||
if (fileInfo.baseName().toStdString() == selected) {
|
||||
if (fileInfo.absoluteFilePath().contains(QString::fromAscii("PathScripts"))) {
|
||||
if (fileInfo.absoluteFilePath().contains(QString::fromLatin1("PathScripts"))) {
|
||||
pre << "from PathScripts import " << selected;
|
||||
} else {
|
||||
pre << "import " << selected;
|
||||
|
||||
Reference in New Issue
Block a user