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

Use install_base_filter for lib_base.

This commit is contained in:
John Preston
2019-09-19 12:28:36 +03:00
parent a6b96662c4
commit f677b116f9
14 changed files with 43 additions and 124 deletions

View File

@@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/ui_utility.h"
#include "platform/platform_specific.h"
#include "core/application.h"
#include "core/event_filter.h"
#include "base/event_filter.h"
#include "main/main_session.h"
#include "app.h"
#include "styles/style_chat_helpers.h"
@@ -525,17 +525,17 @@ SuggestionsController::SuggestionsController(
const auto fieldCallback = [=](not_null<QEvent*> event) {
return fieldFilter(event)
? Core::EventFilter::Result::Cancel
: Core::EventFilter::Result::Continue;
? base::EventFilterResult::Cancel
: base::EventFilterResult::Continue;
};
_fieldFilter.reset(Core::InstallEventFilter(_field, fieldCallback));
_fieldFilter.reset(base::install_event_filter(_field, fieldCallback));
const auto outerCallback = [=](not_null<QEvent*> event) {
return outerFilter(event)
? Core::EventFilter::Result::Cancel
: Core::EventFilter::Result::Continue;
? base::EventFilterResult::Cancel
: base::EventFilterResult::Continue;
};
_outerFilter.reset(Core::InstallEventFilter(outer, outerCallback));
_outerFilter.reset(base::install_event_filter(outer, outerCallback));
QObject::connect(
_field,

View File

@@ -12,13 +12,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_item.h" // HistoryItem::originalText
#include "base/qthelp_regex.h"
#include "base/qthelp_url.h"
#include "base/event_filter.h"
#include "boxes/abstract_box.h"
#include "ui/wrap/vertical_layout.h"
#include "ui/widgets/popup_menu.h"
#include "ui/ui_utility.h"
#include "data/data_session.h"
#include "data/data_user.h"
#include "core/event_filter.h"
#include "chat_helpers/emoji_suggestions_widget.h"
#include "window/window_session_controller.h"
#include "lang/lang_keys.h"
@@ -676,10 +676,10 @@ void SetupSendMenu(
(*menu)->popup(QCursor::pos());
return true;
};
Core::InstallEventFilter(button, [=](not_null<QEvent*> e) {
base::install_event_filter(button, [=](not_null<QEvent*> e) {
if (e->type() == QEvent::ContextMenu && showMenu()) {
return Core::EventFilter::Result::Cancel;
return base::EventFilterResult::Cancel;
}
return Core::EventFilter::Result::Continue;
return base::EventFilterResult::Continue;
});
}