Skip to content

Commit

Permalink
fix: [cmd] remove bash use
Browse files Browse the repository at this point in the history
   remove bash use

Log: remove bash use
Task: https://pms.uniontech.com/task-view-362321.html
  • Loading branch information
starhcq committed Sep 10, 2024
1 parent fc86543 commit 508e7ea
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/src/mainwindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,8 @@ MainWindow::MainWindow(QWidget *parent)

//检查OCR是否存在
try {
QProcess bash;
bash.start("bash");
bash.waitForStarted();
bash.write("command -v deepin-ocr");
bash.closeWriteChannel();
if (!bash.waitForFinished()) {
qWarning() << bash.errorString();
m_ocrIsExisted = false;
}
auto output = bash.readAllStandardOutput();
if (output.isEmpty()) {
m_ocrIsExisted = false;
} else {
m_ocrIsExisted = true;
}
QString path = QStandardPaths::findExecutable("deepin-ocr");
m_ocrIsExisted = !path.isEmpty();
} catch (std::logic_error &e) {
qWarning() << e.what();
m_ocrIsExisted = false;
Expand Down

0 comments on commit 508e7ea

Please sign in to comment.