forked from qt-creator/qt-creator
QNX: Add editor for Bar descriptor file
Change-Id: I7ad9bb9448ef467eea353d361b72474fe1b8c8f7 Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
committed by
Nicolas Arnaud-Cormos
parent
d3286c2ce0
commit
ed69c5f9c9
@@ -47,6 +47,11 @@
|
||||
#include "qnxqtversionfactory.h"
|
||||
#include "blackberrywizardextension.h"
|
||||
#include "blackberryndksettingspage.h"
|
||||
#include "bardescriptoreditorfactory.h"
|
||||
#include "bardescriptormagicmatcher.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
|
||||
@@ -84,6 +89,23 @@ bool QNXPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||
addAutoReleasedObject(new QnxDeployConfigurationFactory);
|
||||
addAutoReleasedObject(new QnxRunConfigurationFactory);
|
||||
|
||||
// bar-descriptor.xml editor
|
||||
Core::MimeGlobPattern barDescriptorGlobPattern(QRegExp(QLatin1String("*.xml"), Qt::CaseInsensitive, QRegExp::Wildcard), Core::MimeGlobPattern::MinWeight + 1);
|
||||
Core::MimeType barDescriptorMimeType;
|
||||
barDescriptorMimeType.setType(QLatin1String(Constants::QNX_BAR_DESCRIPTOR_MIME_TYPE));
|
||||
barDescriptorMimeType.setComment(tr("Bar descriptor file (BlackBerry"));
|
||||
barDescriptorMimeType.setGlobPatterns(QList<Core::MimeGlobPattern>() << barDescriptorGlobPattern);
|
||||
barDescriptorMimeType.addMagicMatcher(QSharedPointer<Core::IMagicMatcher>(new BarDescriptorMagicMatcher));
|
||||
barDescriptorMimeType.setSubClassesOf(QStringList() << QLatin1String("application/xml"));
|
||||
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::MimeDatabase *mdb = core->mimeDatabase();
|
||||
if (!mdb->addMimeType(barDescriptorMimeType)) {
|
||||
*errorString = tr("Could not add mime-type for bar-descriptor.xml editor");
|
||||
return false;
|
||||
}
|
||||
addAutoReleasedObject(new BarDescriptorEditorFactory);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user