capybara-webkit/src/main.cpp

32 lines
725 B
C++
Raw Normal View History

2011-02-19 03:53:06 +00:00
#include "Server.h"
#include <QtGui>
#include <iostream>
#ifdef Q_OS_UNIX
#include <unistd.h>
#endif
2011-02-19 03:53:06 +00:00
int main(int argc, char **argv) {
#ifdef Q_OS_UNIX
if (setpgid(0, 0) < 0) {
std::cerr << "Unable to set new process group." << std::endl;
return 1;
}
#endif
2011-02-19 03:53:06 +00:00
QApplication app(argc, argv);
2011-02-26 20:53:03 +00:00
app.setApplicationName("capybara-webkit");
2011-02-19 03:53:06 +00:00
app.setOrganizationName("thoughtbot, inc");
app.setOrganizationDomain("thoughtbot.com");
Server server(0);
2011-02-19 03:53:06 +00:00
if (server.start()) {
std::cout << "Capybara-webkit server started, listening on port: " << server.server_port() << std::endl;
2011-02-19 03:53:06 +00:00
return app.exec();
} else {
std::cerr << "Couldn't start capybara-webkit server" << std::endl;
2011-02-19 03:53:06 +00:00
return 1;
}
}