forked from qt-creator/qt-creator
Macros: Compile with QT_NO_CAST_FROM_ASCII
Change-Id: Idd493b3e6e6b9ea2a33aea77d338d690d14d9b47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
committed by
Friedemann Kleint
parent
d74784fab6
commit
9be874ba25
@@ -61,7 +61,7 @@ public:
|
||||
};
|
||||
|
||||
Macro::MacroPrivate::MacroPrivate() :
|
||||
version(Core::Constants::IDE_VERSION_LONG)
|
||||
version(QLatin1String(Core::Constants::IDE_VERSION_LONG))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -142,11 +142,11 @@ void MacroManager::MacroManagerPrivate::initialize()
|
||||
macros.clear();
|
||||
QDir dir(q->macrosDirectory());
|
||||
QStringList filter;
|
||||
filter << QString("*.")+Constants::M_EXTENSION;
|
||||
filter << QLatin1String("*.") + QLatin1String(Constants::M_EXTENSION);
|
||||
QStringList files = dir.entryList(filter, QDir::Files);
|
||||
|
||||
foreach (const QString &name, files) {
|
||||
QString fileName = dir.absolutePath() + '/' + name;
|
||||
QString fileName = dir.absolutePath() + QLatin1Char('/') + name;
|
||||
Macro *macro = new Macro;
|
||||
if (macro->loadHeader(fileName))
|
||||
addMacro(macro);
|
||||
@@ -175,7 +175,7 @@ void MacroManager::MacroManagerPrivate::removeMacro(const QString &name)
|
||||
if (!macros.contains(name))
|
||||
return;
|
||||
// Remove shortcut
|
||||
Core::ActionManager::unregisterShortcut(Core::Id(Constants::PREFIX_MACRO+name));
|
||||
Core::ActionManager::unregisterShortcut(Core::Id(QLatin1String(Constants::PREFIX_MACRO) + name));
|
||||
|
||||
// Remove macro from the map
|
||||
Macro *macro = macros.take(name);
|
||||
@@ -190,7 +190,8 @@ void MacroManager::MacroManagerPrivate::changeMacroDescription(Macro *macro, con
|
||||
macro->save(macro->fileName(), Core::ICore::mainWindow());
|
||||
|
||||
// Change shortcut what's this
|
||||
Core::Command *command = Core::ActionManager::command(Core::Id(Constants::PREFIX_MACRO+macro->displayName()));
|
||||
Core::Command *command = Core::ActionManager::command(
|
||||
Core::Id(QLatin1String(Constants::PREFIX_MACRO)+macro->displayName()));
|
||||
if (command && command->shortcut())
|
||||
command->shortcut()->setWhatsThis(description);
|
||||
}
|
||||
@@ -233,8 +234,8 @@ void MacroManager::MacroManagerPrivate::showSaveDialog()
|
||||
return;
|
||||
|
||||
// Save in the resource path
|
||||
QString fileName = q->macrosDirectory() + '/' + dialog.name()
|
||||
+ '.' + Constants::M_EXTENSION;
|
||||
QString fileName = q->macrosDirectory() + QLatin1Char('/') + dialog.name()
|
||||
+ QLatin1Char('.') + QLatin1String(Constants::M_EXTENSION);
|
||||
currentMacro->setDescription(dialog.description());
|
||||
currentMacro->save(fileName, mainWindow);
|
||||
addMacro(currentMacro);
|
||||
|
||||
@@ -111,7 +111,8 @@ void MacroOptionsWidget::createTable()
|
||||
macroItem->setData(0, WRITE_ROLE, it.value()->isWritable());
|
||||
|
||||
Core::Command *command =
|
||||
Core::ActionManager::command(Core::Id(Constants::PREFIX_MACRO+it.value()->displayName()));
|
||||
Core::ActionManager::command(Core::Id(QLatin1String(Constants::PREFIX_MACRO)
|
||||
+ it.value()->displayName()));
|
||||
if (command && command->shortcut())
|
||||
macroItem->setText(2, command->shortcut()->key().toString());
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = Macros
|
||||
|
||||
DEFINES += MACROS_LIBRARY
|
||||
DEFINES += MACROS_LIBRARY QT_NO_CAST_FROM_ASCII
|
||||
|
||||
include(../../qtcreatorplugin.pri)
|
||||
include(macros_dependencies.pri)
|
||||
|
||||
@@ -5,12 +5,14 @@ import "../QtcPlugin.qbs" as QtcPlugin
|
||||
QtcPlugin {
|
||||
name: "Macros"
|
||||
|
||||
Depends { name: "cpp" }
|
||||
Depends { name: "Qt.widgets" }
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "Locator" }
|
||||
Depends { name: "Find" }
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "app_version_header" }
|
||||
cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
|
||||
|
||||
files: [
|
||||
"actionmacrohandler.cpp",
|
||||
|
||||
@@ -41,7 +41,7 @@ SaveDialog::SaveDialog(QWidget *parent) :
|
||||
ui(new Ui::SaveDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->name->setValidator(new QRegExpValidator(QRegExp("\\w*"), this));
|
||||
ui->name->setValidator(new QRegExpValidator(QRegExp(QLatin1String("\\w*")), this));
|
||||
}
|
||||
|
||||
SaveDialog::~SaveDialog()
|
||||
|
||||
Reference in New Issue
Block a user