Commit 6d4846a7 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Friedemann Kleint

GenericProjectManager: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: Iafe507e833d09fe45a24c830d670995c49e3a145
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 2ea3b234
......@@ -55,8 +55,8 @@ FilesSelectionWizardPage::FilesSelectionWizardPage(GenericProjectWizardDialog *g
hbox->addWidget(m_filterLabel);
m_filterLineEdit = new QLineEdit;
const QString filter = Core::ICore::settings()->value(Constants::FILEFILTER_SETTING,
Constants::FILEFILTER_DEFAULT).toString();
const QString filter = Core::ICore::settings()->value(QLatin1String(Constants::FILEFILTER_SETTING),
QLatin1String(Constants::FILEFILTER_DEFAULT)).toString();
m_filterLineEdit->setText(filter);
m_filterLineEdit->hide();
hbox->addWidget(m_filterLineEdit);
......@@ -140,7 +140,7 @@ QStringList FilesSelectionWizardPage::selectedFiles() const
void FilesSelectionWizardPage::applyFilter()
{
const QString filter = m_filterLineEdit->text();
Core::ICore::settings()->setValue(Constants::FILEFILTER_SETTING, filter);
Core::ICore::settings()->setValue(QLatin1String(Constants::FILEFILTER_SETTING), filter);
m_model->applyFilter(filter);
}
......
......@@ -479,7 +479,7 @@ QString GenericProjectFile::suggestedFileName() const
QString GenericProjectFile::mimeType() const
{
return Constants::GENERICMIMETYPE;
return QLatin1String(Constants::GENERICMIMETYPE);
}
bool GenericProjectFile::isModified() const
......
......@@ -2,6 +2,9 @@ TEMPLATE = lib
TARGET = GenericProjectManager
include(../../qtcreatorplugin.pri)
include(genericprojectmanager_dependencies.pri)
DEFINES += QT_NO_CAST_FROM_ASCII
HEADERS = genericproject.h \
genericprojectplugin.h \
genericprojectmanager.h \
......
......@@ -5,6 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "GenericProjectManager"
Depends { name: "cpp" }
Depends { name: "Qt.widgets" }
Depends { name: "Core" }
Depends { name: "CPlusPlus" }
......@@ -14,6 +15,7 @@ QtcPlugin {
Depends { name: "Find" }
Depends { name: "Locator" }
Depends { name: "QtSupport" }
cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
files: [
"filesselectionwizardpage.cpp",
......
......@@ -49,7 +49,7 @@ SelectableFilesModel::SelectableFilesModel(const QString &baseDir, QObject *pare
{
// Dummy tree
m_root = new Tree;
m_root->name = "/";
m_root->name = QLatin1String("/");
m_root->parent = 0;
m_root->fullPath = m_baseDir;
m_root->isDir = true;
......@@ -59,7 +59,7 @@ void SelectableFilesModel::setInitialMarkedFiles(const QStringList &files)
{
m_files = files.toSet();
m_outOfBaseDirFiles.clear();
QString base = m_baseDir + '/';
QString base = m_baseDir + QLatin1Char('/');
foreach (const QString &file, m_files)
if (!file.startsWith(base))
m_outOfBaseDirFiles.append(file);
......@@ -75,7 +75,7 @@ void SelectableFilesModel::startParsing()
{
// Build a tree in a future
m_rootForFuture = new Tree;
m_rootForFuture->name = "/";
m_rootForFuture->name = QLatin1String("/");
m_rootForFuture->parent = 0;
m_rootForFuture->fullPath = m_baseDir;
m_rootForFuture->isDir = true;
......@@ -361,14 +361,15 @@ void SelectableFilesModel::collectFiles(Tree *root, QStringList *result) const
QList<Glob> SelectableFilesModel::parseFilter(const QString &filter)
{
QList<Glob> result;
QStringList list = filter.split(';', QString::SkipEmptyParts);
QStringList list = filter.split(QLatin1Char(';'), QString::SkipEmptyParts);
foreach (const QString &e, list) {
QString entry = e.trimmed();
Glob g;
if (entry.indexOf('*') == -1 && entry.indexOf('?') == -1) {
if (entry.indexOf(QLatin1Char('*')) == -1 && entry.indexOf(QLatin1Char('?')) == -1) {
g.mode = Glob::EXACT;
g.matchString = entry;
} else if (entry.startsWith('*') && entry.indexOf('*', 1) == -1 && entry.indexOf('?', 1) == -1) {
} else if (entry.startsWith(QLatin1Char('*')) && entry.indexOf(QLatin1Char('*'), 1) == -1
&& entry.indexOf(QLatin1Char('?'), 1) == -1) {
g.mode = Glob::ENDSWITH;
g.matchString = entry.mid(1);
} else {
......@@ -518,8 +519,8 @@ SelectableFilesDialog::SelectableFilesDialog(const QString &path, const QStringL
hbox->addWidget(m_filterLabel);
m_filterLineEdit = new QLineEdit(this);
const QString filter = Core::ICore::settings()->value(Constants::FILEFILTER_SETTING,
Constants::FILEFILTER_DEFAULT).toString();
const QString filter = Core::ICore::settings()->value(QLatin1String(Constants::FILEFILTER_SETTING),
QLatin1String(Constants::FILEFILTER_DEFAULT)).toString();
m_filterLineEdit->setText(filter);
m_filterLineEdit->hide();
hbox->addWidget(m_filterLineEdit);
......@@ -610,7 +611,7 @@ QStringList SelectableFilesDialog::selectedFiles() const
void SelectableFilesDialog::applyFilter()
{
const QString filter = m_filterLineEdit->text();
Core::ICore::settings()->setValue(Constants::FILEFILTER_SETTING, filter);
Core::ICore::settings()->setValue(QLatin1String(Constants::FILEFILTER_SETTING), filter);
m_selectableFilesModel->applyFilter(filter);
}
......
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