@@ -49,10 +49,19 @@ QvPlugin_EventHandler(SimpleEventHandler, Connectivity)
49
49
{
50
50
_command.replace (" $$INBOUND_" + protocol, QString::number (pluginEvent.inboundPorts [protocol]));
51
51
}
52
- auto returnvalue = QProcess::execute (_command);
53
- if (returnvalue != 0 )
52
+ bool detached = _command.contains (" $$CALL" );
53
+ _command.replace (" $$CALL" , " " );
54
+ if (detached)
54
55
{
55
- CommandPlugin::instance->PluginLog (" Failed to execute command : \" " + action + " \" " );
56
+ auto returnvalue = QProcess::execute (_command);
57
+ if (returnvalue != 0 )
58
+ {
59
+ CommandPlugin::instance->PluginLog (" Failed to execute command : \" " + action + " \" " );
60
+ }
61
+ }
62
+ else
63
+ {
64
+ QProcess::startDetached (_command);
56
65
}
57
66
}
58
67
}
@@ -83,10 +92,19 @@ QvPlugin_EventHandler(SimpleEventHandler, SystemProxy)
83
92
auto _command = action;
84
93
_command.replace (" $$HTTP" , QString::number (pluginEvent.systemProxyPortSettings [Events::SystemProxy::SystemProxy_HTTP]));
85
94
_command.replace (" $$SOCKS" , QString::number (pluginEvent.systemProxyPortSettings [Events::SystemProxy::SystemProxy_SOCKS]));
86
- auto returnvalue = QProcess::execute (_command);
87
- if (returnvalue != 0 )
95
+ bool detached = _command.contains (" $$CALL" );
96
+ _command.replace (" $$CALL" , " " );
97
+ if (detached)
98
+ {
99
+ auto returnvalue = QProcess::execute (_command);
100
+ if (returnvalue != 0 )
101
+ {
102
+ CommandPlugin::instance->PluginLog (" Failed to execute command : \" " + action + " \" " );
103
+ }
104
+ }
105
+ else
88
106
{
89
- CommandPlugin::instance-> PluginLog ( " Failed to execute command : \" " + action + " \" " );
107
+ QProcess::startDetached (_command );
90
108
}
91
109
}
92
110
}
@@ -127,10 +145,19 @@ QvPlugin_EventHandler(SimpleEventHandler, ConnectionEntry)
127
145
auto _command = action;
128
146
_command.replace (" $$DISPLAYNAME" , pluginEvent.displayName );
129
147
_command.replace (" $$ORIGINAL_NAME" , pluginEvent.originalDisplayName );
130
- auto returnvalue = QProcess::execute (_command);
131
- if (returnvalue != 0 )
148
+ bool detached = _command.contains (" $$CALL" );
149
+ _command.replace (" $$CALL" , " " );
150
+ if (detached)
151
+ {
152
+ auto returnvalue = QProcess::execute (_command);
153
+ if (returnvalue != 0 )
154
+ {
155
+ CommandPlugin::instance->PluginLog (" Failed to execute command : \" " + action + " \" " );
156
+ }
157
+ }
158
+ else
132
159
{
133
- CommandPlugin::instance-> PluginLog ( " Failed to execute command : \" " + action + " \" " );
160
+ QProcess::startDetached (_command );
134
161
}
135
162
}
136
163
}
0 commit comments