mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 12:55:31 +08:00
Crashpad handler was initialized quite late since we were waiting for settings. However the settings in crashpad are persistent itself, hence we can start it at the earliest possible time and change the upload settings independently later. The only prerequisite is to have QCoreApplication constructed in order for the application name to be available. ref T652
52 lines
1.6 KiB
C++
52 lines
1.6 KiB
C++
/* Copyright (C) 2013
|
|
* swift project Community / Contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
|
|
* or distributed except according to the terms contained in the LICENSE file.
|
|
*/
|
|
|
|
#include "blackgui/enableforframelesswindow.h"
|
|
#include "blackgui/guiapplication.h"
|
|
#include "blackmisc/directoryutils.h"
|
|
#include "blackmisc/crashhandler.h"
|
|
#include "blackmisc/appstarttime.h"
|
|
#include "swiftguistd.h"
|
|
#include "swiftguistdapplication.h"
|
|
|
|
#include <stdlib.h>
|
|
#include <QApplication>
|
|
|
|
using namespace BlackGui;
|
|
using namespace BlackMisc;
|
|
using namespace BlackCore;
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
//! [SwiftApplicationDemo]
|
|
CGuiApplication::highDpiScreenSupport(CGuiApplication::parseScaleFactor(argc, argv));
|
|
QApplication qa(argc, argv);
|
|
Q_UNUSED(qa); // application init needed
|
|
|
|
CCrashHandler::instance()->init();
|
|
CSwiftGuiStdApplication a; // application with contexts
|
|
a.setSignalStartupAutomatically(false); // application will signal startup on its own
|
|
a.splashScreen(CIcons::swift256());
|
|
a.setMinimumSizeInCharacters(60, 42); // experimental
|
|
if (!a.parseAndSynchronizeSetup()) { return EXIT_FAILURE; }
|
|
if (!a.hasSetupReader() || !a.start())
|
|
{
|
|
a.gracefulShutdown();
|
|
return EXIT_FAILURE;
|
|
}
|
|
//! [SwiftApplicationDemo]
|
|
|
|
// show window
|
|
CEnableForFramelessWindow::WindowMode windowMode = a.getWindowMode();
|
|
SwiftGuiStd w(windowMode);
|
|
w.show();
|
|
|
|
int r = a.exec();
|
|
return r;
|
|
}
|