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
d5c074f80d
commit
cd2db00f22
@@ -1050,7 +1050,7 @@ bool Application::activateWorkbench(const char* name)
|
||||
ok = true; // already active
|
||||
// now try to create and activate the matching workbench object
|
||||
else if (WorkbenchManager::instance()->activate(name, type)) {
|
||||
getMainWindow()->activateWorkbench(QString::fromAscii(name));
|
||||
getMainWindow()->activateWorkbench(QString::fromLatin1(name));
|
||||
this->signalActivateWorkbench(name);
|
||||
ok = true;
|
||||
}
|
||||
@@ -1095,7 +1095,7 @@ bool Application::activateWorkbench(const char* name)
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
QString msg = QString::fromAscii(e.what());
|
||||
QString msg = QString::fromLatin1(e.what());
|
||||
QRegExp rx;
|
||||
// ignore '<type 'exceptions.ImportError'>' prefixes
|
||||
rx.setPattern(QLatin1String("^\\s*<type 'exceptions.ImportError'>:\\s*"));
|
||||
@@ -1251,13 +1251,13 @@ QStringList Application::workbenches(void) const
|
||||
const char* start = (st != config.end() ? st->second.c_str() : "<none>");
|
||||
QStringList hidden, extra;
|
||||
if (ht != config.end()) {
|
||||
QString items = QString::fromAscii(ht->second.c_str());
|
||||
QString items = QString::fromLatin1(ht->second.c_str());
|
||||
hidden = items.split(QLatin1Char(';'), QString::SkipEmptyParts);
|
||||
if (hidden.isEmpty())
|
||||
hidden.push_back(QLatin1String(""));
|
||||
}
|
||||
if (et != config.end()) {
|
||||
QString items = QString::fromAscii(et->second.c_str());
|
||||
QString items = QString::fromLatin1(et->second.c_str());
|
||||
extra = items.split(QLatin1Char(';'), QString::SkipEmptyParts);
|
||||
if (extra.isEmpty())
|
||||
extra.push_back(QLatin1String(""));
|
||||
@@ -1273,18 +1273,18 @@ QStringList Application::workbenches(void) const
|
||||
// add only allowed workbenches
|
||||
bool ok = true;
|
||||
if (!extra.isEmpty()&&ok) {
|
||||
ok = (extra.indexOf(QString::fromAscii(wbName)) != -1);
|
||||
ok = (extra.indexOf(QString::fromLatin1(wbName)) != -1);
|
||||
}
|
||||
if (!hidden.isEmpty()&&ok) {
|
||||
ok = (hidden.indexOf(QString::fromAscii(wbName)) == -1);
|
||||
ok = (hidden.indexOf(QString::fromLatin1(wbName)) == -1);
|
||||
}
|
||||
|
||||
// okay the item is visible
|
||||
if (ok)
|
||||
wb.push_back(QString::fromAscii(wbName));
|
||||
wb.push_back(QString::fromLatin1(wbName));
|
||||
// also allow start workbench in case it is hidden
|
||||
else if (strcmp(wbName, start) == 0)
|
||||
wb.push_back(QString::fromAscii(wbName));
|
||||
wb.push_back(QString::fromLatin1(wbName));
|
||||
}
|
||||
|
||||
return wb;
|
||||
@@ -1718,7 +1718,7 @@ void Application::runApplication(void)
|
||||
// if the auto workbench is not visible then force to use the default workbech
|
||||
// and replace the wrong entry in the parameters
|
||||
QStringList wb = app.workbenches();
|
||||
if (!wb.contains(QString::fromAscii(start.c_str()))) {
|
||||
if (!wb.contains(QString::fromLatin1(start.c_str()))) {
|
||||
start = App::Application::Config()["StartWorkbench"];
|
||||
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
|
||||
SetASCII("AutoloadModule", start.c_str());
|
||||
@@ -1805,11 +1805,11 @@ void Application::runApplication(void)
|
||||
void Application::checkForPreviousCrashes()
|
||||
{
|
||||
QDir tmp = QString::fromUtf8(App::Application::getTempPath().c_str());
|
||||
tmp.setNameFilters(QStringList() << QString::fromAscii("*.lock"));
|
||||
tmp.setNameFilters(QStringList() << QString::fromLatin1("*.lock"));
|
||||
tmp.setFilter(QDir::Files);
|
||||
|
||||
QList<QFileInfo> restoreDocFiles;
|
||||
QString exeName = QString::fromAscii(App::GetApplication().getExecutableName());
|
||||
QString exeName = QString::fromLatin1(App::GetApplication().getExecutableName());
|
||||
QList<QFileInfo> locks = tmp.entryInfoList();
|
||||
for (QList<QFileInfo>::iterator it = locks.begin(); it != locks.end(); ++it) {
|
||||
QString bn = it->baseName();
|
||||
|
||||
Reference in New Issue
Block a user