summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-08-17 21:40:22 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-08-17 22:32:03 +0200
commit62c137157ed04d08e6bcc7a741bcdb046943776f (patch)
tree8f717bd5fa9fdda743f08677544e8cd5c9f9fef2 /gui
parentfad4b316af2cde1a5988ed1bbdbc4ba5933e88df (diff)
compat/win32-com: default to right COM type without caller specifying it
The main window always needs the apartment threaded context for OLE used by Qt. Default to apartment threaded before a QApplication is created, or if the thread is the QApplication thread. Use multithreaded COM otherwise.
Diffstat (limited to 'gui')
-rw-r--r--gui/main.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/gui/main.cpp b/gui/main.cpp
index fd41cbd3..e7c9c239 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -112,7 +112,7 @@ static void add_program_library_path()
int main(int argc, char** argv)
{
#ifdef _WIN32
- init_com_threading(com_apartment);
+ init_com_threading();
add_program_library_path();
#elif !defined(__linux)
// workaround QTBUG-38598
@@ -126,13 +126,12 @@ int main(int argc, char** argv)
QApplication app(argc, argv);
set_qt_style();
+ MainWindow::set_working_directory();
#ifdef _WIN32
add_win32_path();
#endif
- MainWindow::set_working_directory();
-
{
mem<MainWindow> w = std::make_shared<MainWindow>();