mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-05 04:46:57 +03:00
fix null mainwindow in case of login on setup (#3464)
This commit is contained in:
commit
43385f22be
4 changed files with 34 additions and 28 deletions
|
|
@ -226,7 +226,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||
setApplicationDisplayName(QString("%1 %2").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString()));
|
||||
setApplicationVersion(BuildConfig.printableVersionString() + "\n" + BuildConfig.GIT_COMMIT);
|
||||
setDesktopFileName(BuildConfig.LAUNCHER_DESKTOPFILENAME);
|
||||
startTime = QDateTime::currentDateTime();
|
||||
m_startTime = QDateTime::currentDateTime();
|
||||
|
||||
// Don't quit on hiding the last window
|
||||
this->setQuitOnLastWindowClosed(false);
|
||||
|
|
@ -1186,6 +1186,9 @@ bool Application::event(QEvent* event)
|
|||
#endif
|
||||
|
||||
if (event->type() == QEvent::FileOpen) {
|
||||
if (!m_mainWindow) {
|
||||
showMainWindow(false);
|
||||
}
|
||||
auto ev = static_cast<QFileOpenEvent*>(event);
|
||||
m_mainWindow->processURLs({ ev->url() });
|
||||
}
|
||||
|
|
@ -1319,6 +1322,9 @@ void Application::messageReceived(const QByteArray& message)
|
|||
qWarning() << "Received" << command << "message without a zip path/URL.";
|
||||
return;
|
||||
}
|
||||
if (!m_mainWindow) {
|
||||
showMainWindow(false);
|
||||
}
|
||||
m_mainWindow->processURLs({ normalizeImportUrl(url) });
|
||||
} else if (command == "launch") {
|
||||
QString id = received.args["id"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue