Skip to content

Instantly share code, notes, and snippets.

@shadeslayer
Created September 3, 2015 16:40
Show Gist options
  • Save shadeslayer/c2e36223d2c90b96b1b9 to your computer and use it in GitHub Desktop.
Save shadeslayer/c2e36223d2c90b96b1b9 to your computer and use it in GitHub Desktop.
QProcess *kcheckpass = new QProcess();
kcheckpass->start("/usr/lib/x86_64-linux-gnu/libexec/kcheckpass");
kcheckpass->waitForStarted();
kDebug() << "Started";
kcheckpass->waitForReadyRead();
kDebug() << "Ready to read";
kcheckpass->write(password.data());
kcheckpass->waitForFinished();
int ec = kcheckpass->exitCode();
kDebug() << "MAGIC" << ec;
if (ec == 0)
return true;
else
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment