Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
misc: general cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Oct 21, 2023
1 parent c7f4868 commit 78fc505
Show file tree
Hide file tree
Showing 45 changed files with 155 additions and 34 deletions.
26 changes: 26 additions & 0 deletions examples/dialog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ if(WIN32)
PATH "${__manifest_path}"
ID "org.wangwenx190.demo.Dialog"
VERSION "${PROJECT_VERSION}"
DESCRIPTION "FramelessHelper Demo Application: Dialog"
VISTA_COMPAT
WIN7_COMPAT
WIN8_COMPAT
Expand Down Expand Up @@ -103,6 +104,31 @@ setup_gui_app(
BUNDLE_VERSION_SHORT "1.0"
)

setup_target_rpaths(TARGETS ${DEMO_NAME})

setup_qt_stuff(TARGETS ${DEMO_NAME})

set(__extra_flags "")
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)
list(APPEND __extra_flags PERMISSIVE)
endif()
if(FRAMELESSHELPER_ENABLE_SPECTRE)
list(APPEND __extra_flags SPECTRE)
endif()
if(FRAMELESSHELPER_ENABLE_EHCONTGUARD)
list(APPEND __extra_flags EHCONTGUARD)
endif()
if(FRAMELESSHELPER_ENABLE_INTELCET)
list(APPEND __extra_flags INTELCET)
endif()
if(FRAMELESSHELPER_ENABLE_CFGUARD)
list(APPEND __extra_flags CFGUARD)
endif()
if(FRAMELESSHELPER_FORCE_LTO)
list(APPEND __extra_flags FORCE_LTO)
endif()
setup_compile_params(TARGETS ${DEMO_NAME} ${__extra_flags})

if(FRAMELESSHELPER_EXAMPLES_DEPLOYQT)
set(__extra_flags)
if(FRAMELESSHELPER_NO_INSTALL)
Expand Down
2 changes: 1 addition & 1 deletion examples/dialog/dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FRAMELESSHELPER_END_NAMESPACE
class Dialog : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessDialog)
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(Dialog)
Q_DISABLE_COPY(Dialog)

public:
explicit Dialog(QWidget *parent = nullptr);
Expand Down
26 changes: 26 additions & 0 deletions examples/mainwindow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ if(WIN32)
PATH "${__manifest_path}"
ID "org.wangwenx190.demo.MainWindow"
VERSION "${PROJECT_VERSION}"
DESCRIPTION "FramelessHelper Demo Application: MainWindow"
VISTA_COMPAT
WIN7_COMPAT
WIN8_COMPAT
Expand Down Expand Up @@ -108,6 +109,31 @@ setup_gui_app(
BUNDLE_VERSION_SHORT "1.0"
)

setup_target_rpaths(TARGETS ${DEMO_NAME})

setup_qt_stuff(TARGETS ${DEMO_NAME})

set(__extra_flags "")
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)
list(APPEND __extra_flags PERMISSIVE)
endif()
if(FRAMELESSHELPER_ENABLE_SPECTRE)
list(APPEND __extra_flags SPECTRE)
endif()
if(FRAMELESSHELPER_ENABLE_EHCONTGUARD)
list(APPEND __extra_flags EHCONTGUARD)
endif()
if(FRAMELESSHELPER_ENABLE_INTELCET)
list(APPEND __extra_flags INTELCET)
endif()
if(FRAMELESSHELPER_ENABLE_CFGUARD)
list(APPEND __extra_flags CFGUARD)
endif()
if(FRAMELESSHELPER_FORCE_LTO)
list(APPEND __extra_flags FORCE_LTO)
endif()
setup_compile_params(TARGETS ${DEMO_NAME} ${__extra_flags})

if(FRAMELESSHELPER_EXAMPLES_DEPLOYQT)
set(__extra_flags)
if(FRAMELESSHELPER_NO_INSTALL)
Expand Down
2 changes: 1 addition & 1 deletion examples/mainwindow/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MainWindow;
class MainWindow : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessMainWindow)
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(MainWindow)
Q_DISABLE_COPY(MainWindow)

public:
explicit MainWindow(QWidget *parent = nullptr, const Qt::WindowFlags flags = {});
Expand Down
2 changes: 1 addition & 1 deletion examples/openglwidget/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GLWidget;
class MainWindow : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessWidget)
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(MainWindow)
Q_DISABLE_COPY(MainWindow)

