Commit a24c1407 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Kai Koehne

QmlProjectManager: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: Icac2d84abc001c963d78aa9e95911110463b4b04
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent b562f817
......@@ -325,7 +325,7 @@ ImageFileFilterItem::ImageFileFilterItem(QObject *parent)
// supported image formats according to
QList<QByteArray> extensions = QImageReader::supportedImageFormats();
foreach (const QByteArray &extension, extensions) {
filter.append(QString("*.%1;").arg(QString::fromLatin1(extension)));
filter.append(QString::fromLatin1("*.%1;").arg(QString::fromLatin1(extension)));
}
setFilter(filter);
}
......
......@@ -105,7 +105,7 @@ Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters(ProjectTy
}
parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
parameters.setDisplayCategory(QT_TRANSLATE_NOOP("ProjectExplorer", "Qt Application"));
parameters.setDisplayCategory(QLatin1String(QT_TRANSLATE_NOOP("ProjectExplorer", "Qt Application")));
return parameters;
}
......
......@@ -77,7 +77,7 @@ QString QmlProjectFile::suggestedFileName() const
QString QmlProjectFile::mimeType() const
{
return Constants::QMLMIMETYPE;
return QLatin1String(Constants::QMLMIMETYPE);
}
bool QmlProjectFile::isModified() const
......
......@@ -7,7 +7,7 @@ include(../../qtcreatorplugin.pri)
include(qmlprojectmanager_dependencies.pri)
include(fileformat/fileformat.pri)
DEFINES += QMLPROJECTMANAGER_LIBRARY
DEFINES += QMLPROJECTMANAGER_LIBRARY QT_NO_CAST_FROM_ASCII
HEADERS += qmlproject.h \
qmlprojectplugin.h \
qmlprojectmanager.h \
......
......@@ -5,6 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "QmlProjectManager"
Depends { name: "cpp" }
Depends { name: "Qt"; submodules: ["widgets", "declarative"] }
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
......@@ -14,6 +15,7 @@ QtcPlugin {
Depends { name: "Debugger" }
Depends { name: "QtSupport" }
Depends { name: "app_version_header" }
cpp.defines: base.concat(["QMLPROJECTMANAGER_LIBRARY", "QT_NO_CAST_FROM_ASCII"])
files: [
"QmlProject.mimetypes.xml",
......
......@@ -103,7 +103,7 @@ void QmlProjectNode::refresh()
} else {
absoluteFilePath = m_project->projectDir().absoluteFilePath(fileInfo.filePath());
relativeDirectory = fileInfo.path();
if (relativeDirectory == ".")
if (relativeDirectory == QLatin1String("."))
relativeDirectory.clear();
}
......@@ -147,7 +147,7 @@ ProjectExplorer::FolderNode *QmlProjectNode::findOrCreateFolderByName(const QStr
else if (FolderNode *folder = m_folderByName.value(folderName))
return folder;
FolderNode *folder = new FolderNode(baseDir + '/' + folderName);
FolderNode *folder = new FolderNode(baseDir + QLatin1Char('/') + folderName);
folder->setDisplayName(component);
m_folderByName.insert(folderName, folder);
......
......@@ -89,7 +89,8 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
QmlProjectFileFormat::registerDeclarativeTypes();
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
iconProvider->registerIconOverlayForSuffix(QIcon(QLatin1String(":/qmlproject/images/qmlproject.png")), "qmlproject");
iconProvider->registerIconOverlayForSuffix(QIcon(QLatin1String(":/qmlproject/images/qmlproject.png")),
QLatin1String("qmlproject"));
return true;
}
......@@ -115,8 +116,8 @@ void QmlProjectPlugin::showQmlObserverToolWarning()
dialog.exec();
if (dialog.clickedButton() == qtPref) {
Core::ICore::showOptionsDialog(
ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY),
QLatin1String(QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID));
}
}
......
......@@ -59,7 +59,7 @@ const char * const M_CURRENT_FILE = "CurrentFile";
QmlProjectRunConfiguration::QmlProjectRunConfiguration(ProjectExplorer::Target *parent,
Core::Id id) :
ProjectExplorer::RunConfiguration(parent, id),
m_scriptFile(M_CURRENT_FILE),
m_scriptFile(QLatin1String(M_CURRENT_FILE)),
m_isEnabled(false)
{
ctor();
......@@ -145,7 +145,7 @@ QString QmlProjectRunConfiguration::viewerArguments() const
// arguments from .qmlproject file
QmlProject *project = static_cast<QmlProject *>(target()->project());
foreach (const QString &importPath, project->customImportPaths()) {
Utils::QtcProcess::addArg(&args, "-I");
Utils::QtcProcess::addArg(&args, QLatin1String("-I"));
Utils::QtcProcess::addArg(&args, importPath);
}
......@@ -230,7 +230,7 @@ void QmlProjectRunConfiguration::setScriptSource(MainScriptSource source,
const QString &settingsPath)
{
if (source == FileInEditor) {
m_scriptFile = M_CURRENT_FILE;
m_scriptFile = QLatin1String(M_CURRENT_FILE);
m_mainScriptFilename.clear();
} else if (source == FileInProjectFile) {
m_scriptFile.clear();
......@@ -273,11 +273,11 @@ QVariantMap QmlProjectRunConfiguration::toMap() const
bool QmlProjectRunConfiguration::fromMap(const QVariantMap &map)
{
m_qmlViewerArgs = map.value(QLatin1String(Constants::QML_VIEWER_ARGUMENTS_KEY)).toString();
m_scriptFile = map.value(QLatin1String(Constants::QML_MAINSCRIPT_KEY), M_CURRENT_FILE).toString();
m_scriptFile = map.value(QLatin1String(Constants::QML_MAINSCRIPT_KEY), QLatin1String(M_CURRENT_FILE)).toString();
m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(
map.value(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
if (m_scriptFile == M_CURRENT_FILE)
if (m_scriptFile == QLatin1String(M_CURRENT_FILE))
setScriptSource(FileInEditor);
else if (m_scriptFile.isEmpty())
setScriptSource(FileInProjectFile);
......@@ -338,8 +338,8 @@ void QmlProjectRunConfiguration::updateEnabled()
bool QmlProjectRunConfiguration::isValidVersion(QtSupport::BaseQtVersion *version)
{
if (version
&& (version->type() == QtSupport::Constants::DESKTOPQT
|| version->type() == QtSupport::Constants::SIMULATORQT)
&& (version->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|| version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT))
&& !version->qmlviewerCommand().isEmpty()) {
return true;
}
......
......@@ -138,7 +138,7 @@ void QmlProjectRunConfigurationWidget::updateFileComboBox()
m_fileListCombo->setEnabled(true);
m_fileListModel->clear();
m_fileListModel->appendRow(new QStandardItem(CURRENT_FILE));
m_fileListModel->appendRow(new QStandardItem(QLatin1String(CURRENT_FILE)));
QModelIndex currentIndex;
QStringList sortedFiles = project->files(ProjectExplorer::Project::AllFiles);
......
......@@ -104,7 +104,7 @@ bool QmlProjectRunControl::isRunning() const
QIcon QmlProjectRunControl::icon() const
{
return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL);
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
void QmlProjectRunControl::slotBringApplicationToForeground(qint64 pid)
......@@ -200,9 +200,9 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
Debugger::DebuggerStartParameters params;
params.startMode = Debugger::StartInternal;
params.executable = runConfig->observerPath();
params.qmlServerAddress = "127.0.0.1";
params.qmlServerAddress = QLatin1String("127.0.0.1");
params.qmlServerPort = runConfig->debuggerAspect()->qmlDebugServerPort();
params.processArgs = QString("-qmljsdebugger=port:%1,block").arg(params.qmlServerPort);
params.processArgs = QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(params.qmlServerPort);
params.processArgs += QLatin1Char(' ') + runConfig->viewerArguments();
params.workingDirectory = runConfig->workingDirectory();
params.environment = runConfig->environment();
......@@ -223,7 +223,7 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
if (params.executable.isEmpty()) {
QmlProjectPlugin::showQmlObserverToolWarning();
*errorMessage = QString(""); // hack, we already showed a error message
errorMessage->clear(); // hack, we already showed a error message
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment