Commit 7e5551a2 authored by hjk's avatar hjk
Browse files

ExternalEditors: Remove #ifdef and use Core::Id more directly



Change-Id: Idb395684c9950ac9f542f7cf376e7381aa4d359d
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 89e0a66f
...@@ -106,13 +106,13 @@ static const char designerDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors", ...@@ -106,13 +106,13 @@ static const char designerDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors",
static const char linguistDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Qt Linguist"); static const char linguistDisplayName[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Qt Linguist");
// -------------- ExternalQtEditor // -------------- ExternalQtEditor
ExternalQtEditor::ExternalQtEditor(const QString &id, ExternalQtEditor::ExternalQtEditor(Core::Id id,
const QString &displayName, const QString &displayName,
const QString &mimetype, const QString &mimetype,
QObject *parent) : QObject *parent) :
Core::IExternalEditor(parent), Core::IExternalEditor(parent),
m_mimeTypes(mimetype), m_mimeTypes(mimetype),
m_id(Core::Id::fromString(id)), m_id(id),
m_displayName(displayName) m_displayName(displayName)
{ {
} }
...@@ -160,12 +160,8 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName, ...@@ -160,12 +160,8 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
// Setup binary + arguments, use Mac Open if appropriate // Setup binary + arguments, use Mac Open if appropriate
data->arguments = additionalArguments; data->arguments = additionalArguments;
data->arguments.push_back(fileName); data->arguments.push_back(fileName);
#ifdef Q_OS_MAC if (Utils::HostOsInfo::isMacHost() && useMacOpenCommand)
if (useMacOpenCommand)
createMacOpenCommand(&(data->binary), &(data->arguments)); createMacOpenCommand(&(data->binary), &(data->arguments));
#else
Q_UNUSED(useMacOpenCommand)
#endif
if (debug) if (debug)
qDebug() << Q_FUNC_INFO << '\n' << data->binary << data->arguments; qDebug() << Q_FUNC_INFO << '\n' << data->binary << data->arguments;
return true; return true;
...@@ -185,7 +181,7 @@ bool ExternalQtEditor::startEditorProcess(const EditorLaunchData &data, QString ...@@ -185,7 +181,7 @@ bool ExternalQtEditor::startEditorProcess(const EditorLaunchData &data, QString
// --------------- LinguistExternalEditor // --------------- LinguistExternalEditor
LinguistExternalEditor::LinguistExternalEditor(QObject *parent) : LinguistExternalEditor::LinguistExternalEditor(QObject *parent) :
ExternalQtEditor(QLatin1String(linguistIdC), ExternalQtEditor(linguistIdC,
QLatin1String(linguistDisplayName), QLatin1String(linguistDisplayName),
QLatin1String(Qt4ProjectManager::Constants::LINGUIST_MIMETYPE), QLatin1String(Qt4ProjectManager::Constants::LINGUIST_MIMETYPE),
parent) parent)
...@@ -202,7 +198,7 @@ bool LinguistExternalEditor::startEditor(const QString &fileName, QString *error ...@@ -202,7 +198,7 @@ bool LinguistExternalEditor::startEditor(const QString &fileName, QString *error
// --------------- MacDesignerExternalEditor, using Mac 'open' // --------------- MacDesignerExternalEditor, using Mac 'open'
MacDesignerExternalEditor::MacDesignerExternalEditor(QObject *parent) : MacDesignerExternalEditor::MacDesignerExternalEditor(QObject *parent) :
ExternalQtEditor(QLatin1String(designerIdC), ExternalQtEditor(designerIdC,
QLatin1String(designerDisplayName), QLatin1String(designerDisplayName),
QLatin1String(Qt4ProjectManager::Constants::FORM_MIMETYPE), QLatin1String(Qt4ProjectManager::Constants::FORM_MIMETYPE),
parent) parent)
...@@ -220,7 +216,7 @@ bool MacDesignerExternalEditor::startEditor(const QString &fileName, QString *er ...@@ -220,7 +216,7 @@ bool MacDesignerExternalEditor::startEditor(const QString &fileName, QString *er
// --------------- DesignerExternalEditor with Designer Tcp remote control. // --------------- DesignerExternalEditor with Designer Tcp remote control.
DesignerExternalEditor::DesignerExternalEditor(QObject *parent) : DesignerExternalEditor::DesignerExternalEditor(QObject *parent) :
ExternalQtEditor(QLatin1String(designerIdC), ExternalQtEditor(designerIdC,
QLatin1String(designerDisplayName), QLatin1String(designerDisplayName),
QLatin1String(Designer::Constants::FORM_MIMETYPE), QLatin1String(Designer::Constants::FORM_MIMETYPE),
parent), parent),
......
...@@ -75,7 +75,7 @@ protected: ...@@ -75,7 +75,7 @@ protected:
QString workingDirectory; QString workingDirectory;
}; };
explicit ExternalQtEditor(const QString &id, explicit ExternalQtEditor(Core::Id id,
const QString &displayName, const QString &displayName,
const QString &mimetype, const QString &mimetype,
QObject *parent = 0); QObject *parent = 0);
......
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