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