diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
commit | 4d9746c828558c9f872e0aed52442863affb25d5 (patch) | |
tree | 507d7c2ba67f47d3cbbcf01a722236ff1b48426b /sinksh/main.cpp | |
parent | 9cea920b7dd51867a0be0fed2f461b6be73c103e (diff) | |
download | sink-4d9746c828558c9f872e0aed52442863affb25d5.tar.gz sink-4d9746c828558c9f872e0aed52442863affb25d5.zip |
Fromatted the whole codebase with clang-format.
clang-format -i */**{.cpp,.h}
Diffstat (limited to 'sinksh/main.cpp')
-rw-r--r-- | sinksh/main.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sinksh/main.cpp b/sinksh/main.cpp index 4c00b9b..84f532d 100644 --- a/sinksh/main.cpp +++ b/sinksh/main.cpp | |||
@@ -44,10 +44,8 @@ int enterRepl() | |||
44 | } | 44 | } |
45 | 45 | ||
46 | Repl *repl = new Repl; | 46 | Repl *repl = new Repl; |
47 | QObject::connect(repl, &QStateMachine::finished, | 47 | QObject::connect(repl, &QStateMachine::finished, repl, &QObject::deleteLater); |
48 | repl, &QObject::deleteLater); | 48 | QObject::connect(repl, &QStateMachine::finished, QCoreApplication::instance(), &QCoreApplication::quit); |
49 | QObject::connect(repl, &QStateMachine::finished, | ||
50 | QCoreApplication::instance(), &QCoreApplication::quit); | ||
51 | 49 | ||
52 | State::setHasEventLoop(true); | 50 | State::setHasEventLoop(true); |
53 | int rv = QCoreApplication::instance()->exec(); | 51 | int rv = QCoreApplication::instance()->exec(); |
@@ -86,10 +84,10 @@ int main(int argc, char *argv[]) | |||
86 | { | 84 | { |
87 | const bool interactive = isatty(fileno(stdin)); | 85 | const bool interactive = isatty(fileno(stdin)); |
88 | const bool startRepl = (argc == 1) && interactive; | 86 | const bool startRepl = (argc == 1) && interactive; |
89 | //TODO: make a json command parse cause that would be awesomesauce | 87 | // TODO: make a json command parse cause that would be awesomesauce |
90 | const bool fromScript = !startRepl && QFile::exists(argv[1]); | 88 | const bool fromScript = !startRepl && QFile::exists(argv[1]); |
91 | 89 | ||
92 | //qDebug() << "state at startup is" << interactive << startRepl << fromScript; | 90 | // qDebug() << "state at startup is" << interactive << startRepl << fromScript; |
93 | 91 | ||
94 | QCoreApplication app(argc, argv); | 92 | QCoreApplication app(argc, argv); |
95 | app.setApplicationName(fromScript ? "interactive-app-shell" : argv[0]); | 93 | app.setApplicationName(fromScript ? "interactive-app-shell" : argv[0]); |
@@ -98,7 +96,7 @@ int main(int argc, char *argv[]) | |||
98 | return enterRepl(); | 96 | return enterRepl(); |
99 | } else if (fromScript) { | 97 | } else if (fromScript) { |
100 | QFile f(argv[1]); | 98 | QFile f(argv[1]); |
101 | if (!f.open(QIODevice::ReadOnly)) { | 99 | if (!f.open(QIODevice::ReadOnly)) { |
102 | return 1; | 100 | return 1; |
103 | } | 101 | } |
104 | 102 | ||