commandlauncher: Add Qt6 support
parent
d212742a5a
commit
f9a5bfa55e
|
|
@ -1,7 +1,5 @@
|
||||||
include(../plugins.pri)
|
include(../plugins.pri)
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(nymea_integrationplugincommandlauncher)
|
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
integrationplugincommandlauncher.cpp
|
integrationplugincommandlauncher.cpp
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -29,11 +29,11 @@
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
#include "integrationplugincommandlauncher.h"
|
#include "integrationplugincommandlauncher.h"
|
||||||
|
|
||||||
#include "integrations/thing.h"
|
|
||||||
#include "plugininfo.h"
|
#include "plugininfo.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <integrations/thing.h>
|
||||||
|
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
IntegrattionPluginCommandLauncher::IntegrattionPluginCommandLauncher()
|
IntegrattionPluginCommandLauncher::IntegrattionPluginCommandLauncher()
|
||||||
{
|
{
|
||||||
|
|
@ -50,7 +50,7 @@ void IntegrattionPluginCommandLauncher::setupThing(ThingSetupInfo *info)
|
||||||
|
|
||||||
// Script
|
// Script
|
||||||
if(info->thing()->thingClassId() == scriptThingClassId){
|
if(info->thing()->thingClassId() == scriptThingClassId){
|
||||||
QStringList scriptArguments = info->thing()->paramValue(scriptThingScriptParamTypeId).toString().split(QRegExp("[ \r\n][ \r\n]*"));
|
QStringList scriptArguments = info->thing()->paramValue(scriptThingScriptParamTypeId).toString().split(QRegularExpression("[ \r\n][ \r\n]*"));
|
||||||
// check if script exists and if it is executable
|
// check if script exists and if it is executable
|
||||||
QFileInfo fileInfo(scriptArguments.first());
|
QFileInfo fileInfo(scriptArguments.first());
|
||||||
if (!fileInfo.exists()) {
|
if (!fileInfo.exists()) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef INTEGRATIONPLUGINCOMMANDLAUNCHER_H
|
#ifndef INTEGRATIONPLUGINCOMMANDLAUNCHER_H
|
||||||
#define INTEGRATIONPLUGINCOMMANDLAUNCHER_H
|
#define INTEGRATIONPLUGINCOMMANDLAUNCHER_H
|
||||||
|
|
||||||
#include "integrations/integrationplugin.h"
|
#include <integrations/integrationplugin.h>
|
||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
@ -52,8 +52,8 @@ public:
|
||||||
void thingRemoved(Thing *thing) override;
|
void thingRemoved(Thing *thing) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHash<QProcess*,Thing*> m_scripts;
|
QHash<QProcess *,Thing *> m_scripts;
|
||||||
QHash<QProcess*,Thing*> m_applications;
|
QHash<QProcess *,Thing *> m_applications;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTEGRATIONPLUGINCOMMANDLAUNCHER_H
|
#endif // INTEGRATIONPLUGINCOMMANDLAUNCHER_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue