mirror of https://github.com/cutefishos/terminal
Support open file manager
parent
840892753e
commit
3bbe700f96
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 CutefishOS Team.
|
||||||
|
*
|
||||||
|
* Author: Reion Wong <reionwong@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "processhelper.h"
|
||||||
|
#include <QProcess>
|
||||||
|
|
||||||
|
ProcessHelper *SELF = nullptr;
|
||||||
|
|
||||||
|
ProcessHelper *ProcessHelper::self()
|
||||||
|
{
|
||||||
|
if (!SELF)
|
||||||
|
SELF = new ProcessHelper;
|
||||||
|
|
||||||
|
return SELF;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessHelper::ProcessHelper(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ProcessHelper::startDetached(const QString &program, const QStringList &arguments)
|
||||||
|
{
|
||||||
|
return QProcess::startDetached(program, arguments);
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 CutefishOS Team.
|
||||||
|
*
|
||||||
|
* Author: Reion Wong <reionwong@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PROCESSHELPER_H
|
||||||
|
#define PROCESSHELPER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class ProcessHelper : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
static ProcessHelper *self();
|
||||||
|
explicit ProcessHelper(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
Q_INVOKABLE bool startDetached(const QString &program, const QStringList &arguments);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // PROCESSHELPER_H
|
Loading…
Reference in New Issue