From 3e6cb43b2a6c7b40c69774c86571bc084a4f16d2 Mon Sep 17 00:00:00 2001 From: momen Date: Sun, 10 Aug 2025 16:55:32 +0800 Subject: [PATCH] =?UTF-8?q?chore:=E7=9B=B4=E6=8E=A5=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainwindow-dtk.cpp | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp index e0a2226..c2a9063 100755 --- a/src/mainwindow-dtk.cpp +++ b/src/mainwindow-dtk.cpp @@ -526,29 +526,34 @@ void MainWindow::notify(QObject *receiver, QEvent *event) void MainWindow::on_pushButton_14_clicked() { QString appPath; - #ifdef QT_DEBUG - appPath = QCoreApplication::applicationDirPath() ; - QDir dir(appPath); - dir.cdUp(); - appPath = dir.absolutePath()+"/spark-update-tool/spark-update-tool"; - qDebug() << "Spark Update Tool Path: " << appPath; - if(appPath.isEmpty()) - { - qWarning() << "Spark Update Tool not found!"; - return; - } - QProcess *process = new QProcess(this); - QStringList arguments; - arguments << appPath <<"--silent"; - process->start(appPath, {"--silent"}); - #else + // #ifdef QT_DEBUG + // appPath = QCoreApplication::applicationDirPath() ; + // QDir dir(appPath); + // dir.cdUp(); + // appPath = dir.absolutePath()+"/spark-update-tool/spark-update-tool"; + // qDebug() << "Spark Update Tool Path: " << appPath; + // if(appPath.isEmpty()) + // { + // qWarning() << "Spark Update Tool not found!"; + // return; + // } + // QProcess *process = new QProcess(this); + // QStringList arguments; + // arguments << appPath <<"--silent"; + // process->start(appPath, {"--silent"}); + // #else + // appPath = QStandardPaths::findExecutable("spark-update-tool"); + // QString program = "pkexec"; + // QStringList arguments; + // arguments << appPath; + // QProcess *process = new QProcess(this); + // process->start(program, arguments); + // #endif appPath = QStandardPaths::findExecutable("spark-update-tool"); QString program = "pkexec"; QStringList arguments; arguments << appPath; QProcess *process = new QProcess(this); process->start(program, arguments); - #endif - } \ No newline at end of file