diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.cpp b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.cpp deleted file mode 100644 index f29daa6c84f..00000000000 --- a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "highlightdefinitionmetadata.h" - -using namespace TextEditor; -using namespace Internal; - -const QLatin1String HighlightDefinitionMetaData::kPriority("priority"); -const QLatin1String HighlightDefinitionMetaData::kName("name"); -const QLatin1String HighlightDefinitionMetaData::kExtensions("extensions"); -const QLatin1String HighlightDefinitionMetaData::kMimeType("mimetype"); -const QLatin1String HighlightDefinitionMetaData::kVersion("version"); -const QLatin1String HighlightDefinitionMetaData::kUrl("url"); - -HighlightDefinitionMetaData::HighlightDefinitionMetaData() : priority(0) -{} diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h index ed2309be212..a641fa5df2b 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h +++ b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h @@ -30,7 +30,6 @@ #ifndef HIGHLIGHTDEFINITIONMETADATA_H #define HIGHLIGHTDEFINITIONMETADATA_H -#include #include #include @@ -40,14 +39,7 @@ namespace Internal { class HighlightDefinitionMetaData { public: - HighlightDefinitionMetaData(); - - static const QLatin1String kPriority; - static const QLatin1String kName; - static const QLatin1String kExtensions; - static const QLatin1String kMimeType; - static const QLatin1String kVersion; - static const QLatin1String kUrl; + HighlightDefinitionMetaData() : priority(0) {} public: int priority; diff --git a/src/plugins/texteditor/generichighlighter/manager.cpp b/src/plugins/texteditor/generichighlighter/manager.cpp index 167256f1e7f..109b667387a 100644 --- a/src/plugins/texteditor/generichighlighter/manager.cpp +++ b/src/plugins/texteditor/generichighlighter/manager.cpp @@ -67,6 +67,13 @@ using namespace TextEditor; using namespace Internal; +const char kPriority[] = "priority"; +const char kName[] = "name"; +const char kExtensions[] = "extensions"; +const char kMimeType[] = "mimetype"; +const char kVersion[] = "version"; +const char kUrl[] = "url"; + Manager::Manager() : m_isDownloadingDefinitionsSpec(false), m_hasQueuedRegistration(false) @@ -360,14 +367,13 @@ QSharedPointer Manager::parseMetadata(const QFileIn metaData->fileName = fileInfo.fileName(); metaData->id = fileInfo.absoluteFilePath(); - metaData->name = atts.value(HighlightDefinitionMetaData::kName).toString(); - metaData->version = atts.value(HighlightDefinitionMetaData::kVersion).toString(); - metaData->priority = atts.value(HighlightDefinitionMetaData::kPriority).toString() - .toInt(); - metaData->patterns = atts.value(HighlightDefinitionMetaData::kExtensions) + metaData->name = atts.value(QLatin1String(kName)).toString(); + metaData->version = atts.value(QLatin1String(kVersion)).toString(); + metaData->priority = atts.value(QLatin1String(kPriority)).toString().toInt(); + metaData->patterns = atts.value(QLatin1String(kExtensions)) .toString().split(kSemiColon, QString::SkipEmptyParts); - QStringList mimeTypes = atts.value(HighlightDefinitionMetaData::kMimeType). + QStringList mimeTypes = atts.value(QLatin1String(kMimeType)). toString().split(kSemiColon, QString::SkipEmptyParts); if (mimeTypes.isEmpty()) { // There are definitions which do not specify a MIME type, but specify file @@ -400,9 +406,9 @@ QList Manager::parseAvailableDefinitionsList(QIODev const QXmlStreamAttributes &atts = reader.attributes(); HighlightDefinitionMetaData metaData; - metaData.name = atts.value(HighlightDefinitionMetaData::kName).toString(); - metaData.version = atts.value(HighlightDefinitionMetaData::kVersion).toString(); - QString url(atts.value(HighlightDefinitionMetaData::kUrl).toString()); + metaData.name = atts.value(QLatin1String(kName)).toString(); + metaData.version = atts.value(QLatin1String(kVersion)).toString(); + QString url = atts.value(QLatin1String(kUrl)).toString(); metaData.url = QUrl(url); const int slash = url.lastIndexOf(kSlash); if (slash != -1) diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro index a5193ff8620..eaca9ab8d9c 100644 --- a/src/plugins/texteditor/texteditor.pro +++ b/src/plugins/texteditor/texteditor.pro @@ -56,7 +56,6 @@ SOURCES += texteditorplugin.cpp \ generichighlighter/highlightersettingspage.cpp \ generichighlighter/highlightersettings.cpp \ generichighlighter/managedefinitionsdialog.cpp \ - generichighlighter/highlightdefinitionmetadata.cpp \ generichighlighter/definitiondownloader.cpp \ refactoringchanges.cpp \ refactoroverlay.cpp \ diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index 9792f6a884f..6998dbf478e 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -212,7 +212,6 @@ QtcPlugin { "highlightdefinition.h", "highlightdefinitionhandler.cpp", "highlightdefinitionhandler.h", - "highlightdefinitionmetadata.cpp", "highlightdefinitionmetadata.h", "highlighter.cpp", "highlighter.h",