2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

link clicks and popup menu items activated async, some crashes fixed

This commit is contained in:
John Preston
2016-02-16 14:21:39 +03:00
parent ebd77ba71d
commit a5b466ec05
11 changed files with 41 additions and 18 deletions

View File

@@ -63,11 +63,26 @@ namespace App {
}
void removeDialog(History *history) {
if (MainWidget *m = main()) m->removeDialog(history);
if (MainWidget *m = main()) {
m->removeDialog(history);
}
}
void showSettings() {
if (Window *win = wnd()) win->showSettings();
if (Window *w = wnd()) {
w->showSettings();
}
}
Q_DECLARE_METATYPE(TextLinkPtr);
Q_DECLARE_METATYPE(Qt::MouseButton);
void activateTextLink(TextLinkPtr link, Qt::MouseButton button) {
if (Window *w = wnd()) {
qRegisterMetaType<TextLinkPtr>();
qRegisterMetaType<Qt::MouseButton>();
QMetaObject::invokeMethod(w, "app_activateTextLink", Qt::QueuedConnection, Q_ARG(TextLinkPtr, link), Q_ARG(Qt::MouseButton, button));
}
}
}