public:
explicit MainWindow(QWidget *parent = nullptr);
Expand Down
26 changes: 26 additions & 0 deletions examples/quick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ if(WIN32)
PATH "${__manifest_path}"
ID "org.wangwenx190.demo.Quick"
VERSION "${PROJECT_VERSION}"
DESCRIPTION "FramelessHelper Demo Application: Quick"
VISTA_COMPAT
WIN7_COMPAT
WIN8_COMPAT
Expand Down Expand Up @@ -135,6 +136,31 @@ setup_gui_app(
BUNDLE_VERSION_SHORT "1.0"
)

setup_target_rpaths(TARGETS ${DEMO_NAME})

setup_qt_stuff(TARGETS ${DEMO_NAME})

set(__extra_flags "")
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)
list(APPEND __extra_flags PERMISSIVE)
endif()
if(FRAMELESSHELPER_ENABLE_SPECTRE)
list(APPEND __extra_flags SPECTRE)
endif()
if(FRAMELESSHELPER_ENABLE_EHCONTGUARD)
list(APPEND __extra_flags EHCONTGUARD)
endif()
if(FRAMELESSHELPER_ENABLE_INTELCET)
list(APPEND __extra_flags INTELCET)
endif()
if(FRAMELESSHELPER_ENABLE_CFGUARD)
list(APPEND __extra_flags CFGUARD)
endif()
if(FRAMELESSHELPER_FORCE_LTO)
list(APPEND __extra_flags FORCE_LTO)
endif()
setup_compile_params(TARGETS ${DEMO_NAME} ${__extra_flags})

if(FRAMELESSHELPER_EXAMPLES_DEPLOYQT)
set(__extra_flags)
if(FRAMELESSHELPER_NO_INSTALL)
Expand Down
2 changes: 1 addition & 1 deletion examples/quick/quicksettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class QuickSettings : public QObject
#ifdef QML_SINGLETON
QML_SINGLETON
#endif
Q_DISABLE_COPY_MOVE(QuickSettings)
Q_DISABLE_COPY(QuickSettings)

public:
explicit QuickSettings(QObject *parent = nullptr);
Expand Down
26 changes: 26 additions & 0 deletions examples/widget/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ if(WIN32)
PATH "${__manifest_path}"
ID "org.wangwenx190.demo.Widget"
VERSION "${PROJECT_VERSION}"
DESCRIPTION "FramelessHelper Demo Application: Widget"
VISTA_COMPAT
WIN7_COMPAT
WIN8_COMPAT
Expand Down Expand Up @@ -103,6 +104,31 @@ setup_gui_app(
BUNDLE_VERSION_SHORT "1.0"
)

setup_target_rpaths(TARGETS ${DEMO_NAME})

setup_qt_stuff(TARGETS ${DEMO_NAME})

set(__extra_flags "")
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)
list(APPEND __extra_flags PERMISSIVE)
endif()
if(FRAMELESSHELPER_ENABLE_SPECTRE)
list(APPEND __extra_flags SPECTRE)
endif()
if(FRAMELESSHELPER_ENABLE_EHCONTGUARD)
list(APPEND __extra_flags EHCONTGUARD)
endif()
if(FRAMELESSHELPER_ENABLE_INTELCET)
list(APPEND __extra_flags INTELCET)
endif()
if(FRAMELESSHELPER_ENABLE_CFGUARD)
list(APPEND __extra_flags CFGUARD)
endif()
if(FRAMELESSHELPER_FORCE_LTO)
list(APPEND __extra_flags FORCE_LTO)
endif()
setup_compile_params(TARGETS ${DEMO_NAME} ${__extra_flags})

if(FRAMELESSHELPER_EXAMPLES_DEPLOYQT)
set(__extra_flags)
if(FRAMELESSHELPER_NO_INSTALL)
Expand Down
2 changes: 1 addition & 1 deletion examples/widget/widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ FRAMELESSHELPER_END_NAMESPACE
class Widget : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessWidget)
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(Widget)
Q_DISABLE_COPY(Widget)

public:
explicit Widget(QWidget *parent = nullptr);
Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Core/chromepalette.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(titlebar)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Core/framelesshelper_qt.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <memory>

#if !FRAMELESSHELPER_CONFIG(native_impl)

