[win-nix] refactoring

This commit is contained in:
Maxim Kadushkin
2019-06-18 16:40:58 +03:00
parent ca9c7ec25c
commit ca7fd172db
4 changed files with 4 additions and 17 deletions

View File

@ -156,7 +156,6 @@ win32 {
LIBS += -L$$CORE_LIB_PATH_PLATFORM -lPdfReader -lPdfWriter -lDjVuFile -lXpsFile -lHtmlRenderer -lUnicodeConverter -lhunspell -looxmlsignature -lkernel -lgraphics
DEFINES += SUPPORT_EMBEDDED_MEDIA
INCLUDEPATH += ../../core-ext/desktop-sdk-wrapper/additional
QT += multimedia multimediawidgets
build_xp {

View File

@ -56,16 +56,12 @@ CAscApplicationManagerWrapper::CAscApplicationManagerWrapper()
QObject::connect(this, &CAscApplicationManagerWrapper::coreEvent,
this, &CAscApplicationManagerWrapper::onCoreEvent);
#ifdef SUPPORT_EMBEDDED_MEDIA
NSBaseVideoLibrary::Init(nullptr);
#endif
}
CAscApplicationManagerWrapper::~CAscApplicationManagerWrapper()
{
#ifdef SUPPORT_EMBEDDED_MEDIA
NSBaseVideoLibrary::Destroy();
#endif
// CSingleWindow * _sw = nullptr;
// for (auto const& w : m_vecEditors) {
@ -467,7 +463,6 @@ bool CAscApplicationManagerWrapper::processCommonEvent(NSEditorApi::CAscCefMenuE
return true;}
#ifdef SUPPORT_EMBEDDED_MEDIA
case ASC_MENU_EVENT_TYPE_SYSTEM_EXTERNAL_MEDIA_START:
case ASC_MENU_EVENT_TYPE_SYSTEM_EXTERNAL_MEDIA_END: {
CCefView * _cef = GetViewById(event->get_SenderId());
@ -483,7 +478,6 @@ bool CAscApplicationManagerWrapper::processCommonEvent(NSEditorApi::CAscCefMenuE
return true;
}
#endif
default: break;
}
@ -726,7 +720,7 @@ void CAscApplicationManagerWrapper::closeEditorWindow(const size_t p)
// QMutexLocker locker( &_app.m_oMutex );
if ( p ) {
#if (__GNUC__ <= 4 && __GNUC_MINOR__ < 9)
#if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ < 9
vector<size_t>::iterator
#else
vector<size_t>::const_iterator

View File

@ -34,9 +34,7 @@
#define CASCAPPLICATIONMANAGERWRAPPER_PRIVATE_H
#include "cascapplicationmanagerwrapper.h"
#ifdef SUPPORT_EMBEDDED_MEDIA
# include "qcefview_media.h"
#endif
#include "qcefview_media.h"
class CAscApplicationManagerWrapper::CAscApplicationManagerWrapper_Private
{
@ -53,11 +51,7 @@ public:
void applyStylesheets() {}
QCefView * createView(QWidget * parent)
{
#ifdef SUPPORT_EMBEDDED_MEDIA
return new QCefView_Media(parent);
#else
return new QCefView(parent);
#endif
}
};

View File

@ -306,8 +306,8 @@ QString Utils::encodeJson(const QString& s)
wstring Utils::encodeJson(const wstring& s)
{
#if (__GNUC__ <= 4 && __GNUC_MINOR__ < 9)
QString::fromStdWString(s).replace("\"", "\\\"").toStdWString();
#if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ < 9
return QString::fromStdWString(s).replace("\"", "\\\"").toStdWString();
#else
return std::regex_replace(wstring(s), std::wregex(L"\""), L"\\\"");
#endif