Guest User

Untitled

a guest
Apr 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. if (!Setting("kiosk", "calibrated", false).value().toBool()) {
  2. QProcess calibrator;
  3. calibrator.start("xinput_calibrator --output-type xinput");
  4. if (calibrator.waitForFinished()) {
  5. QFile writeFile (QDir::home().path() + "/.xsession");
  6. writeFile.open(QFile::WriteOnly);
  7. QTextStream str (&writeFile);
  8. while (!calibrator.atEnd()) {
  9. QByteArray tmp_calibrator = calibrator.readLine();
  10. if (tmp_calibrator.contains("xinput set-int-prop"))
  11. str << tmp_calibrator.trimmed() << "\n";
  12. }
  13. str << "$HOME/VTCKiosk";
  14. writeFile.close();
  15. }
  16. calibrator.close();
  17. KLOG() << QObject::tr("Run Calibrator.");
  18. qDebug() << "Run Calibrator.";
  19. }
Add Comment
Please, Sign In to add comment