forked from qt-creator/qt-creator
QmlDesigner: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I492792bb9e5655c55795e938031efc557c9a462f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
42af154c77
commit
b6de2d1bd8
@@ -49,7 +49,7 @@ class QmlConsoleManagerPrivate
|
||||
public:
|
||||
Internal::QmlConsoleItemModel *qmlConsoleItemModel;
|
||||
Internal::QmlConsolePane *qmlConsolePane;
|
||||
QmlJS::IScriptEvaluator *scriptEvaluator;
|
||||
IScriptEvaluator *scriptEvaluator;
|
||||
};
|
||||
|
||||
QmlConsoleManager::QmlConsoleManager(QObject *parent)
|
||||
@@ -81,7 +81,7 @@ ConsoleItem *QmlConsoleManager::rootItem() const
|
||||
return d->qmlConsoleItemModel->root();
|
||||
}
|
||||
|
||||
void QmlConsoleManager::setScriptEvaluator(QmlJS::IScriptEvaluator *scriptEvaluator)
|
||||
void QmlConsoleManager::setScriptEvaluator(IScriptEvaluator *scriptEvaluator)
|
||||
{
|
||||
d->scriptEvaluator = scriptEvaluator;
|
||||
if (!scriptEvaluator)
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
|
||||
namespace QmlJSTools {
|
||||
|
||||
namespace {
|
||||
typedef QmlJS::QmlBundle QmlBundle;
|
||||
typedef QmlJS::QmlLanguageBundles QmlLanguageBundles;
|
||||
}
|
||||
using namespace QmlJS;
|
||||
|
||||
/*!
|
||||
|
||||
@@ -83,18 +83,18 @@ QmlJSCodeStylePreferencesWidget::~QmlJSCodeStylePreferencesWidget()
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void QmlJSCodeStylePreferencesWidget::setPreferences(TextEditor::ICodeStylePreferences *preferences)
|
||||
void QmlJSCodeStylePreferencesWidget::setPreferences(ICodeStylePreferences *preferences)
|
||||
{
|
||||
m_preferences = preferences;
|
||||
m_ui->tabPreferencesWidget->setPreferences(preferences);
|
||||
if (m_preferences)
|
||||
connect(m_preferences, &TextEditor::ICodeStylePreferences::currentTabSettingsChanged,
|
||||
connect(m_preferences, &ICodeStylePreferences::currentTabSettingsChanged,
|
||||
this, &QmlJSCodeStylePreferencesWidget::slotSettingsChanged);
|
||||
updatePreview();
|
||||
}
|
||||
|
||||
|
||||
void QmlJSCodeStylePreferencesWidget::decorateEditor(const TextEditor::FontSettings &fontSettings)
|
||||
void QmlJSCodeStylePreferencesWidget::decorateEditor(const FontSettings &fontSettings)
|
||||
{
|
||||
const ISnippetProvider *provider = ExtensionSystem::PluginManager::getObject<ISnippetProvider>(
|
||||
[](ISnippetProvider *current) {
|
||||
@@ -122,7 +122,7 @@ void QmlJSCodeStylePreferencesWidget::updatePreview()
|
||||
{
|
||||
QTextDocument *doc = m_ui->previewTextEdit->document();
|
||||
|
||||
const TextEditor::TabSettings &ts = m_preferences
|
||||
const TabSettings &ts = m_preferences
|
||||
? m_preferences->currentTabSettings()
|
||||
: TextEditorSettings::codeStyle()->tabSettings();
|
||||
m_ui->previewTextEdit->textDocument()->setTabSettings(ts);
|
||||
@@ -157,9 +157,9 @@ QmlJSCodeStyleSettingsPage::QmlJSCodeStyleSettingsPage(/*QSharedPointer<CppFileS
|
||||
QWidget *QmlJSCodeStyleSettingsPage::widget()
|
||||
{
|
||||
if (!m_widget) {
|
||||
TextEditor::SimpleCodeStylePreferences *originalTabPreferences
|
||||
SimpleCodeStylePreferences *originalTabPreferences
|
||||
= QmlJSToolsSettings::globalCodeStyle();
|
||||
m_pageTabPreferences = new TextEditor::SimpleCodeStylePreferences(m_widget);
|
||||
m_pageTabPreferences = new SimpleCodeStylePreferences(m_widget);
|
||||
m_pageTabPreferences->setDelegatingPool(originalTabPreferences->delegatingPool());
|
||||
m_pageTabPreferences->setTabSettings(originalTabPreferences->tabSettings());
|
||||
m_pageTabPreferences->setCurrentDelegate(originalTabPreferences->currentDelegate());
|
||||
@@ -175,7 +175,7 @@ void QmlJSCodeStyleSettingsPage::apply()
|
||||
if (m_widget) {
|
||||
QSettings *s = Core::ICore::settings();
|
||||
|
||||
TextEditor::SimpleCodeStylePreferences *originalTabPreferences = QmlJSToolsSettings::globalCodeStyle();
|
||||
SimpleCodeStylePreferences *originalTabPreferences = QmlJSToolsSettings::globalCodeStyle();
|
||||
if (originalTabPreferences->tabSettings() != m_pageTabPreferences->tabSettings()) {
|
||||
originalTabPreferences->setTabSettings(m_pageTabPreferences->tabSettings());
|
||||
originalTabPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s);
|
||||
|
||||
@@ -44,11 +44,11 @@ using namespace QmlJS::AST;
|
||||
LocatorData::LocatorData(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
QmlJS::ModelManagerInterface *manager = QmlJS::ModelManagerInterface::instance();
|
||||
ModelManagerInterface *manager = ModelManagerInterface::instance();
|
||||
|
||||
connect(manager, &QmlJS::ModelManagerInterface::documentUpdated,
|
||||
connect(manager, &ModelManagerInterface::documentUpdated,
|
||||
this, &LocatorData::onDocumentUpdated);
|
||||
connect(manager, &QmlJS::ModelManagerInterface::aboutToRemoveFiles,
|
||||
connect(manager, &ModelManagerInterface::aboutToRemoveFiles,
|
||||
this, &LocatorData::onAboutToRemoveFiles);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ QHash<QString, QList<LocatorData::Entry> > LocatorData::entries() const
|
||||
return m_entries;
|
||||
}
|
||||
|
||||
void LocatorData::onDocumentUpdated(const QmlJS::Document::Ptr &doc)
|
||||
void LocatorData::onDocumentUpdated(const Document::Ptr &doc)
|
||||
{
|
||||
QList<Entry> entries = FunctionFinder().run(doc);
|
||||
QMutexLocker l(&m_mutex);
|
||||
|
||||
@@ -71,7 +71,7 @@ using namespace QmlJSTools;
|
||||
using namespace QmlJSTools::Internal;
|
||||
|
||||
|
||||
ModelManagerInterface::ProjectInfo QmlJSTools::Internal::ModelManager::defaultProjectInfoForProject(
|
||||
ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
||||
ProjectExplorer::Project *project) const
|
||||
{
|
||||
ModelManagerInterface::ProjectInfo projectInfo(project);
|
||||
@@ -171,9 +171,9 @@ void QmlJSTools::setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &
|
||||
}
|
||||
}
|
||||
|
||||
QHash<QString,QmlJS::Dialect> ModelManager::languageForSuffix() const
|
||||
QHash<QString,Dialect> ModelManager::languageForSuffix() const
|
||||
{
|
||||
QHash<QString,QmlJS::Dialect> res = ModelManagerInterface::languageForSuffix();
|
||||
QHash<QString,Dialect> res = ModelManagerInterface::languageForSuffix();
|
||||
|
||||
if (ICore::instance()) {
|
||||
Utils::MimeDatabase mdb;
|
||||
@@ -223,7 +223,7 @@ void ModelManager::delayedInitialization()
|
||||
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::startupProjectChanged,
|
||||
this, &ModelManager::updateDefaultProjectInfo);
|
||||
|
||||
QmlJS::ViewerContext qbsVContext;
|
||||
ViewerContext qbsVContext;
|
||||
qbsVContext.language = Dialect::QmlQbs;
|
||||
qbsVContext.maybeAddPath(ICore::resourcePath() + QLatin1String("/qbs"));
|
||||
setDefaultVContext(qbsVContext);
|
||||
|
||||
@@ -40,7 +40,7 @@ CreatorCodeFormatter::CreatorCodeFormatter()
|
||||
{
|
||||
}
|
||||
|
||||
CreatorCodeFormatter::CreatorCodeFormatter(const TextEditor::TabSettings &tabSettings)
|
||||
CreatorCodeFormatter::CreatorCodeFormatter(const TabSettings &tabSettings)
|
||||
{
|
||||
setTabSize(tabSettings.m_tabSize);
|
||||
setIndentSize(tabSettings.m_indentSize);
|
||||
|
||||
@@ -39,9 +39,10 @@
|
||||
#include <projectexplorer/editorconfiguration.h>
|
||||
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJSTools;
|
||||
|
||||
class QmlJSTools::QmlJSRefactoringChangesData : public TextEditor::RefactoringChangesData
|
||||
namespace QmlJSTools {
|
||||
|
||||
class QmlJSRefactoringChangesData : public TextEditor::RefactoringChangesData
|
||||
{
|
||||
public:
|
||||
QmlJSRefactoringChangesData(ModelManagerInterface *modelManager,
|
||||
@@ -90,8 +91,8 @@ public:
|
||||
m_modelManager->updateSourceFiles(QStringList(fileName), true);
|
||||
}
|
||||
|
||||
QmlJS::ModelManagerInterface *m_modelManager;
|
||||
QmlJS::Snapshot m_snapshot;
|
||||
ModelManagerInterface *m_modelManager;
|
||||
Snapshot m_snapshot;
|
||||
};
|
||||
|
||||
QmlJSRefactoringChanges::QmlJSRefactoringChanges(ModelManagerInterface *modelManager,
|
||||
@@ -129,7 +130,7 @@ QmlJSRefactoringFile::QmlJSRefactoringFile(const QString &fileName, const QShare
|
||||
m_fileName.clear();
|
||||
}
|
||||
|
||||
QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, QmlJS::Document::Ptr document)
|
||||
QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, Document::Ptr document)
|
||||
: RefactoringFile(editor)
|
||||
, m_qmljsDocument(document)
|
||||
{
|
||||
@@ -195,3 +196,5 @@ void QmlJSRefactoringFile::fileChanged()
|
||||
m_qmljsDocument.clear();
|
||||
RefactoringFile::fileChanged();
|
||||
}
|
||||
|
||||
} // namespace QmlJSTools
|
||||
|
||||
@@ -150,7 +150,7 @@ AST::Node *SemanticInfo::rangeAt(int cursorPosition) const
|
||||
}
|
||||
|
||||
// ### the name and behavior of this function is dubious
|
||||
QmlJS::AST::Node *SemanticInfo::declaringMemberNoProperties(int cursorPosition) const
|
||||
Node *SemanticInfo::declaringMemberNoProperties(int cursorPosition) const
|
||||
{
|
||||
AST::Node *node = rangeAt(cursorPosition);
|
||||
|
||||
@@ -191,7 +191,7 @@ QList<AST::Node *> SemanticInfo::rangePath(int cursorPosition) const
|
||||
return path;
|
||||
}
|
||||
|
||||
ScopeChain SemanticInfo::scopeChain(const QList<QmlJS::AST::Node *> &path) const
|
||||
ScopeChain SemanticInfo::scopeChain(const QList<Node *> &path) const
|
||||
{
|
||||
Q_ASSERT(m_rootScopeChain);
|
||||
|
||||
|
||||
@@ -39,11 +39,13 @@
|
||||
#include <QtTest>
|
||||
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJSTools;
|
||||
|
||||
void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
|
||||
namespace QmlJSTools {
|
||||
namespace Internal {
|
||||
|
||||
void QmlJSToolsPlugin::test_basic()
|
||||
{
|
||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
||||
|
||||
const QString welcomescreenRootPath = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/welcomescreen.qml");
|
||||
modelManager->updateSourceFiles(QStringList(welcomescreenRootPath), false);
|
||||
@@ -88,3 +90,6 @@ void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
|
||||
QCOMPARE(qmlImageValue->className(), QLatin1String("Image"));
|
||||
QCOMPARE(qmlImageValue->propertyType(QLatin1String("source")), QLatin1String("QUrl"));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlJSTools
|
||||
|
||||
@@ -131,13 +131,13 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlJSToolsPlugin::aboutToShutdown()
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
|
||||
void QmlJSToolsPlugin::onTaskStarted(Core::Id type)
|
||||
void QmlJSToolsPlugin::onTaskStarted(Id type)
|
||||
{
|
||||
if (type == QmlJS::Constants::TASK_INDEX)
|
||||
m_resetCodeModelAction->setEnabled(false);
|
||||
}
|
||||
|
||||
void QmlJSToolsPlugin::onAllTasksFinished(Core::Id type)
|
||||
void QmlJSToolsPlugin::onAllTasksFinished(Id type)
|
||||
{
|
||||
if (type == QmlJS::Constants::TASK_INDEX)
|
||||
m_resetCodeModelAction->setEnabled(true);
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace QmlJSTools {
|
||||
|
||||
const char idKey[] = "QmlJSGlobal";
|
||||
|
||||
static TextEditor::SimpleCodeStylePreferences *m_globalCodeStyle = 0;
|
||||
static SimpleCodeStylePreferences *m_globalCodeStyle = 0;
|
||||
|
||||
QmlJSToolsSettings::QmlJSToolsSettings(QObject *parent)
|
||||
: QObject(parent)
|
||||
|
||||
Reference in New Issue
Block a user