C++ (Qt)p_usbController = new QProcess(); QString program = "/sbin/usbController"; QStringList arguments; arguments <<"add"<<" "<<lineEdit_1->text()<<lineEdit_2->text()<<"system_u:object_r:removable_t:"<<lineEdit_3->text()<<lineEdit_4->text()<<lineEdit_5->text()<<lineEdit_6->text(); p_usbController->start(program, arguments);
C++ (Qt)arguments <<"add"<<" "<<lineEdit_1->text()<<lineEdit_2->text()<<"system_u:object_r:removable_t:"<<lineEdit_3->text()<<lineEdit_4->text()<<lineEdit_5->text()<<lineEdit_6->text(); p_usbController->start(program, arguments);
BashusbController add " " flash 123 system_u:object_r:removable_t: s0 user user 0077
C++ (Qt)"system_u:object_r:removable_t:"<<lineEdit_3->text()
C++ (Qt)QString param("system_u:object_r:removable_t:");param.append(lineEdit_3->text());...arguments << ... << lineEdit_2->text() << param << lineEdit_4->text() <<...;
C++ (Qt)void usbController::buttonBox_ok(){ p_usbController = new QProcess(); QString program = "/sbin/usbController"; QStringList arguments; QString se_context("system_u:object_r:removable_t:"); se_context.append(lineEdit_3->text()); arguments <<"add"<<lineEdit_1->text()<<lineEdit_2->text()<<se_context<<lineEdit_4->text()<<lineEdit_5->text()<<lineEdit_6->text(); p_usbController->start(program, arguments); }
C++ (Qt) p_get_usb = new QProcess(); QString get_usb = "/sbin/usb_storages.sh"; p_get_usb->start(get_usb); textEdit->append(p_get_usb->readAllStandardOutput());
C++ (Qt)void usbController::s_addComboBox(){ p_get_usb = new QProcess(); QString get_usb = "/sbin/usb_storages.sh"; connect(p_get_usb, SIGNAL(readyReadStandardOutput()), SLOT(slotDataOnStdout())); connect(p_get_usb, SIGNAL(readyReadStandardError()), SLOT(slotDataOnStdout())); } void usbController::slotDataOnStdout(){ textEdit->append(p_get_usb->readAllStandardOutput()); textEdit->append(p_get_usb->readAllStandardError()); }
C++ (Qt) p_get_usb = new QProcess(); QString get_usb = "/sbin/usb_storages.sh"; p_get_usb->start(get_usb); sleep(5); textEdit->append(p_get_usb->readAllStandardOutput());