Polymorphic classes without virtual dtor warning.

This commit is contained in:
John Preston 2019-02-15 15:24:58 +04:00
parent 032694ad9e
commit 98cb85df66
20 changed files with 43 additions and 23 deletions

View File

@ -132,6 +132,8 @@ public:
return _filterWheelEvent.events();
}
virtual ~FloatDelegate() = default;
protected:
void floatPlayerCheckVisibility() {
_checkVisibility.fire({});

View File

@ -13,7 +13,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <mmdeviceapi.h>
#include <audioclient.h>
#include <wrl\client.h>
#include <wrl/client.h>
using namespace Microsoft::WRL;
namespace Platform {

View File

@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/crash_reports.h"
#include "core/update_checker.h"
#include "platform/platform_specific.h"
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
#include <shellapi.h>

View File

@ -26,8 +26,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <WtsApi32.h>
#include <roapi.h>
#include <wrl\client.h>
#include <wrl\implements.h>
#include <wrl/client.h>
#include "platform/win/wrapper_wrl_implements_h.h"
#include <windows.ui.notifications.h>
#include <Windowsx.h>

View File

@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
#include "platform/platform_main_window.h"
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
#include "base/flags.h"
namespace Ui {

View File

@ -18,8 +18,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <shellapi.h>
#include <roapi.h>
#include <wrl\client.h>
#include <wrl\implements.h>
#include <wrl/client.h>
#include "platform/win/wrapper_wrl_implements_h.h"
#include <windows.ui.notifications.h>
#include <strsafe.h>
@ -196,7 +196,7 @@ typedef ABI::Windows::Foundation::ITypedEventHandler<ToastNotification*, ::IInsp
typedef ABI::Windows::Foundation::ITypedEventHandler<ToastNotification*, ToastDismissedEventArgs*> DesktopToastDismissedEventHandler;
typedef ABI::Windows::Foundation::ITypedEventHandler<ToastNotification*, ToastFailedEventArgs*> DesktopToastFailedEventHandler;
class ToastEventHandler : public Implements<
class ToastEventHandler final : public Implements<
DesktopToastActivatedEventHandler,
DesktopToastDismissedEventHandler,
DesktopToastFailedEventHandler> {
@ -210,7 +210,6 @@ public:
, _msgId(msg)
, _weak(guarded) {
}
~ToastEventHandler() = default;
void performOnMainQueue(FnMut<void(Manager *manager)> task) {
const auto weak = _weak;

View File

@ -23,16 +23,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <shellapi.h>
#include <roapi.h>
#include <wrl\client.h>
#include <wrl\implements.h>
#include <wrl/client.h>
#include "platform/win/wrapper_wrl_implements_h.h"
#include <windows.ui.notifications.h>
#pragma warning(push)
#pragma warning(disable:4091)
#include <dbghelp.h>
#include <shlobj.h>
#pragma warning(pop)
#include <Shlwapi.h>
#include <Strsafe.h>
#include <Windowsx.h>

View File

@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
class LocationCoords;

View File

@ -12,8 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <propkey.h>
#include <roapi.h>
#include <wrl\client.h>
#include <wrl\implements.h>
#include <wrl/client.h>
#include "platform/win/wrapper_wrl_implements_h.h"
#include <windows.ui.notifications.h>
using namespace Microsoft::WRL;

View File

@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
namespace Platform {
namespace AppUserModelId {

View File

@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
#include <shlobj.h>
#include <roapi.h>

View File

@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
namespace Platform {

View File

@ -0,0 +1,14 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#pragma warning(push)
// class has virtual functions, but destructor is not virtual
#pragma warning(disable:4265)
#include <wrl/implements.h>
#pragma warning(pop)

View File

@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "storage/storage_clear_legacy.h"
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
namespace Storage {
namespace details {

View File

@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/storage_file_lock.h"
#include "platform/win/windows_dlls.h"
#include "platform/win/windows_h_wrapper.h"
#include "platform/win/wrapper_windows_h.h"
#include <io.h>
#include <fileapi.h>

View File

@ -124,6 +124,8 @@ public:
rpl::lifetime &lifetime();
virtual ~RpWidgetMethods() = default;
protected:
bool handleEvent(QEvent *event);
virtual bool eventHook(QEvent *event) = 0;

View File

@ -43,6 +43,9 @@ class ModuleBase {
public:
virtual void start() = 0;
virtual void stop() = 0;
virtual ~ModuleBase() = default;
};
void registerModule(ModuleBase *module);

View File

@ -31,6 +31,7 @@
'/EHsc', # Catch C++ exceptions only, extern C functions never throw a C++ exception.
'/w14834', # [[nodiscard]]
'/w15038', # wrong initialization order
'/w14265', # class has virtual functions, but destructor is not virtual
],
'TreatWChar_tAsBuiltInType': 'false',
},

View File

@ -580,6 +580,8 @@
<(src_loc)/platform/win/windows_dlls.h
<(src_loc)/platform/win/windows_event_filter.cpp
<(src_loc)/platform/win/windows_event_filter.h
<(src_loc)/platform/win/wrapper_windows_h.h
<(src_loc)/platform/win/wrapper_wrl_implements_h.h
<(src_loc)/platform/platform_audio.h
<(src_loc)/platform/platform_file_utilities.h
<(src_loc)/platform/platform_launcher.h