mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-01 12:00:48 +00:00
parent
7b5e5c2587
commit
cfac261516
@ -103,10 +103,13 @@ Application::Application(
|
||||
char **argv)
|
||||
: QApplication(argc, argv)
|
||||
, _mainThreadId(QThread::currentThreadId())
|
||||
, _launcher(launcher)
|
||||
, _updateChecker(Core::UpdaterDisabled()
|
||||
? nullptr
|
||||
: std::make_unique<Core::UpdateChecker>()) {
|
||||
, _launcher(launcher) {
|
||||
}
|
||||
|
||||
int Application::execute() {
|
||||
if (!Core::UpdaterDisabled()) {
|
||||
_updateChecker = std::make_unique<Core::UpdateChecker>();
|
||||
}
|
||||
const auto d = QFile::encodeName(QDir(cWorkingDir()).absolutePath());
|
||||
char h[33] = { 0 };
|
||||
hashMd5Hex(d.constData(), d.size(), h);
|
||||
@ -134,6 +137,8 @@ Application::Application(
|
||||
LOG(("Connecting local socket to %1...").arg(_localServerName));
|
||||
_localSocket.connectToServer(_localServerName);
|
||||
}
|
||||
|
||||
return exec();
|
||||
}
|
||||
|
||||
Application::~Application() = default;
|
||||
|
@ -21,7 +21,7 @@ class Application : public QApplication, private QAbstractNativeEventFilter {
|
||||
public:
|
||||
Application(not_null<Core::Launcher*> launcher, int &argc, char **argv);
|
||||
|
||||
bool event(QEvent *e) override;
|
||||
int execute();
|
||||
|
||||
void createMessenger();
|
||||
void refreshGlobalProxy();
|
||||
@ -49,6 +49,9 @@ public slots:
|
||||
void startApplication(); // will be done in exec()
|
||||
void closeApplication(); // will be done in aboutToQuit()
|
||||
|
||||
protected:
|
||||
bool event(QEvent *e) override;
|
||||
|
||||
private:
|
||||
typedef QPair<QLocalSocket*, QByteArray> LocalClient;
|
||||
typedef QList<LocalClient> LocalClients;
|
||||
|
@ -243,11 +243,10 @@ void Launcher::processArguments() {
|
||||
}
|
||||
|
||||
int Launcher::executeApplication() {
|
||||
Application application(this, _argc, _argv);
|
||||
MainQueueProcessor processor;
|
||||
base::ConcurrentTimerEnvironment environment;
|
||||
|
||||
Application app(this, _argc, _argv);
|
||||
return app.exec();
|
||||
return application.execute();
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
Loading…
Reference in New Issue
Block a user