Skip to content

Commit

Permalink
Prevent loading, if the configuration file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Ballina committed Nov 10, 2013
1 parent 65f9b4b commit 39a829d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/loaderconfiglogin.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <QtCore/QSettings>
#include <QtCore/QFile>
#include <QtCore/QDebug>
#include "randrconfig.h"
#include "randrdisplay.h"
Expand Down
17 changes: 15 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/

#include <QtGui/QApplication>
#include <QtCore/QSettings>
#include <QtCore/QFile>
#include <QtCore/QDebug>
#include <getopt.h>
#include <stdlib.h>
Expand Down Expand Up @@ -93,8 +95,19 @@ int main(int argc, char *argv[])

if(startup)
{
LoaderConfigLogin loader;
loader.execute();
QSettings config;
QFile fileconfig(config.fileName());
if(fileconfig.exists())
{
LoaderConfigLogin loader;
loader.execute();
}
else
{
qDebug() << "File config not exist: " << config.fileName();
qDebug() << "Not load config. Exit without change";
}

exit(0);
}
else
Expand Down

0 comments on commit 39a829d

Please sign in to comment.