Skip to content

Commit

Permalink
Fix #142
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Jan 17, 2021
1 parent 741d1c3 commit a5378a9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions applications/lockscreen/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,16 @@ class Controller : public QObject {
return;
}

if(!storedPin().length()){
if(shouldQuit()){
qDebug() << "No pin set";
setState("loading");
previousApplication();
qApp->quit();
return;
}

qDebug() << "Prompting for PIN";
QTimer::singleShot(100, [this]{
stateControllerUI->setProperty("state", "loaded");
setState("loaded");
});
}
void launchStartupApp(){
Expand All @@ -148,11 +149,13 @@ class Controller : public QObject {
path = appsApi->getApplicationPath("codes.eeems.oxide");
}
if(path.path() == "/"){
qWarning() << "Unable to find startup application to launch.";
return;
}
Application app(OXIDE_SERVICE, path.path(), QDBusConnection::systemBus());
app.launch();
}
bool shouldQuit(){ return settings.contains("pin") && !storedPin().length(); }
void previousApplication(){
if(!appsApi->previousApplication()){
launchStartupApp();
Expand Down Expand Up @@ -201,7 +204,9 @@ class Controller : public QObject {
}
if(state == "prompt"){
confirmPin = pin;
setState("confirmPin");
QTimer::singleShot(200, [this]{
setState("confirmPin");
});
return true;
}
if(state != "confirmPin"){
Expand Down

0 comments on commit a5378a9

Please sign in to comment.