Expand Down
2 changes: 1 addition & 1 deletion include/FramelessHelper/Core/framelesshelpercore_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ QT_END_NAMESPACE
# define FRAMELESSHELPER_CLASS_DPTR(Class) \
private: \
Q_DECLARE_PRIVATE(Class) \
const QScopedPointer<Class##Private> d_ptr;
const std::unique_ptr<Class##Private> d_ptr;
#endif

#ifndef FRAMELESSHELPER_CLASS_QPTR
Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Core/framelessmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <memory>

FRAMELESSHELPER_BEGIN_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Core/micamaterial.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(mica_material)

Expand Down
5 changes: 3 additions & 2 deletions include/FramelessHelper/Core/private/registrykey_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <QtCore/qvariant.h>
#include <optional>
#include <memory>

#ifdef Q_OS_WINDOWS

Expand Down Expand Up @@ -86,9 +87,9 @@ class FRAMELESSHELPER_CORE_API RegistryKey : public QObject
Global::RegistryRootKey m_rootKey = Global::RegistryRootKey::CurrentUser;
QString m_subKey = {};
#if REGISTRYKEY_QWINREGISTRYKEY
QScopedPointer<QWinRegistryKey> m_registryKey;
std::unique_ptr<QWinRegistryKey> m_registryKey;
#else
QScopedPointer<QSettings> m_settings;
std::unique_ptr<QSettings> m_settings;
#endif
};

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Core/windowborderpainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Core/framelesshelpercore_global.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(border_painter)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Quick/framelessquickhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickwindow.h>
#include <memory>

FRAMELESSHELPER_BEGIN_NAMESPACE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <memory>

#if (FRAMELESSHELPER_CONFIG(private_qt) && FRAMELESSHELPER_CONFIG(window) && (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <memory>

#if (FRAMELESSHELPER_CONFIG(private_qt) && FRAMELESSHELPER_CONFIG(window))

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Quick/quickmicamaterial.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickpainteditem.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(mica_material)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Quick/quickwindowborder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <FramelessHelper/Quick/framelesshelperquick_global.h>
#include <QtQuick/qquickpainteditem.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(border_painter)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Widgets/framelessdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qdialog.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(window)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Widgets/framelessmainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qmainwindow.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(window)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Widgets/framelesswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qwidget.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(window)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Widgets/framelesswidgetshelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qwidget.h>
#include <memory>

FRAMELESSHELPER_BEGIN_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Widgets/standardsystembutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <QtWidgets/qpushbutton.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(system_button)

Expand Down
1 change: 1 addition & 0 deletions include/FramelessHelper/Widgets/standardtitlebar.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once

#include <FramelessHelper/Widgets/framelesshelperwidgets_global.h>
#include <memory>

#if FRAMELESSHELPER_CONFIG(titlebar)

Expand Down
2 changes: 1 addition & 1 deletion src/core/chromepalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void ChromePalettePrivate::refresh()
}

ChromePalette::ChromePalette(QObject *parent) :
QObject(parent), d_ptr(new ChromePalettePrivate(this))
QObject(parent), d_ptr(std::make_unique<ChromePalettePrivate>(this))
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/framelesshelper_qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ FramelessHelperQtPrivate::FramelessHelperQtPrivate(FramelessHelperQt *q) : q_ptr

FramelessHelperQtPrivate::~FramelessHelperQtPrivate() = default;

FramelessHelperQt::FramelessHelperQt(QObject *parent) : QObject(parent), d_ptr(new FramelessHelperQtPrivate(this))
FramelessHelperQt::FramelessHelperQt(QObject *parent) : QObject(parent), d_ptr(std::make_unique<FramelessHelperQtPrivate>(this))
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/framelessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ void FramelessManagerPrivate::initialize()
}

FramelessManager::FramelessManager(QObject *parent) :
QObject(parent), d_ptr(new FramelessManagerPrivate(this))
QObject(parent), d_ptr(std::make_unique<FramelessManagerPrivate>(this))
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/micamaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ QRect MicaMaterialPrivate::mapToWallpaper(const QRect &rect) const
}

MicaMaterial::MicaMaterial(QObject *parent)
: QObject(parent), d_ptr(new MicaMaterialPrivate(this))
: QObject(parent), d_ptr(std::make_unique<MicaMaterialPrivate>(this))
{
}

Expand Down
Loading

0 comments on commit 78fc505

Please sign in to comment.