diff --git a/src/App/Branding.cpp b/src/App/Branding.cpp index 173ba0f46..8a4a8c468 100644 --- a/src/App/Branding.cpp +++ b/src/App/Branding.cpp @@ -82,7 +82,7 @@ Branding::XmlConfig Branding::getUserDefines() const if (!root.isNull()) { child = root.firstChildElement(); while (!child.isNull()) { - std::string name = (const char*)child.localName().toAscii(); + std::string name = (const char*)child.localName().toLatin1(); std::string value = (const char*)child.text().toUtf8(); if (std::find(filter.begin(), filter.end(), name) != filter.end()) cfg[name] = value; diff --git a/src/Base/Uuid.cpp b/src/Base/Uuid.cpp index b5d77cee1..c0663605d 100644 --- a/src/Base/Uuid.cpp +++ b/src/Base/Uuid.cpp @@ -68,7 +68,7 @@ std::string Uuid::createUuid(void) QString uuid = QUuid::createUuid().toString(); uuid = uuid.mid(1); uuid.chop(1); - Uuid = (const char*)uuid.toAscii(); + Uuid = (const char*)uuid.toLatin1(); return Uuid; } @@ -82,7 +82,7 @@ void Uuid::setValue(const char* sString) QString id = uuid.toString(); id = id.mid(1); id.chop(1); - _uuid = (const char*)id.toAscii(); + _uuid = (const char*)id.toLatin1(); } } diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 3e0adde72..fd4045f47 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -719,7 +719,7 @@ void RecentFilesAction::activateFile(int id) // invokes appendFile() SelectModule::Dict dict = SelectModule::importHandler(filename); for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { - Application::Instance->open(it.key().toUtf8(), it.value().toAscii()); + Application::Instance->open(it.key().toUtf8(), it.value().toLatin1()); break; } } @@ -773,7 +773,7 @@ void RecentFilesAction::save() QString value = recentFiles[index]->toolTip(); if (value.isEmpty()) break; - hGrp->SetASCII(key.toAscii(), value.toUtf8()); + hGrp->SetASCII(key.toLatin1(), value.toUtf8()); } } diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index bafc23e98..0f39ccdbe 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -336,7 +336,7 @@ Application::Application(bool GUIenabled) ParameterGrp::handle hPGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp"); hPGrp = hPGrp->GetGroup("Preferences")->GetGroup("General"); QString lang = QLocale::languageToString(QLocale::system().language()); - Translator::instance()->activateLanguage(hPGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str()); + Translator::instance()->activateLanguage(hPGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str()); GetWidgetFactorySupplier(); ParameterGrp::handle hUnits = App::GetApplication().GetParameterGroupByPath @@ -1105,7 +1105,7 @@ bool Application::activateWorkbench(const char* name) pos = rx.indexIn(msg); } - Base::Console().Error("%s\n", (const char*)msg.toAscii()); + Base::Console().Error("%s\n", (const char*)msg.toLatin1()); Base::Console().Log("%s\n", e.getStackTrace().c_str()); if (!d->startingUp) { wc.restoreCursor(); @@ -1122,7 +1122,7 @@ QPixmap Application::workbenchIcon(const QString& wb) const { Base::PyGILStateLocker lock; // get the python workbench object from the dictionary - PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii()); + PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1()); // test if the workbench exists if (pcWorkbench) { // make a unique icon name @@ -1196,7 +1196,7 @@ QString Application::workbenchToolTip(const QString& wb) const { // get the python workbench object from the dictionary Base::PyGILStateLocker lock; - PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii()); + PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1()); // test if the workbench exists if (pcWorkbench) { // get its ToolTip member if possible @@ -1220,7 +1220,7 @@ QString Application::workbenchMenuText(const QString& wb) const { // get the python workbench object from the dictionary Base::PyGILStateLocker lock; - PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toAscii()); + PyObject* pcWorkbench = PyDict_GetItemString(_pcWorkbenchDictionary, wb.toLatin1()); // test if the workbench exists if (pcWorkbench) { // get its ToolTip member if possible diff --git a/src/Gui/CallTips.cpp b/src/Gui/CallTips.cpp index e7e7b539a..e50685b16 100644 --- a/src/Gui/CallTips.cpp +++ b/src/Gui/CallTips.cpp @@ -182,7 +182,7 @@ QString CallTipsList::extractContext(const QString& line) const int index = len-1; for (int i=0; i= 48 && ch <= 57) || // Numbers (ch >= 65 && ch <= 90) || // Uppercase letters (ch >= 97 && ch <= 122) || // Lowercase letters @@ -208,13 +208,13 @@ QMap CallTipsList::extractTips(const QString& context) const Py::Dict dict = module.getDict(); QString modname = items.front(); items.pop_front(); - if (!dict.hasKey(std::string(modname.toAscii()))) + if (!dict.hasKey(std::string(modname.toLatin1()))) return tips; // unknown object // get the Python object we need - Py::Object obj = dict.getItem(std::string(modname.toAscii())); + Py::Object obj = dict.getItem(std::string(modname.toLatin1())); while (!items.isEmpty()) { - QByteArray name = items.front().toAscii(); + QByteArray name = items.front().toLatin1(); std::string attr = name.constData(); items.pop_front(); if (obj.hasAttr(attr)) diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index a6c3b650e..c19863258 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -623,7 +623,7 @@ const char* Command::keySequenceToAccel(int sk) const QKeySequence::StandardKey type = (QKeySequence::StandardKey)sk; QKeySequence ks(type); QString qs = ks.toString(); - QByteArray data = qs.toAscii(); + QByteArray data = qs.toLatin1(); #if defined (_MSC_VER) return _strdup((const char*)data); #else diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index 2d23ea261..a7fecf696 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -145,7 +145,7 @@ void StdCmdOpen::activated(int iMsg) } else { for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { - getGuiApplication()->open(it.key().toUtf8(), it.value().toAscii()); + getGuiApplication()->open(it.key().toUtf8(), it.value().toLatin1()); } } } @@ -215,7 +215,7 @@ void StdCmdImport::activated(int iMsg) for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { getGuiApplication()->importFrom(it.key().toUtf8(), getActiveGuiDocument()->getDocument()->getName(), - it.value().toAscii()); + it.value().toLatin1()); } if (emptyDoc) { @@ -288,7 +288,7 @@ void StdCmdExport::activated(int iMsg) for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { getGuiApplication()->exportTo(it.key().toUtf8(), getActiveGuiDocument()->getDocument()->getName(), - it.value().toAscii()); + it.value().toLatin1()); } } } diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index 46802c3b9..28ec4c834 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -90,7 +90,7 @@ void StdCmdWorkbench::activated(int i) try { Workbench* w = WorkbenchManager::instance()->active(); QList items = static_cast(_pcAction)->actions(); - std::string switch_to = (const char*)items[i]->objectName().toAscii(); + std::string switch_to = (const char*)items[i]->objectName().toLatin1(); if (w) { std::string current_w = w->name(); if (switch_to == current_w) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index d6328294b..5dbc0089d 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -287,7 +287,7 @@ void StdCmdFreezeViews::activated(int iMsg) QList acts = pcAction->actions(); QString data = acts[iMsg]->toolTip(); QString send = QString::fromAscii("SetCamera %1").arg(data); - getGuiApplication()->sendMsgToActiveView(send.toAscii()); + getGuiApplication()->sendMsgToActiveView(send.toLatin1()); } } @@ -323,7 +323,7 @@ void StdCmdFreezeViews::onSaveViews() } } - str << " " << endl; + str << " " << endl; } str << " " << endl; @@ -364,7 +364,7 @@ void StdCmdFreezeViews::onRestoreViews() if (!xmlDocument.setContent(&file, true, &errorStr, &errorLine, &errorColumn)) { std::cerr << "Parse error in XML content at line " << errorLine << ", column " << errorColumn << ": " - << (const char*)errorStr.toAscii() << std::endl; + << (const char*)errorStr.toLatin1() << std::endl; return; } @@ -1520,7 +1520,7 @@ void StdViewScreenShot::activated(int iMsg) } } - hExt->SetASCII("OffscreenImageFormat", (const char*)format.toAscii()); + hExt->SetASCII("OffscreenImageFormat", (const char*)format.toLatin1()); // which background chosen const char* background; diff --git a/src/Gui/DlgActionsImp.cpp b/src/Gui/DlgActionsImp.cpp index cec41036c..33379caf0 100644 --- a/src/Gui/DlgActionsImp.cpp +++ b/src/Gui/DlgActionsImp.cpp @@ -226,7 +226,7 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked() } // search for the command in the manager - QByteArray actionName = newActionName().toAscii(); + QByteArray actionName = newActionName().toLatin1(); CommandManager& rclMan = Application::Instance->commandManager(); MacroCommand* macro = new MacroCommand(actionName); rclMan.addCommand( macro ); @@ -260,12 +260,12 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked() actionStatus->clear(); if (!m_sPixmap.isEmpty()) - macro->setPixmap(m_sPixmap.toAscii()); + macro->setPixmap(m_sPixmap.toLatin1()); pixmapLabel->clear(); m_sPixmap = QString::null; if (!actionAccel->text().isEmpty()) { - macro->setAccel(actionAccel->text().toAscii()); + macro->setAccel(actionAccel->text().toLatin1()); } actionAccel->clear(); @@ -315,12 +315,12 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked() actionStatus->clear(); if (!m_sPixmap.isEmpty()) - macro->setPixmap(m_sPixmap.toAscii()); + macro->setPixmap(m_sPixmap.toLatin1()); pixmapLabel->clear(); m_sPixmap = QString::null; if (!actionAccel->text().isEmpty()) { - macro->setAccel(actionAccel->text().toAscii()); + macro->setAccel(actionAccel->text().toLatin1()); } actionAccel->clear(); diff --git a/src/Gui/DlgCommandsImp.cpp b/src/Gui/DlgCommandsImp.cpp index 8a169d5cf..3653057bd 100644 --- a/src/Gui/DlgCommandsImp.cpp +++ b/src/Gui/DlgCommandsImp.cpp @@ -146,7 +146,7 @@ void DlgCustomCommandsImp::onGroupActivated(QTreeWidgetItem* item) commandTreeWidget->clear(); CommandManager & cCmdMgr = Application::Instance->commandManager(); - std::vector aCmds = cCmdMgr.getGroupCommands(group.toAscii()); + std::vector aCmds = cCmdMgr.getGroupCommands(group.toLatin1()); if (group == QLatin1String("Macros")) { for (std::vector::iterator it = aCmds.begin(); it != aCmds.end(); ++it) { QTreeWidgetItem* item = new QTreeWidgetItem(commandTreeWidget); diff --git a/src/Gui/DlgCustomizeSpaceball.cpp b/src/Gui/DlgCustomizeSpaceball.cpp index 6c962c992..b364ed887 100644 --- a/src/Gui/DlgCustomizeSpaceball.cpp +++ b/src/Gui/DlgCustomizeSpaceball.cpp @@ -116,7 +116,7 @@ void ButtonModel::insertButtonRows(int number) { QString groupName; groupName.setNum(index); - Base::Reference newGroup = spaceballButtonGroup()->GetGroup(groupName.toAscii());//builds the group. + Base::Reference newGroup = spaceballButtonGroup()->GetGroup(groupName.toLatin1());//builds the group. newGroup->SetASCII("Command", ""); } endInsertRows(); @@ -126,14 +126,14 @@ void ButtonModel::insertButtonRows(int number) void ButtonModel::setCommand(int row, QString command) { GroupVector groupVector = spaceballButtonGroup()->GetGroups(); - groupVector.at(row)->SetASCII("Command", command.toAscii()); + groupVector.at(row)->SetASCII("Command", command.toLatin1()); } void ButtonModel::goButtonPress(int number) { QString numberString; numberString.setNum(number); - if (!spaceballButtonGroup()->HasGroup(numberString.toAscii())) + if (!spaceballButtonGroup()->HasGroup(numberString.toLatin1())) insertButtonRows(number); } @@ -439,7 +439,7 @@ void CommandModel::groupCommands(const QString& groupName) CommandNode *parentNode = new CommandNode(CommandNode::GroupType); parentNode->parent = rootNode; rootNode->children.push_back(parentNode); - std::vector commands = Application::Instance->commandManager().getGroupCommands(groupName.toAscii()); + std::vector commands = Application::Instance->commandManager().getGroupCommands(groupName.toLatin1()); for (std::vector ::iterator it = commands.begin(); it != commands.end(); ++it) { CommandNode *childNode = new CommandNode(CommandNode::CommandType); diff --git a/src/Gui/DlgDisplayPropertiesImp.cpp b/src/Gui/DlgDisplayPropertiesImp.cpp index 7338ba6e7..fa955e5f3 100644 --- a/src/Gui/DlgDisplayPropertiesImp.cpp +++ b/src/Gui/DlgDisplayPropertiesImp.cpp @@ -274,14 +274,14 @@ void DlgDisplayPropertiesImp::on_changeMode_activated(const QString& s) App::Property* prop = (*It)->getPropertyByName("DisplayMode"); if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) { App::PropertyEnumeration* Display = (App::PropertyEnumeration*)prop; - Display->setValue((const char*)s.toAscii()); + Display->setValue((const char*)s.toLatin1()); } } } void DlgDisplayPropertiesImp::on_changePlot_activated(const QString&s) { - Base::Console().Log("Plot = %s\n",(const char*)s.toAscii()); + Base::Console().Log("Plot = %s\n",(const char*)s.toLatin1()); } /** diff --git a/src/Gui/DlgEditorImp.cpp b/src/Gui/DlgEditorImp.cpp index c4d1d283d..97260e509 100644 --- a/src/Gui/DlgEditorImp.cpp +++ b/src/Gui/DlgEditorImp.cpp @@ -125,7 +125,7 @@ DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent ) this->displayItems->header()->hide(); for (QVector >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it) { QTreeWidgetItem* item = new QTreeWidgetItem(this->displayItems); - item->setText(0, tr((*it).first.toAscii())); + item->setText(0, tr((*it).first.toLatin1())); } pythonSyntax = new PythonSyntaxHighlighter(textEdit1); pythonSyntax->setDocument(textEdit1->document()); @@ -173,10 +173,10 @@ void DlgSettingsEditorImp::saveSettings() // Saves the color map ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Editor"); for (QVector >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it) - hGrp->SetUnsigned((*it).first.toAscii(), (*it).second); + hGrp->SetUnsigned((*it).first.toLatin1(), (*it).second); hGrp->SetInt( "FontSize", fontSize->value() ); - hGrp->SetASCII( "Font", fontFamily->currentText().toAscii() ); + hGrp->SetASCII( "Font", fontFamily->currentText().toLatin1() ); } void DlgSettingsEditorImp::loadSettings() @@ -203,7 +203,7 @@ void DlgSettingsEditorImp::loadSettings() // Restores the color map ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Editor"); for (QVector >::Iterator it = d->colormap.begin(); it != d->colormap.end(); ++it){ - unsigned long col = hGrp->GetUnsigned((*it).first.toAscii(), (*it).second); + unsigned long col = hGrp->GetUnsigned((*it).first.toLatin1(), (*it).second); (*it).second = col; QColor color; color.setRgb((col >> 24) & 0xff, (col >> 16) & 0xff, (col >> 8) & 0xff); @@ -234,7 +234,7 @@ void DlgSettingsEditorImp::changeEvent(QEvent *e) if (e->type() == QEvent::LanguageChange) { int index = 0; for (QVector >::ConstIterator it = d->colormap.begin(); it != d->colormap.end(); ++it) - this->displayItems->topLevelItem(index++)->setText(0, tr((*it).first.toAscii())); + this->displayItems->topLevelItem(index++)->setText(0, tr((*it).first.toLatin1())); this->retranslateUi(this); } else { QWidget::changeEvent(e); diff --git a/src/Gui/DlgGeneralImp.cpp b/src/Gui/DlgGeneralImp.cpp index 80bc3380a..0e8c69118 100644 --- a/src/Gui/DlgGeneralImp.cpp +++ b/src/Gui/DlgGeneralImp.cpp @@ -121,7 +121,7 @@ void DlgGeneralImp::saveSettings() QVariant data = AutoloadModuleCombo->itemData(index); QString startWbName = data.toString(); App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")-> - SetASCII("AutoloadModule", startWbName.toAscii()); + SetASCII("AutoloadModule", startWbName.toLatin1()); AutoloadTabCombo->onSave(); RecentFiles->onSave(); @@ -133,7 +133,7 @@ void DlgGeneralImp::saveSettings() setRecentFileSize(); ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General"); QString lang = QLocale::languageToString(QLocale::system().language()); - QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str(); + QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str(); QByteArray current = Languages->itemData(Languages->currentIndex()).toByteArray(); if (current != language) { @@ -216,7 +216,7 @@ void DlgGeneralImp::loadSettings() // search for the language files ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General"); QString lang = QLocale::languageToString(QLocale::system().language()); - QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toAscii()).c_str(); + QByteArray language = hGrp->GetASCII("Language", (const char*)lang.toLatin1()).c_str(); int index = 1; Languages->addItem(QString::fromAscii("English"), QByteArray("English")); TStringMap list = Translator::instance()->supportedLocales(); diff --git a/src/Gui/DlgKeyboardImp.cpp b/src/Gui/DlgKeyboardImp.cpp index 29391a7cd..8f076c3c0 100644 --- a/src/Gui/DlgKeyboardImp.cpp +++ b/src/Gui/DlgKeyboardImp.cpp @@ -177,7 +177,7 @@ void DlgCustomKeyboardImp::on_categoryBox_activated(int index) editShortcut->clear(); CommandManager & cCmdMgr = Application::Instance->commandManager(); - std::vector aCmds = cCmdMgr.getGroupCommands( group.toAscii() ); + std::vector aCmds = cCmdMgr.getGroupCommands( group.toLatin1() ); if (group == QLatin1String("Macros")) { for (std::vector::iterator it = aCmds.begin(); it != aCmds.end(); ++it) { diff --git a/src/Gui/DlgParameterImp.cpp b/src/Gui/DlgParameterImp.cpp index d9391b3c1..2861c1cc5 100644 --- a/src/Gui/DlgParameterImp.cpp +++ b/src/Gui/DlgParameterImp.cpp @@ -313,7 +313,7 @@ bool validateInput(QWidget* parent, const QString& input) if (input.isEmpty()) return false; for (int i=0; i '9') && // Numbers (c < 'A' || c > 'Z') && // Uppercase letters (c < 'a' || c > 'z') && // Lowercase letters @@ -393,7 +393,7 @@ void ParameterGroup::onDeleteSelectedItem() int index = parent->indexOfChild(sel); parent->takeChild(index); ParameterGroupItem* para = static_cast(parent); - para->_hcGrp->RemoveGrp(sel->text(0).toAscii()); + para->_hcGrp->RemoveGrp(sel->text(0).toLatin1()); delete sel; } } @@ -425,14 +425,14 @@ void ParameterGroup::onCreateSubgroup() ParameterGroupItem* para = static_cast(item); Base::Reference hGrp = para->_hcGrp; - if ( hGrp->HasGroup( name.toAscii() ) ) + if ( hGrp->HasGroup( name.toLatin1() ) ) { QMessageBox::critical( this, tr("Existing sub-group"), tr("The sub-group '%1' already exists.").arg( name ) ); return; } - hGrp = hGrp->GetGroup( name.toAscii() ); + hGrp = hGrp->GetGroup( name.toLatin1() ); (void)new ParameterGroupItem(para,hGrp); expandItem(para); } @@ -822,7 +822,7 @@ void ParameterGroupItem::setData ( int column, int role, const QVariant & value QObject::tr("The group '%1' cannot be renamed.").arg( oldName ) ); return; } - if ( item->_hcGrp->HasGroup( newName.toAscii() ) ) + if ( item->_hcGrp->HasGroup( newName.toLatin1() ) ) { QMessageBox::critical( treeWidget(), QObject::tr("Existing group"), QObject::tr("The group '%1' already exists.").arg( newName ) ); @@ -831,10 +831,10 @@ void ParameterGroupItem::setData ( int column, int role, const QVariant & value else { // rename the group by adding a new group, copy the content and remove the old group - Base::Reference hOldGrp = item->_hcGrp->GetGroup( oldName.toAscii() ); - Base::Reference hNewGrp = item->_hcGrp->GetGroup( newName.toAscii() ); + Base::Reference hOldGrp = item->_hcGrp->GetGroup( oldName.toLatin1() ); + Base::Reference hNewGrp = item->_hcGrp->GetGroup( newName.toLatin1() ); hOldGrp->copyTo( hNewGrp ); - item->_hcGrp->RemoveGrp( oldName.toAscii() ); + item->_hcGrp->RemoveGrp( oldName.toLatin1() ); } } @@ -907,25 +907,25 @@ void ParameterText::changeValue() if ( ok ) { setText( 2, txt ); - _hcGrp->SetASCII(text(0).toAscii(), txt.toUtf8()); + _hcGrp->SetASCII(text(0).toLatin1(), txt.toUtf8()); } } void ParameterText::removeFromGroup () { - _hcGrp->RemoveASCII(text(0).toAscii()); + _hcGrp->RemoveASCII(text(0).toLatin1()); } void ParameterText::replace( const QString& oldName, const QString& newName ) { - std::string val = _hcGrp->GetASCII(oldName.toAscii()); - _hcGrp->RemoveASCII(oldName.toAscii()); - _hcGrp->SetASCII(newName.toAscii(), val.c_str()); + std::string val = _hcGrp->GetASCII(oldName.toLatin1()); + _hcGrp->RemoveASCII(oldName.toLatin1()); + _hcGrp->SetASCII(newName.toLatin1(), val.c_str()); } void ParameterText::appendToGroup() { - _hcGrp->SetASCII(text(0).toAscii(), text(2).toUtf8()); + _hcGrp->SetASCII(text(0).toLatin1(), text(2).toUtf8()); } // -------------------------------------------------------------------- @@ -951,25 +951,25 @@ void ParameterInt::changeValue() if ( ok ) { setText(2, QString::fromAscii("%1").arg(num)); - _hcGrp->SetInt(text(0).toAscii(), (long)num); + _hcGrp->SetInt(text(0).toLatin1(), (long)num); } } void ParameterInt::removeFromGroup () { - _hcGrp->RemoveInt(text(0).toAscii()); + _hcGrp->RemoveInt(text(0).toLatin1()); } void ParameterInt::replace( const QString& oldName, const QString& newName ) { - long val = _hcGrp->GetInt(oldName.toAscii()); - _hcGrp->RemoveInt(oldName.toAscii()); - _hcGrp->SetInt(newName.toAscii(), val); + long val = _hcGrp->GetInt(oldName.toLatin1()); + _hcGrp->RemoveInt(oldName.toLatin1()); + _hcGrp->SetInt(newName.toLatin1(), val); } void ParameterInt::appendToGroup() { - _hcGrp->SetInt(text(0).toAscii(), text(2).toLong()); + _hcGrp->SetInt(text(0).toLatin1(), text(2).toLong()); } // -------------------------------------------------------------------- @@ -1003,26 +1003,26 @@ void ParameterUInt::changeValue() if ( ok ) { setText(2, QString::fromAscii("%1").arg(num)); - _hcGrp->SetUnsigned(text(0).toAscii(), (unsigned long)num); + _hcGrp->SetUnsigned(text(0).toLatin1(), (unsigned long)num); } } } void ParameterUInt::removeFromGroup () { - _hcGrp->RemoveUnsigned(text(0).toAscii()); + _hcGrp->RemoveUnsigned(text(0).toLatin1()); } void ParameterUInt::replace( const QString& oldName, const QString& newName ) { - unsigned long val = _hcGrp->GetUnsigned(oldName.toAscii()); - _hcGrp->RemoveUnsigned(oldName.toAscii()); - _hcGrp->SetUnsigned(newName.toAscii(), val); + unsigned long val = _hcGrp->GetUnsigned(oldName.toLatin1()); + _hcGrp->RemoveUnsigned(oldName.toLatin1()); + _hcGrp->SetUnsigned(newName.toLatin1(), val); } void ParameterUInt::appendToGroup() { - _hcGrp->SetUnsigned(text(0).toAscii(), text(2).toULong()); + _hcGrp->SetUnsigned(text(0).toLatin1(), text(2).toULong()); } // -------------------------------------------------------------------- @@ -1048,25 +1048,25 @@ void ParameterFloat::changeValue() if ( ok ) { setText(2, QString::fromAscii("%1").arg(num)); - _hcGrp->SetFloat(text(0).toAscii(), num); + _hcGrp->SetFloat(text(0).toLatin1(), num); } } void ParameterFloat::removeFromGroup () { - _hcGrp->RemoveFloat(text(0).toAscii()); + _hcGrp->RemoveFloat(text(0).toLatin1()); } void ParameterFloat::replace( const QString& oldName, const QString& newName ) { - double val = _hcGrp->GetFloat(oldName.toAscii()); - _hcGrp->RemoveFloat(oldName.toAscii()); - _hcGrp->SetFloat(newName.toAscii(), val); + double val = _hcGrp->GetFloat(oldName.toLatin1()); + _hcGrp->RemoveFloat(oldName.toLatin1()); + _hcGrp->SetFloat(newName.toLatin1(), val); } void ParameterFloat::appendToGroup() { - _hcGrp->SetFloat(text(0).toAscii(), text(2).toDouble()); + _hcGrp->SetFloat(text(0).toLatin1(), text(2).toDouble()); } // -------------------------------------------------------------------- @@ -1096,26 +1096,26 @@ void ParameterBool::changeValue() if ( ok ) { setText( 2, txt ); - _hcGrp->SetBool(text(0).toAscii(), (txt == list[0] ? true : false) ); + _hcGrp->SetBool(text(0).toLatin1(), (txt == list[0] ? true : false) ); } } void ParameterBool::removeFromGroup () { - _hcGrp->RemoveBool(text(0).toAscii()); + _hcGrp->RemoveBool(text(0).toLatin1()); } void ParameterBool::replace( const QString& oldName, const QString& newName ) { - bool val = _hcGrp->GetBool(oldName.toAscii()); - _hcGrp->RemoveBool(oldName.toAscii()); - _hcGrp->SetBool(newName.toAscii(), val); + bool val = _hcGrp->GetBool(oldName.toLatin1()); + _hcGrp->RemoveBool(oldName.toLatin1()); + _hcGrp->SetBool(newName.toLatin1(), val); } void ParameterBool::appendToGroup() { bool val = (text(2) == QLatin1String("true") ? true : false); - _hcGrp->SetBool(text(0).toAscii(), val); + _hcGrp->SetBool(text(0).toLatin1(), val); } #include "moc_DlgParameterImp.cpp" diff --git a/src/Gui/DlgTipOfTheDayImp.cpp b/src/Gui/DlgTipOfTheDayImp.cpp index 5a4b8d164..4d7113127 100644 --- a/src/Gui/DlgTipOfTheDayImp.cpp +++ b/src/Gui/DlgTipOfTheDayImp.cpp @@ -104,7 +104,7 @@ void DlgTipOfTheDayImp::onResponseHeaderReceived(const QHttpResponseHeader & res { if (responseHeader.statusCode() != 200) { QString msg = tr("Download failed: %1\n").arg(responseHeader.reasonPhrase()); - Base::Console().Log(msg.toAscii()); + Base::Console().Log(msg.toLatin1()); _http->abort(); } } @@ -143,7 +143,7 @@ void DlgTipOfTheDayImp::onStateChanged (int state) break; case QHttp::Closing: case QHttp::Unconnected: - Base::Console().Log("%s\n",(const char*)_http->errorString().toAscii()); + Base::Console().Log("%s\n",(const char*)_http->errorString().toLatin1()); break; default: break; diff --git a/src/Gui/DlgToolbarsImp.cpp b/src/Gui/DlgToolbarsImp.cpp index 4d75ddd22..6b89a8425 100644 --- a/src/Gui/DlgToolbarsImp.cpp +++ b/src/Gui/DlgToolbarsImp.cpp @@ -185,7 +185,7 @@ void DlgCustomToolbars::hideEvent(QHideEvent * event) { QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); CustomizeActionPage::hideEvent(event); } @@ -197,7 +197,7 @@ void DlgCustomToolbars::on_categoryBox_activated(int index) commandTreeWidget->clear(); CommandManager & cCmdMgr = Application::Instance->commandManager(); - std::vector aCmds = cCmdMgr.getGroupCommands(group.toAscii()); + std::vector aCmds = cCmdMgr.getGroupCommands(group.toLatin1()); // Create a separator item QTreeWidgetItem* sepitem = new QTreeWidgetItem(commandTreeWidget); @@ -235,7 +235,7 @@ void DlgCustomToolbars::on_workbenchBox_activated(int index) QString workbench = data.toString(); toolbarTreeWidget->clear(); - QByteArray workbenchname = workbench.toAscii(); + QByteArray workbenchname = workbench.toLatin1(); importCustomToolbars(workbenchname); } @@ -303,7 +303,7 @@ void DlgCustomToolbars::exportCustomToolbars(const QByteArray& workbench) QTreeWidgetItem* toplevel = toolbarTreeWidget->topLevelItem(i); QString groupName = QString::fromAscii("Custom_%1").arg(i+1); QByteArray toolbarName = toplevel->text(0).toUtf8(); - ParameterGrp::handle hToolGrp = hGrp->GetGroup(groupName.toAscii()); + ParameterGrp::handle hToolGrp = hGrp->GetGroup(groupName.toLatin1()); hToolGrp->SetASCII("Name", toolbarName.constData()); hToolGrp->SetBool("Active", toplevel->checkState(0) == Qt::Checked); @@ -352,7 +352,7 @@ void DlgCustomToolbars::on_moveActionRightButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } /** Removes an action */ @@ -386,7 +386,7 @@ void DlgCustomToolbars::on_moveActionLeftButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } /** Moves up an action */ @@ -424,7 +424,7 @@ void DlgCustomToolbars::on_moveActionUpButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } /** Moves down an action */ @@ -462,7 +462,7 @@ void DlgCustomToolbars::on_moveActionDownButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } void DlgCustomToolbars::on_newButton_clicked() @@ -488,7 +488,7 @@ void DlgCustomToolbars::on_newButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); addCustomToolbar(text); } } @@ -505,7 +505,7 @@ void DlgCustomToolbars::on_deleteButton_clicked() QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } void DlgCustomToolbars::on_renameButton_clicked() @@ -537,7 +537,7 @@ void DlgCustomToolbars::on_renameButton_clicked() if (renamed) { QVariant data = workbenchBox->itemData(workbenchBox->currentIndex(), Qt::UserRole); QString workbench = data.toString(); - exportCustomToolbars(workbench.toAscii()); + exportCustomToolbars(workbench.toLatin1()); } } diff --git a/src/Gui/DlgWorkbenchesImp.cpp b/src/Gui/DlgWorkbenchesImp.cpp index 5fcc31330..f87104d90 100644 --- a/src/Gui/DlgWorkbenchesImp.cpp +++ b/src/Gui/DlgWorkbenchesImp.cpp @@ -245,14 +245,14 @@ void DlgWorkbenchesImp::save_workbenches() enabled_wbs.append(name + QString::fromAscii(",")); } } - hGrp->SetASCII("Enabled", enabled_wbs.toAscii()); + hGrp->SetASCII("Enabled", enabled_wbs.toLatin1()); for (int i = 0; i < lw_disabled_workbenches->count(); i++) { QVariant item_data = lw_disabled_workbenches->item(i)->data(Qt::UserRole); QString name = item_data.toString(); disabled_wbs.append(name + QString::fromAscii(",")); } - hGrp->SetASCII("Disabled", disabled_wbs.toAscii()); + hGrp->SetASCII("Disabled", disabled_wbs.toLatin1()); } #include "moc_DlgWorkbenchesImp.cpp" diff --git a/src/Gui/DockWindowManager.cpp b/src/Gui/DockWindowManager.cpp index 919abf84f..fbc6b0709 100644 --- a/src/Gui/DockWindowManager.cpp +++ b/src/Gui/DockWindowManager.cpp @@ -243,7 +243,7 @@ void DockWindowManager::removeDockWindow(QWidget* widget) void DockWindowManager::retranslate() { for (QList::Iterator it = d->_dockedWindows.begin(); it != d->_dockedWindows.end(); ++it) { - (*it)->setWindowTitle(QDockWidget::tr((*it)->objectName().toAscii())); + (*it)->setWindowTitle(QDockWidget::tr((*it)->objectName().toLatin1())); } } @@ -290,7 +290,7 @@ void DockWindowManager::setup(DockWindowItems* items) QList areas[4]; for (QList::ConstIterator it = dws.begin(); it != dws.end(); ++it) { QDockWidget* dw = findDockWidget(docked, it->name); - QByteArray dockName = it->name.toAscii(); + QByteArray dockName = it->name.toLatin1(); bool visible = hPref->GetBool(dockName.constData(), it->visibility); if (!dw) { diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 27baf802e..aa7863c95 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -891,7 +891,7 @@ void Document::SaveDocFile (Base::Writer &writer) const writer.incInd(); // indentation for camera settings writer.Stream() << writer.ind() << "" << std::endl; + << (const char*)viewPos.toLatin1() <<"\"/>" << std::endl; writer.decInd(); // indentation for camera settings writer.Stream() << "" << std::endl; } diff --git a/src/Gui/DownloadItem.cpp b/src/Gui/DownloadItem.cpp index b1d15ec7d..b7ae3e6ec 100644 --- a/src/Gui/DownloadItem.cpp +++ b/src/Gui/DownloadItem.cpp @@ -367,12 +367,12 @@ void DownloadItem::open() if (doc) { for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { Gui::Application::Instance->importFrom(it.key().toUtf8(), - doc->getDocument()->getName(), it.value().toAscii()); + doc->getDocument()->getName(), it.value().toLatin1()); } } else { for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { - Gui::Application::Instance->open(it.key().toUtf8(), it.value().toAscii()); + Gui::Application::Instance->open(it.key().toUtf8(), it.value().toLatin1()); } } } diff --git a/src/Gui/FileDialog.cpp b/src/Gui/FileDialog.cpp index 9ce080fdd..51de32e8f 100644 --- a/src/Gui/FileDialog.cpp +++ b/src/Gui/FileDialog.cpp @@ -799,11 +799,11 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) { QFileInfo fi(*it); QString ext = fi.completeSuffix().toLower(); - std::map filters = App::GetApplication().getExportFilters(ext.toAscii()); + std::map filters = App::GetApplication().getExportFilters(ext.toLatin1()); if (filters.empty()) { ext = fi.suffix().toLower(); - filters = App::GetApplication().getExportFilters(ext.toAscii()); + filters = App::GetApplication().getExportFilters(ext.toLatin1()); } fileExtension[ext].push_back(*it); @@ -861,11 +861,11 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con for (QStringList::const_iterator it = fileNames.begin(); it != fileNames.end(); ++it) { QFileInfo fi(*it); QString ext = fi.completeSuffix().toLower(); - std::map filters = App::GetApplication().getImportFilters(ext.toAscii()); + std::map filters = App::GetApplication().getImportFilters(ext.toLatin1()); if (filters.empty()) { ext = fi.suffix().toLower(); - filters = App::GetApplication().getImportFilters(ext.toAscii()); + filters = App::GetApplication().getImportFilters(ext.toLatin1()); } fileExtension[ext].push_back(*it); diff --git a/src/Gui/HelpView.cpp b/src/Gui/HelpView.cpp index bd4773afe..44c926237 100644 --- a/src/Gui/HelpView.cpp +++ b/src/Gui/HelpView.cpp @@ -469,7 +469,7 @@ void TextBrowser::dropEvent(QDropEvent * e) dataStream >> action; CommandManager& rclMan = Application::Instance->commandManager(); - Command* pCmd = rclMan.getCommandByName(action.toAscii()); + Command* pCmd = rclMan.getCommandByName(action.toLatin1()); if ( pCmd ) { QString info = pCmd->getAction()->whatsThis(); if ( !info.isEmpty() ) { diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 6d4767aa1..88dc460da 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1444,10 +1444,10 @@ void MainWindow::loadUrls(App::Document* doc, const QList& url) if (info.isSymLink()) info.setFile(info.readLink()); std::vector module = App::GetApplication() - .getImportModules(info.completeSuffix().toAscii()); + .getImportModules(info.completeSuffix().toLatin1()); if (module.empty()) { module = App::GetApplication() - .getImportModules(info.suffix().toAscii()); + .getImportModules(info.suffix().toLatin1()); } if (!module.empty()) { // ok, we support files with this extension @@ -1483,7 +1483,7 @@ void MainWindow::loadUrls(App::Document* doc, const QList& url) // load the files with the associated modules for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { // if the passed document name doesn't exist the module should create it, if needed - Application::Instance->importFrom(it.key().toUtf8(), docName, it.value().toAscii()); + Application::Instance->importFrom(it.key().toUtf8(), docName, it.value().toLatin1()); } } @@ -1576,7 +1576,7 @@ void MainWindow::customEvent(QEvent* e) if (d) { ViewProviderExtern *view = new ViewProviderExtern(); try { - view->setModeByString("1",msg.toAscii().constData()); + view->setModeByString("1",msg.toLatin1().constData()); d->setAnnotationViewProvider("Vdbg",view); } catch (...) { diff --git a/src/Gui/NetworkRetriever.cpp b/src/Gui/NetworkRetriever.cpp index bb224c415..c7552416c 100644 --- a/src/Gui/NetworkRetriever.cpp +++ b/src/Gui/NetworkRetriever.cpp @@ -118,7 +118,7 @@ void NetworkRetriever::testFailure() if ( wget->state() == QProcess::Running ) { d->fail = false; - Base::Console().Message( tr("Download started...\n").toAscii() ); + Base::Console().Message( tr("Download started...\n").toLatin1() ); } } @@ -264,7 +264,7 @@ bool NetworkRetriever::startDownload( const QString& startUrl ) { if ( dir.mkdir( d->dir ) == false) { - Base::Console().Error("Directory '%s' could not be created.", (const char*)d->dir.toAscii()); + Base::Console().Error("Directory '%s' could not be created.", (const char*)d->dir.toLatin1()); return true; // please, no error message } } @@ -489,7 +489,7 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg) QString path = QString::fromUtf8(App::GetApplication().getHomePath()); path += QString::fromAscii("/doc/"); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/OnlineHelp"); - path = QString::fromUtf8(hURLGrp->GetASCII( "DownloadLocation", path.toAscii() ).c_str()); + path = QString::fromUtf8(hURLGrp->GetASCII( "DownloadLocation", path.toLatin1() ).c_str()); while (loop > 0) { loop--; diff --git a/src/Gui/OnlineDocumentation.cpp b/src/Gui/OnlineDocumentation.cpp index d19c0f843..e19e681c6 100644 --- a/src/Gui/OnlineDocumentation.cpp +++ b/src/Gui/OnlineDocumentation.cpp @@ -146,7 +146,7 @@ QByteArray OnlineDocumentation::loadResource(const QString& filename) const std::string path = App::GetApplication().getHomePath(); path += "/doc/docs.zip"; zipios::ZipFile zip(path); - zipios::ConstEntryPointer entry = zip.getEntry((const char*)fn.toAscii()); + zipios::ConstEntryPointer entry = zip.getEntry((const char*)fn.toLatin1()); std::istream* str = zip.getInputStream(entry); // set size of the array so that no re-allocation is needed when reading from the stream diff --git a/src/Gui/Placement.cpp b/src/Gui/Placement.cpp index 0902f0dba..c0dfa136e 100644 --- a/src/Gui/Placement.cpp +++ b/src/Gui/Placement.cpp @@ -230,7 +230,7 @@ void Placement::applyPlacement(const QString& data, bool incremental) .arg(data); } - Application::Instance->runPythonCode((const char*)cmd.toAscii()); + Application::Instance->runPythonCode((const char*)cmd.toLatin1()); } } diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index 35f096231..a2e1279b4 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -319,8 +319,8 @@ bool InteractiveInterpreter::push(const char* line) d->buffer.append(QString::fromAscii(line)); QString source = d->buffer.join(QLatin1String("\n")); try { - // Source is already UTF-8, so we can use toAscii() - bool more = runSource(source.toAscii()); + // Source is already UTF-8, so we can use toLatin1() + bool more = runSource(source.toLatin1()); if (!more) d->buffer.clear(); return more; diff --git a/src/Gui/PythonConsolePy.cpp b/src/Gui/PythonConsolePy.cpp index 63419026c..67496549f 100644 --- a/src/Gui/PythonConsolePy.cpp +++ b/src/Gui/PythonConsolePy.cpp @@ -344,5 +344,5 @@ Py::Object PythonStdin::repr() Py::Object PythonStdin::readline(const Py::Tuple& args) { - return Py::String( (const char *)pyConsole->readline().toAscii() ); + return Py::String( (const char *)pyConsole->readline().toLatin1() ); } diff --git a/src/Gui/Quarter/KeyboardP.cpp b/src/Gui/Quarter/KeyboardP.cpp index e51e08e9b..6854ffae7 100644 --- a/src/Gui/Quarter/KeyboardP.cpp +++ b/src/Gui/Quarter/KeyboardP.cpp @@ -83,7 +83,7 @@ KeyboardP::keyEvent(QKeyEvent * qevent) //Need to use a temporary to avoid reference becoming deleted before //we get a hold of it. - QByteArray tmp = qevent->text().toAscii(); + QByteArray tmp = qevent->text().toLatin1(); const char * printable = tmp.constData(); this->keyboard->setPrintableCharacter(*printable); this->keyboard->setKey(sokey); diff --git a/src/Gui/SelectionView.cpp b/src/Gui/SelectionView.cpp index 7ed1a9b7f..da9985d50 100644 --- a/src/Gui/SelectionView.cpp +++ b/src/Gui/SelectionView.cpp @@ -195,9 +195,9 @@ void SelectionView::select(QListWidgetItem* item) elements[1] = elements[1].split(QString::fromAscii(" "))[0]; //Gui::Selection().clearSelection(); Gui::Command::runCommand(Gui::Command::Gui,"Gui.Selection.clearSelection()"); - //Gui::Selection().addSelection(elements[0].toAscii(),elements[1].toAscii(),0); + //Gui::Selection().addSelection(elements[0].toLatin1(),elements[1].toLatin1(),0); QString cmd = QString::fromAscii("Gui.Selection.addSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1()); } void SelectionView::deselect(void) @@ -208,9 +208,9 @@ void SelectionView::deselect(void) QStringList elements = item->text().split(QString::fromAscii(".")); // remove possible space from object name followed by label elements[1] = elements[1].split(QString::fromAscii(" "))[0]; - //Gui::Selection().rmvSelection(elements[0].toAscii(),elements[1].toAscii(),0); + //Gui::Selection().rmvSelection(elements[0].toLatin1(),elements[1].toLatin1(),0); QString cmd = QString::fromAscii("Gui.Selection.removeSelection(App.getDocument(\"%1\").getObject(\"%2\"))").arg(elements[0]).arg(elements[1]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1()); } void SelectionView::zoom(void) @@ -235,14 +235,14 @@ void SelectionView::toPython(void) elements[1] = elements[1].split(QString::fromAscii(" "))[0]; QString cmd = QString::fromAscii("obj = App.getDocument(\"%1\").getObject(\"%2\")").arg(elements[0]).arg(elements[1]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1()); if (elements.length() > 2) { elements[2] = elements[2].split(QString::fromAscii(" "))[0]; if ( elements[2].contains(QString::fromAscii("Face")) || elements[2].contains(QString::fromAscii("Edge")) ) { cmd = QString::fromAscii("shp = App.getDocument(\"%1\").getObject(\"%2\").Shape").arg(elements[0]).arg(elements[1]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1()); cmd = QString::fromAscii("elt = App.getDocument(\"%1\").getObject(\"%2\").Shape.%3").arg(elements[0]).arg(elements[1]).arg(elements[2]); - Gui::Command::runCommand(Gui::Command::Gui,cmd.toAscii()); + Gui::Command::runCommand(Gui::Command::Gui,cmd.toLatin1()); } } } diff --git a/src/Gui/SoFCOffscreenRenderer.cpp b/src/Gui/SoFCOffscreenRenderer.cpp index 90a9ddd1e..fd8bff30a 100644 --- a/src/Gui/SoFCOffscreenRenderer.cpp +++ b/src/Gui/SoFCOffscreenRenderer.cpp @@ -286,7 +286,7 @@ std::string SoFCOffscreenRenderer::createMIBA(const SbMatrix& mat) const com << " \n" ; com << " \n" ; com << " Unknown\n" ; - com << " " << QDateTime::currentDateTime().toString().toAscii().constData() << "\n" ; + com << " " << QDateTime::currentDateTime().toString().toLatin1().constData() << "\n" ; com << " " << App::GetApplication().getExecutableName() << " " << major << "." << minor << "\n" ; com << " Unknown\n"; com << " 1.0\n"; diff --git a/src/Gui/TaskView/TaskAppearance.cpp b/src/Gui/TaskView/TaskAppearance.cpp index 85b208f89..3013b8bf6 100644 --- a/src/Gui/TaskView/TaskAppearance.cpp +++ b/src/Gui/TaskView/TaskAppearance.cpp @@ -142,14 +142,14 @@ void TaskAppearance::on_changeMode_activated(const QString& s) App::Property* prop = (*It)->getPropertyByName("DisplayMode"); if (prop && prop->getTypeId() == App::PropertyEnumeration::getClassTypeId()) { App::PropertyEnumeration* Display = (App::PropertyEnumeration*)prop; - Display->setValue((const char*)s.toAscii()); + Display->setValue((const char*)s.toLatin1()); } } } void TaskAppearance::on_changePlot_activated(const QString&s) { - Base::Console().Log("Plot = %s\n",(const char*)s.toAscii()); + Base::Console().Log("Plot = %s\n",(const char*)s.toLatin1()); } /** diff --git a/src/Gui/ViewProviderAnnotation.cpp b/src/Gui/ViewProviderAnnotation.cpp index 9dae716e5..97ae482f2 100644 --- a/src/Gui/ViewProviderAnnotation.cpp +++ b/src/Gui/ViewProviderAnnotation.cpp @@ -263,7 +263,7 @@ ViewProviderAnnotationLabel::ViewProviderAnnotationLabel() Justification.setEnums(JustificationEnums); QFont fn; ADD_PROPERTY(FontSize,(fn.pointSize())); - ADD_PROPERTY(FontName,((const char*)fn.family().toAscii())); + ADD_PROPERTY(FontName,((const char*)fn.family().toLatin1())); ADD_PROPERTY(Frame,(true)); pColor = new SoBaseColor(); diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 1b22eb993..e8bb3ac27 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -549,8 +549,8 @@ QWidget* UiLoader::createWidget(const QString & className, QWidget * parent, if (this->cw.contains(className)) return QUiLoader::createWidget(className, parent, name); QWidget* w = 0; - if (WidgetFactory().CanProduce((const char*)className.toAscii())) - w = WidgetFactory().createWidget((const char*)className.toAscii(), parent); + if (WidgetFactory().CanProduce((const char*)className.toLatin1())) + w = WidgetFactory().createWidget((const char*)className.toLatin1(), parent); if (w) w->setObjectName(name); return w; } @@ -1055,7 +1055,7 @@ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb) if (objS) { SignalConnect* sc = new SignalConnect(this, cb); mySingals.push_back(sc); - return QObject::connect(objS, sigStr.toAscii(), sc, SLOT ( onExecute() ) ); + return QObject::connect(objS, sigStr.toLatin1(), sc, SLOT ( onExecute() ) ); } else qWarning( "'%s' does not exist.\n", sender ); @@ -1165,14 +1165,14 @@ PyObject *PyResource::value(PyObject *args) int nSize = str.count(); PyObject* slist = PyList_New(nSize); for (int i=0; i_url.toAscii()); + PyObject* args = Py_BuildValue("(s)", (const char*)this->_url.toLatin1()); PyObject* result = PyEval_CallObject(func,args); // decrement the args and module reference Py_XDECREF(result); diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 8897c2ea9..71733c5c7 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -2428,8 +2428,8 @@ LinkSelection::~LinkSelection() void LinkSelection::select() { Gui::Selection().clearSelection(); - Gui::Selection().addSelection((const char*)link[0].toAscii(), - (const char*)link[1].toAscii()); + Gui::Selection().addSelection((const char*)link[0].toLatin1(), + (const char*)link[1].toLatin1()); this->deleteLater(); } diff --git a/src/Mod/Drawing/Gui/Command.cpp b/src/Mod/Drawing/Gui/Command.cpp index 741df37fb..299aeddee 100644 --- a/src/Mod/Drawing/Gui/Command.cpp +++ b/src/Mod/Drawing/Gui/Command.cpp @@ -165,7 +165,7 @@ Gui::Action * CmdDrawingNewPage::createAction(void) if (file.open(QFile::ReadOnly)) { QString s = QString::fromAscii("style=\"font-size:22px\">%1%2").arg(paper).arg(id); QByteArray data = file.readAll(); - data.replace("style=\"font-size:22px\">A0", s.toAscii()); + data.replace("style=\"font-size:22px\">A0", s.toLatin1()); a->setIcon(Gui::BitmapFactory().pixmapFromSvg(data, QSize(64,64))); } diff --git a/src/Mod/Inspection/Gui/VisualInspection.cpp b/src/Mod/Inspection/Gui/VisualInspection.cpp index f5eb625d4..6365bb1ca 100644 --- a/src/Mod/Inspection/Gui/VisualInspection.cpp +++ b/src/Mod/Inspection/Gui/VisualInspection.cpp @@ -221,15 +221,15 @@ void VisualInspection::accept() if (sel->checkState(0) == Qt::Checked) { QString actualName = sel->data(0, Qt::UserRole).toString(); Gui::Application::Instance->runCommand( - true, "App_activeDocument___InspectionGroup.newObject(\"Inspection::Feature\",\"%s_Inspect\")", (const char*)actualName.toAscii()); + true, "App_activeDocument___InspectionGroup.newObject(\"Inspection::Feature\",\"%s_Inspect\")", (const char*)actualName.toLatin1()); Gui::Application::Instance->runCommand( true, "App.ActiveDocument.ActiveObject.Actual=App.ActiveDocument.%s\n" "App_activeDocument___activeObject___Nominals=list()\n" "App.ActiveDocument.ActiveObject.SearchRadius=%.3f\n" - "App.ActiveDocument.ActiveObject.Thickness=%.3f\n", (const char*)actualName.toAscii(), searchRadius, thickness); + "App.ActiveDocument.ActiveObject.Thickness=%.3f\n", (const char*)actualName.toLatin1(), searchRadius, thickness); for (QStringList::Iterator it = nominalNames.begin(); it != nominalNames.end(); ++it) { Gui::Application::Instance->runCommand( - true, "App_activeDocument___activeObject___Nominals.append(App.ActiveDocument.%s)\n", (const char*)(*it).toAscii()); + true, "App_activeDocument___activeObject___Nominals.append(App.ActiveDocument.%s)\n", (const char*)(*it).toLatin1()); } Gui::Application::Instance->runCommand( true, "App.ActiveDocument.ActiveObject.Nominals=App_activeDocument___activeObject___Nominals\n" @@ -249,7 +249,7 @@ void VisualInspection::accept() if (sel->checkState(0) == Qt::Checked) { Gui::Application::Instance->runCommand( true, "Gui.ActiveDocument.getObject(\"%s\").Visibility=False" - , (const char*)sel->data(0, Qt::UserRole).toString().toAscii()); + , (const char*)sel->data(0, Qt::UserRole).toString().toLatin1()); } } @@ -258,7 +258,7 @@ void VisualInspection::accept() if (sel->checkState(0) == Qt::Checked) { Gui::Application::Instance->runCommand( true, "Gui.ActiveDocument.getObject(\"%s\").Visibility=False" - , (const char*)sel->data(0, Qt::UserRole).toString().toAscii()); + , (const char*)sel->data(0, Qt::UserRole).toString().toLatin1()); } } } diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index 7ad0de47f..1a607760d 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -468,7 +468,7 @@ void CmdMeshExport::activated(int iMsg) QObject::tr("Export mesh"), dir, filter.join(QLatin1String(";;")), &format); if (!fn.isEmpty()) { QFileInfo fi(fn); - QByteArray extension = fi.suffix().toAscii(); + QByteArray extension = fi.suffix().toLatin1(); for (QList >::iterator it = ext.begin(); it != ext.end(); ++it) { if (it->first == format) { extension = it->second; diff --git a/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp b/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp index bffcfc624..ca555e17a 100644 --- a/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp +++ b/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp @@ -202,7 +202,7 @@ void MeshGui::DlgRegularSolidImp::on_createSolidButton_clicked() // Execute the Python block QString solid = tr("Create %1").arg(comboBox1->currentText()); Gui::Application::Instance->activeDocument()->openCommand(solid.toUtf8()); - Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toAscii()); + Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toLatin1()); Gui::Application::Instance->activeDocument()->commitCommand(); Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().recompute()"); Gui::Command::doCommand(Gui::Command::Gui, "Gui.SendMsgToActiveView(\"ViewFit\")"); diff --git a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp index 8ce4a3180..558c624fe 100644 --- a/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderCurvature.cpp @@ -450,7 +450,7 @@ public: QStringList lines = s.split(QLatin1String("\n")); std::vector text; for (QStringList::Iterator it = lines.begin(); it != lines.end(); ++it) - text.push_back((const char*)it->toAscii()); + text.push_back((const char*)it->toLatin1()); anno->LabelText.setValues(text); std::stringstream str; str << "Curvature info (" << group->Group.getSize() << ")"; diff --git a/src/Mod/MeshPart/Gui/Tessellation.cpp b/src/Mod/MeshPart/Gui/Tessellation.cpp index 611898947..871fcf43f 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.cpp +++ b/src/Mod/MeshPart/Gui/Tessellation.cpp @@ -223,7 +223,7 @@ bool Tessellation::accept() return false; } - App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toAscii()); + App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toLatin1()); if (!activeDoc) { QMessageBox::critical(this, windowTitle(), tr("No such document '%1'.").arg(this->document)); diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index 8733ff4dd..af5236d42 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -820,8 +820,8 @@ void CmdPartImportCurveNet::activated(int iMsg) if (!fn.isEmpty()) { QFileInfo fi; fi.setFile(fn); openCommand("Part Import Curve Net"); - doCommand(Doc,"f = App.activeDocument().addObject(\"Part::CurveNet\",\"%s\")", (const char*)fi.baseName().toAscii()); - doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toAscii()); + doCommand(Doc,"f = App.activeDocument().addObject(\"Part::CurveNet\",\"%s\")", (const char*)fi.baseName().toLatin1()); + doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toLatin1()); commitCommand(); updateActive(); } @@ -896,7 +896,7 @@ void CmdPartMakeSolid::activated(int iMsg) try { if (!str.isEmpty()) - doCommand(Doc, (const char*)str.toAscii()); + doCommand(Doc, (const char*)str.toLatin1()); } catch (const Base::Exception& e) { Base::Console().Error("Cannot convert %s because %s.\n", @@ -950,7 +950,7 @@ void CmdPartReverseShape::activated(int iMsg) try { if (!str.isEmpty()) - doCommand(Doc, (const char*)str.toAscii()); + doCommand(Doc, (const char*)str.toLatin1()); } catch (const Base::Exception& e) { Base::Console().Error("Cannot convert %s because %s.\n", diff --git a/src/Mod/Part/Gui/CrossSections.cpp b/src/Mod/Part/Gui/CrossSections.cpp index 9fc77d269..d68290a9d 100644 --- a/src/Mod/Part/Gui/CrossSections.cpp +++ b/src/Mod/Part/Gui/CrossSections.cpp @@ -244,13 +244,13 @@ void CrossSections::apply() "wires=list()\n" "shape=FreeCAD.getDocument(\"%1\").%2.Shape\n") .arg(QLatin1String(doc->getName())) - .arg(QLatin1String((*it)->getNameInDocument())).toAscii()); + .arg(QLatin1String((*it)->getNameInDocument())).toLatin1()); for (std::vector::iterator jt = d.begin(); jt != d.end(); ++jt) { app->runPythonCode(QString::fromAscii( "for i in shape.slice(Base.Vector(%1,%2,%3),%4):\n" " wires.append(i)\n" - ).arg(a).arg(b).arg(c).arg(*jt).toAscii()); + ).arg(a).arg(b).arg(c).arg(*jt).toLatin1()); seq.next(); } @@ -261,7 +261,7 @@ void CrossSections::apply() "slice.purgeTouched()\n" "del slice,comp,wires,shape") .arg(QLatin1String(doc->getName())) - .arg(QLatin1String(s.c_str())).toAscii()); + .arg(QLatin1String(s.c_str())).toLatin1()); seq.next(); } diff --git a/src/Mod/Part/Gui/DlgExtrusion.cpp b/src/Mod/Part/Gui/DlgExtrusion.cpp index f67b17bb8..5ac7050d9 100644 --- a/src/Mod/Part/Gui/DlgExtrusion.cpp +++ b/src/Mod/Part/Gui/DlgExtrusion.cpp @@ -187,7 +187,7 @@ void DlgExtrusion::apply() bool makeSolid = ui->makeSolid->isChecked(); // inspect geometry - App::DocumentObject* obj = activeDoc->getObject((const char*)shape.toAscii()); + App::DocumentObject* obj = activeDoc->getObject((const char*)shape.toLatin1()); if (!obj || !obj->isDerivedFrom(Part::Feature::getClassTypeId())) continue; Part::Feature* fea = static_cast(obj); const TopoDS_Shape& data = fea->Shape.getValue(); @@ -227,9 +227,9 @@ void DlgExtrusion::apply() .arg(makeSolid ? QLatin1String("True") : QLatin1String("False")) .arg(angle) .arg(label); - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); - QByteArray to = name.toAscii(); - QByteArray from = shape.toAscii(); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); + QByteArray to = name.toLatin1(); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual(to, "ShapeColor", from); Gui::Command::copyVisual(to, "LineColor", from); Gui::Command::copyVisual(to, "PointColor", from); diff --git a/src/Mod/Part/Gui/DlgFilletEdges.cpp b/src/Mod/Part/Gui/DlgFilletEdges.cpp index 993c1d34a..723554278 100644 --- a/src/Mod/Part/Gui/DlgFilletEdges.cpp +++ b/src/Mod/Part/Gui/DlgFilletEdges.cpp @@ -413,7 +413,7 @@ void DlgFilletEdges::onSelectEdgesOfFace(const QString& subelement, int type) Gui::SelectionChanges::MsgType msgType = Gui::SelectionChanges::MsgType(type); if (msgType == Gui::SelectionChanges::AddSelection) { Gui::Selection().addSelection(d->object->getDocument()->getName(), - d->object->getNameInDocument(), (const char*)name.toAscii()); + d->object->getNameInDocument(), (const char*)name.toLatin1()); } } } @@ -483,13 +483,13 @@ void DlgFilletEdges::toggleCheckState(const QModelIndex& index) App::Document* doc = d->object->getDocument(); Gui::Selection().addSelection(doc->getName(), d->object->getNameInDocument(), - (const char*)name.toAscii()); + (const char*)name.toLatin1()); } else { App::Document* doc = d->object->getDocument(); Gui::Selection().rmvSelection(doc->getName(), d->object->getNameInDocument(), - (const char*)name.toAscii()); + (const char*)name.toLatin1()); } this->blockConnection(block); @@ -870,7 +870,7 @@ bool DlgFilletEdges::accept() "del __fillets__\n" "FreeCADGui.ActiveDocument.%2.Visibility = False\n") .arg(name).arg(shape); - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); activeDoc->commitTransaction(); activeDoc->recompute(); if (d->fillet) { @@ -879,8 +879,8 @@ bool DlgFilletEdges::accept() if (vp) vp->show(); } - QByteArray to = name.toAscii(); - QByteArray from = shape.toAscii(); + QByteArray to = name.toLatin1(); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual(to, "LineColor", from); Gui::Command::copyVisual(to, "PointColor", from); return true; diff --git a/src/Mod/Part/Gui/DlgPrimitives.cpp b/src/Mod/Part/Gui/DlgPrimitives.cpp index ceaaded93..83eb4245f 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.cpp +++ b/src/Mod/Part/Gui/DlgPrimitives.cpp @@ -102,7 +102,7 @@ void Picker::createPrimitive(QWidget* widget, const QString& descr, Gui::Documen // Execute the Python block doc->openCommand(descr.toUtf8()); - Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toAscii()); + Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toLatin1()); doc->commitCommand(); Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()"); Gui::Command::doCommand(Gui::Command::Gui, "Gui.SendMsgToActiveView(\"ViewFit\")"); diff --git a/src/Mod/Part/Gui/DlgRevolution.cpp b/src/Mod/Part/Gui/DlgRevolution.cpp index 99137d589..bca236c0c 100644 --- a/src/Mod/Part/Gui/DlgRevolution.cpp +++ b/src/Mod/Part/Gui/DlgRevolution.cpp @@ -212,9 +212,9 @@ void DlgRevolution::accept() .arg(ui->angle->value(),0,'f',2) .arg(solid) ; - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); - QByteArray to = name.toAscii(); - QByteArray from = shape.toAscii(); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); + QByteArray to = name.toLatin1(); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual(to, "ShapeColor", from); Gui::Command::copyVisual(to, "LineColor", from); Gui::Command::copyVisual(to, "PointColor", from); diff --git a/src/Mod/Part/Gui/Mirroring.cpp b/src/Mod/Part/Gui/Mirroring.cpp index 9e8094e22..464e0e3a1 100644 --- a/src/Mod/Part/Gui/Mirroring.cpp +++ b/src/Mod/Part/Gui/Mirroring.cpp @@ -123,7 +123,7 @@ bool Mirroring::accept() return false; } - App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toAscii()); + App::Document* activeDoc = App::GetApplication().getDocument((const char*)this->document.toLatin1()); if (!activeDoc) { QMessageBox::critical(this, windowTitle(), tr("No such document '%1'.").arg(this->document)); @@ -169,8 +169,8 @@ bool Mirroring::accept() .arg(this->document).arg(shape).arg(label) .arg(normx).arg(normy).arg(normz) .arg(basex).arg(basey).arg(basez); - Gui::Application::Instance->runPythonCode((const char*)code.toAscii()); - QByteArray from = shape.toAscii(); + Gui::Application::Instance->runPythonCode((const char*)code.toLatin1()); + QByteArray from = shape.toLatin1(); Gui::Command::copyVisual("ActiveObject", "ShapeColor", from); Gui::Command::copyVisual("ActiveObject", "LineColor", from); Gui::Command::copyVisual("ActiveObject", "PointColor", from); diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index 9b449968b..9f08a975e 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -561,7 +561,7 @@ void TaskCheckGeometryResults::buildShapeContent(const QString &baseName, const std::ostringstream stream; if (!shapeContentString.empty()) stream << std::endl << std::endl; - stream << baseName.toAscii().data() << ":" << std::endl; + stream << baseName.toLatin1().data() << ":" << std::endl; BRepTools_ShapeSet set; set.Add(shape); @@ -709,7 +709,7 @@ void TaskCheckGeometryResults::currentRowChanged (const QModelIndex ¤t, co QString doc, object, sub; if (!this->split((*stringIt), doc, object, sub)) continue; - Gui::Selection().addSelection(doc.toAscii(), object.toAscii(), sub.toAscii()); + Gui::Selection().addSelection(doc.toLatin1(), object.toLatin1(), sub.toLatin1()); } } } diff --git a/src/Mod/Part/Gui/TaskLoft.cpp b/src/Mod/Part/Gui/TaskLoft.cpp index ed6c7c323..0aeeb0986 100644 --- a/src/Mod/Part/Gui/TaskLoft.cpp +++ b/src/Mod/Part/Gui/TaskLoft.cpp @@ -175,7 +175,7 @@ bool LoftWidget::accept() Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str()); if (!doc) throw Base::Exception("Document doesn't exist anymore"); doc->openCommand("Loft"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); doc->getDocument()->recompute(); App::DocumentObject* obj = doc->getDocument()->getActiveObject(); if (obj && !obj->isValid()) { diff --git a/src/Mod/Part/Gui/TaskShapeBuilder.cpp b/src/Mod/Part/Gui/TaskShapeBuilder.cpp index d8b406a6a..a1bb39f7a 100644 --- a/src/Mod/Part/Gui/TaskShapeBuilder.cpp +++ b/src/Mod/Part/Gui/TaskShapeBuilder.cpp @@ -201,7 +201,7 @@ void ShapeBuilderWidget::createEdgeFromVertex() try { Gui::Application::Instance->activeDocument()->openCommand("Edge"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -253,7 +253,7 @@ void ShapeBuilderWidget::createFaceFromVertex() try { Gui::Application::Instance->activeDocument()->openCommand("Face"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -305,7 +305,7 @@ void ShapeBuilderWidget::createFaceFromEdge() try { Gui::Application::Instance->activeDocument()->openCommand("Face"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -358,7 +358,7 @@ void ShapeBuilderWidget::createShellFromFace() try { Gui::Application::Instance->activeDocument()->openCommand("Shell"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { @@ -398,7 +398,7 @@ void ShapeBuilderWidget::createSolidFromShell() try { Gui::Application::Instance->activeDocument()->openCommand("Solid"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); Gui::Application::Instance->activeDocument()->commitCommand(); } catch (const Base::Exception&) { diff --git a/src/Mod/Part/Gui/TaskSweep.cpp b/src/Mod/Part/Gui/TaskSweep.cpp index 6cc8bea51..91514314b 100644 --- a/src/Mod/Part/Gui/TaskSweep.cpp +++ b/src/Mod/Part/Gui/TaskSweep.cpp @@ -321,7 +321,7 @@ bool SweepWidget::accept() Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str()); if (!doc) throw Base::Exception("Document doesn't exist anymore"); doc->openCommand("Sweep"); - Gui::Application::Instance->runPythonCode((const char*)cmd.toAscii(), false, false); + Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false); doc->getDocument()->recompute(); App::DocumentObject* obj = doc->getDocument()->getActiveObject(); if (obj && !obj->isValid()) { diff --git a/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp b/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp index 0af2a0015..37cfb9ec8 100644 --- a/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp +++ b/src/Mod/PartDesign/Gui/FeaturePickDialog.cpp @@ -56,7 +56,7 @@ std::vector FeaturePickDialog::getFeatures() { std::vector result; for (std::vector::const_iterator s = features.begin(); s != features.end(); ++s) - result.push_back(App::GetApplication().getActiveDocument()->getObject(s->toAscii().data())); + result.push_back(App::GetApplication().getActiveDocument()->getObject(s->toLatin1().data())); return result; } diff --git a/src/Mod/Robot/Gui/CommandTrajectory.cpp b/src/Mod/Robot/Gui/CommandTrajectory.cpp index d110dd242..e947cae25 100644 --- a/src/Mod/Robot/Gui/CommandTrajectory.cpp +++ b/src/Mod/Robot/Gui/CommandTrajectory.cpp @@ -270,7 +270,7 @@ void CmdRobotSetDefaultValues::activated(int iMsg) QObject::tr("speed: (e.g. 1 m/s or 3 cm/s)"), QLineEdit::Normal, QString::fromAscii("1 m/s"), &ok); if ( ok && !text.isEmpty() ) { - doCommand(Doc,"_DefSpeed = '%s'",text.toAscii().constData()); + doCommand(Doc,"_DefSpeed = '%s'",text.toLatin1().constData()); } QStringList items; @@ -279,7 +279,7 @@ void CmdRobotSetDefaultValues::activated(int iMsg) QString item = QInputDialog::getItem(0, QObject::tr("set default continuity"), QObject::tr("continuous ?"), items, 0, false, &ok); if (ok && !item.isEmpty()) - doCommand(Doc,"_DefCont = %s",item.toAscii().constData()); + doCommand(Doc,"_DefCont = %s",item.toLatin1().constData()); text.clear(); @@ -287,7 +287,7 @@ void CmdRobotSetDefaultValues::activated(int iMsg) QObject::tr("acceleration: (e.g. 1 m/s^2 or 3 cm/s^2)"), QLineEdit::Normal, QString::fromAscii("1 m/s^2"), &ok); if ( ok && !text.isEmpty() ) { - doCommand(Doc,"_DefAccelaration = '%s'",text.toAscii().constData()); + doCommand(Doc,"_DefAccelaration = '%s'",text.toLatin1().constData()); } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index fc4e78987..650929faa 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -568,7 +568,7 @@ void DrawSketchHandler::renderSuggestConstraintsCursor(std::vectorcombinedConstrBoxes[idString] = boundingBoxes; - thisInfo->string.setValue(idString.toAscii().data()); + thisInfo->string.setValue(idString.toLatin1().data()); sendConstraintIconToCoin(compositeIcon, thisDest); } @@ -2835,7 +2835,7 @@ QImage ViewProviderSketch::renderConstrIcon(const QString &type, // Constants to help create constraint icons QString joinStr = QString::fromAscii(", "); - QImage icon = Gui::BitmapFactory().pixmap(type.toAscii()).toImage(); + QImage icon = Gui::BitmapFactory().pixmap(type.toLatin1()).toImage(); QFont font = QApplication::font(); font.setPixelSize(11); @@ -2918,7 +2918,7 @@ void ViewProviderSketch::drawTypicalConstraintIcon(const constrIconQueueItem &i) QList() << color, i.iconRotation); - i.infoPtr->string.setValue(QString::number(i.constraintId).toAscii().data()); + i.infoPtr->string.setValue(QString::number(i.constraintId).toLatin1().data()); sendConstraintIconToCoin(image, i.destination); } diff --git a/src/Mod/Test/Gui/UnitTestPy.cpp b/src/Mod/Test/Gui/UnitTestPy.cpp index 2a9bda1b0..b434ae91a 100644 --- a/src/Mod/Test/Gui/UnitTestPy.cpp +++ b/src/Mod/Test/Gui/UnitTestPy.cpp @@ -116,7 +116,7 @@ Py::Object UnitTestDialogPy::getUnitTest(const Py::Tuple& args) { if (!PyArg_ParseTuple(args.ptr(), "")) throw Py::Exception(); - return Py::String((const char*)UnitTestDialog::instance()->getUnitTest().toAscii()); + return Py::String((const char*)UnitTestDialog::instance()->getUnitTest().toLatin1()); } Py::Object UnitTestDialogPy::setStatusText(const Py::Tuple& args)