Application::Application(int& argc, char** argv):
    QApplication(argc, argv),

    mSkipValid(false),
    mTranslator(),
    mMainWindow(0)
{
    setOrganizationName("SCAP Workbench upstream");
    setOrganizationDomain("http://fedorahosted.org/scap-workbench");

    setApplicationName("SCAP Workbench");
    setApplicationVersion(SCAP_WORKBENCH_VERSION);

    mMainWindow = new MainWindow();

#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
    mTranslator.load(QLocale(), "scap-workbench", "", getShareTranslationDirectory().absolutePath());
    installTranslator(&mTranslator);
#endif

    const QIcon& icon = getApplicationIcon();
    setWindowIcon(icon);
    mMainWindow->setWindowIcon(icon);

    QObject::connect(
        this, SIGNAL(lastWindowClosed()),
        this, SLOT(quit())
    );
    mMainWindow->show();

    QStringList args = arguments();
    processCLI(args);

    mMainWindow->setSkipValid(mSkipValid);

    // Only open default content if no command line arguments were given.
    // The first argument is the application name, it doesn't count.
    if (!mMainWindow->fileOpened() && args.length() < 2)
        openSSG();

    if (!mMainWindow->fileOpened())
        browseForContent();
}
Application::Application(int& argc, char** argv):
    QApplication(argc, argv),
    mTranslator(),
    mMainWindow(0)
{
    setOrganizationName("SCAP Workbench upstream");
    setOrganizationDomain("https://www.open-scap.org/tools/scap-workbench");

    setApplicationName("SCAP Workbench");
    setApplicationVersion(SCAP_WORKBENCH_VERSION);

    mMainWindow = new MainWindow();

#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
    mTranslator.load(QLocale(), "scap-workbench", "", getShareTranslationDirectory().absolutePath());
    installTranslator(&mTranslator);
#endif

    const QIcon& icon = getApplicationIcon();
    setWindowIcon(icon);
    mMainWindow->setWindowIcon(icon);

    QObject::connect(
        this, SIGNAL(lastWindowClosed()),
        this, SLOT(quit())
    );

    QStringList args = arguments();
    processCLI(args);

    // Showing the window before processing command line arguments causes crashes occasionally
    mMainWindow->show();

    // Only open default content if no file to open was given.
    if (!mMainWindow->fileOpened())
        openSSG();

}