From 53fcf673968f6e3565beeeeffddccfc940d37e39 Mon Sep 17 00:00:00 2001 From: rolandlo Date: Mon, 10 Apr 2023 12:49:58 +0200 Subject: [PATCH] Remove unused functions or marked as maybe_unused --- src/core/control/Control.cpp | 32 +-------- src/core/control/Control.h | 4 -- src/core/control/FullscreenHandler.cpp | 46 +------------ src/core/control/FullscreenHandler.h | 1 - src/core/control/PdfCache.cpp | 2 - src/core/control/PdfCache.h | 5 -- src/core/control/settings/Settings.cpp | 68 +++++++++---------- src/core/control/settings/Settings.h | 5 +- src/core/gui/LegacyRedrawable.h | 2 +- src/core/gui/MainWindow.h | 4 +- src/core/gui/PageView.cpp | 7 +- src/core/gui/PageView.h | 3 +- src/core/gui/dialog/SettingsDialog.h | 2 +- .../ToolbarDragDropHandler.cpp | 2 - .../toolbarCustomize/ToolbarDragDropHandler.h | 2 - src/core/gui/scroll/ScrollHandling.cpp | 4 -- src/core/gui/scroll/ScrollHandling.h | 3 - src/core/gui/toolbarMenubar/ToolMenuHandler.h | 4 +- src/core/model/Image.h | 2 +- src/core/model/Snapping.cpp | 18 ----- src/core/model/Snapping.h | 8 --- src/core/model/Stroke.h | 2 +- src/core/view/Repaintable.h | 2 - 23 files changed, 52 insertions(+), 176 deletions(-) diff --git a/src/core/control/Control.cpp b/src/core/control/Control.cpp index 8704161b944b..7739e5af16e4 100644 --- a/src/core/control/Control.cpp +++ b/src/core/control/Control.cpp @@ -1282,30 +1282,6 @@ void Control::customizeToolbars() { this->dragDropHandler->configure(); } -void Control::endDragDropToolbar() { - if (!this->dragDropHandler) { - return; - } - - this->dragDropHandler->clearToolbarsFromDragAndDrop(); -} - -void Control::startDragDropToolbar() { - if (!this->dragDropHandler) { - return; - } - - this->dragDropHandler->prepareToolbarsForDragAndDrop(); -} - -auto Control::isInDragAndDropToolbar() -> bool { - if (!this->dragDropHandler) { - return false; - } - - return this->dragDropHandler->isInDragAndDrop(); -} - void Control::setShapeTool(ActionType type, bool enabled) { if (this->toolHandler->getDrawingType() == DRAWING_TYPE_SPLINE && (type != ACTION_TOOL_DRAW_SPLINE || !enabled)) { @@ -3142,13 +3118,9 @@ void Control::setClipboardHandlerSelection(EditSelection* selection) { } } -void Control::addChangedDocumentListener(DocumentListener* dl) { - this->changedDocumentListeners.push_back(dl); -} +void Control::addChangedDocumentListener(DocumentListener* dl) { this->changedDocumentListeners.push_back(dl); } -void Control::removeChangedDocumentListener(DocumentListener* dl) { - this->changedDocumentListeners.remove(dl); -} +void Control::removeChangedDocumentListener(DocumentListener* dl) { this->changedDocumentListeners.remove(dl); } void Control::setCopyCutEnabled(bool enabled) { this->clipboardHandler->setCopyCutEnabled(enabled); } diff --git a/src/core/control/Control.h b/src/core/control/Control.h index f5978df052d8..ff4f14b1eac8 100644 --- a/src/core/control/Control.h +++ b/src/core/control/Control.h @@ -184,10 +184,6 @@ class Control: void changePageBackgroundColor(); void updateBackgroundSizeButton(); - void endDragDropToolbar(); - void startDragDropToolbar(); - bool isInDragAndDropToolbar(); - /** * Loads the view mode (hide/show menu-,tool-&sidebar) */ diff --git a/src/core/control/FullscreenHandler.cpp b/src/core/control/FullscreenHandler.cpp index bdc2c010767e..5ac84fba67c3 100644 --- a/src/core/control/FullscreenHandler.cpp +++ b/src/core/control/FullscreenHandler.cpp @@ -17,52 +17,14 @@ FullscreenHandler::~FullscreenHandler() = default; auto FullscreenHandler::isFullscreen() const -> bool { return this->fullscreen; } -void FullscreenHandler::hideWidget(MainWindow* win, const std::string& widgetName) { - if ("sidebarContents" == widgetName && settings->isSidebarVisible()) { - this->sidebarHidden = true; - win->setSidebarVisible(false); - - return; - } - - if ("mainMenubar" == widgetName) { - // If the menu is hidden, shortcuts are not working anymore - // therefore the menu is not hidden, it's displayed, but invisible - // this costs 1px at the bottom, even if the preferred size is 0px, - // 1px is used by GTK - - GtkWidget* mainMenubar = win->get("mainMenubar"); - GtkWidget* mainBox = win->get("mainBox"); - - if (mainMenubar == nullptr || !gtk_widget_is_visible(mainMenubar)) { - // Menu not visible (global menu or something like this) - return; - } - - // Remove menu from parent - gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(mainMenubar)), mainMenubar); - - GtkWidget* fix = gtk_invisible_new(); - - gtk_widget_set_size_request(fix, 0, 0); - gtk_fixed_put(GTK_FIXED(fix), mainMenubar, 0, 0); - - gtk_widget_show(fix); - - gtk_box_pack_end(GTK_BOX(mainBox), fix, false, false, 0); - - menubarHidden = true; - - return; - } -} - void FullscreenHandler::enableFullscreen(MainWindow* win) { gtk_window_fullscreen(GTK_WINDOW(win->getWindow())); } void FullscreenHandler::disableFullscreen(MainWindow* win) { gtk_window_unfullscreen(GTK_WINDOW(win->getWindow())); - for (GtkWidget* w: hiddenFullscreenWidgets) { gtk_widget_show(w); } + for (GtkWidget* w: hiddenFullscreenWidgets) { + gtk_widget_show(w); + } hiddenFullscreenWidgets.clear(); if (this->sidebarHidden) { @@ -165,5 +127,3 @@ auto gtk_invisible_get_type() -> GType { return gtk_invisible_menu_type; } - -auto gtk_invisible_new() -> GtkWidget* { return GTK_WIDGET(g_object_new(gtk_invisible_get_type(), nullptr)); } diff --git a/src/core/control/FullscreenHandler.h b/src/core/control/FullscreenHandler.h index 035be7374391..f222a0c9ad9d 100644 --- a/src/core/control/FullscreenHandler.h +++ b/src/core/control/FullscreenHandler.h @@ -31,7 +31,6 @@ class FullscreenHandler { private: void enableFullscreen(MainWindow* win); - void hideWidget(MainWindow* win, const std::string& widgetName); void disableFullscreen(MainWindow* win); private: diff --git a/src/core/control/PdfCache.cpp b/src/core/control/PdfCache.cpp index 60b088762a6f..72aaf6a2c231 100644 --- a/src/core/control/PdfCache.cpp +++ b/src/core/control/PdfCache.cpp @@ -56,8 +56,6 @@ void PdfCache::updateSettings(Settings* settings) { } } -void PdfCache::clearCache() { this->data.clear(); } - auto PdfCache::lookup(size_t pdfPageNo) const -> const PdfCacheEntry* { for (auto& e: this->data) { if (static_cast(e->popplerPage->getPageId()) == pdfPageNo) { diff --git a/src/core/control/PdfCache.h b/src/core/control/PdfCache.h index 4ca74c3aaebb..dbac9847a375 100644 --- a/src/core/control/PdfCache.h +++ b/src/core/control/PdfCache.h @@ -45,13 +45,8 @@ class PdfCache { * @param pageWidth/pageHeight Xournal++ page dimensions */ void render(cairo_t* cr, size_t pdfPageNo, double zoom, double pageWidth, double pageHeight); - /** - * @brief Empty the cache - */ - void clearCache(); public: - /** * @brief Set the maximum tolerable zoom difference, as a percentage. * diff --git a/src/core/control/settings/Settings.cpp b/src/core/control/settings/Settings.cpp index 7ae06fca71e4..65bb23fed911 100644 --- a/src/core/control/settings/Settings.cpp +++ b/src/core/control/settings/Settings.cpp @@ -20,9 +20,9 @@ #include "gui/toolbarMenubar/model/ColorPalette.h" // for Palette #include "model/FormatDefinitions.h" // for FormatUnits, XOJ_... #include "util/Color.h" -#include "util/PathUtil.h" // for getConfigFile -#include "util/Util.h" // for PRECISION_FORMAT_... -#include "util/i18n.h" // for _ +#include "util/PathUtil.h" // for getConfigFile +#include "util/Util.h" // for PRECISION_FORMAT_... +#include "util/i18n.h" // for _ #include "ButtonConfig.h" // for ButtonConfig #include "config-dev.h" // for PALETTE_FILE @@ -144,30 +144,31 @@ void Settings::loadDefault() { this->defaultPdfExportName = _("%{name}_annotated"); // Eraser - this->buttonConfig[BUTTON_ERASER] = - std::make_unique(TOOL_ERASER, Colors::black, TOOL_SIZE_NONE, DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); + this->buttonConfig[BUTTON_ERASER] = std::make_unique(TOOL_ERASER, Colors::black, TOOL_SIZE_NONE, + DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); // Middle button - this->buttonConfig[BUTTON_MOUSE_MIDDLE] = - std::make_unique(TOOL_HAND, Colors::black, TOOL_SIZE_NONE, DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); + this->buttonConfig[BUTTON_MOUSE_MIDDLE] = std::make_unique(TOOL_HAND, Colors::black, TOOL_SIZE_NONE, + DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); // Right button - this->buttonConfig[BUTTON_MOUSE_RIGHT] = - std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); + this->buttonConfig[BUTTON_MOUSE_RIGHT] = std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, + DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); // Touch - this->buttonConfig[BUTTON_TOUCH] = - std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); + this->buttonConfig[BUTTON_TOUCH] = std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, + DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); // Default config - this->buttonConfig[BUTTON_DEFAULT] = - std::make_unique(TOOL_PEN, Colors::black, TOOL_SIZE_FINE, DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); + this->buttonConfig[BUTTON_DEFAULT] = std::make_unique(TOOL_PEN, Colors::black, TOOL_SIZE_FINE, + DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); // Pen button 1 - this->buttonConfig[BUTTON_STYLUS_ONE] = - std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); + this->buttonConfig[BUTTON_STYLUS_ONE] = std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, + DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); // Pen button 2 - this->buttonConfig[BUTTON_STYLUS_TWO] = - std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); + this->buttonConfig[BUTTON_STYLUS_TWO] = std::make_unique(TOOL_NONE, Colors::black, TOOL_SIZE_NONE, + DRAWING_TYPE_DEFAULT, ERASER_TYPE_NONE); // default view modes this->activeViewMode = PresetViewModeIds::VIEW_MODE_DEFAULT; - this->viewModes = std::vector{VIEW_MODE_STRUCT_DEFAULT, VIEW_MODE_STRUCT_FULLSCREEN, VIEW_MODE_STRUCT_PRESENTATION}; + this->viewModes = + std::vector{VIEW_MODE_STRUCT_DEFAULT, VIEW_MODE_STRUCT_FULLSCREEN, VIEW_MODE_STRUCT_PRESENTATION}; this->touchZoomStartThreshold = 0.0; @@ -240,9 +241,7 @@ auto Settings::loadViewMode(ViewModeId mode) -> bool { return true; } -auto Settings::getViewModes() const -> const std::vector& { - return this->viewModes; -} +auto Settings::getViewModes() const -> const std::vector& { return this->viewModes; } /** * tempg_ascii_strtod @@ -472,11 +471,14 @@ void Settings::parseItem(xmlDocPtr doc, xmlNodePtr cur) { } else if (xmlStrcmp(name, reinterpret_cast("autosaveTimeout")) == 0) { this->autosaveTimeout = g_ascii_strtoll(reinterpret_cast(value), nullptr, 10); } else if (xmlStrcmp(name, reinterpret_cast("defaultViewModeAttributes")) == 0) { - this->viewModes.at(PresetViewModeIds::VIEW_MODE_DEFAULT) = settingsStringToViewMode(reinterpret_cast(value)); + this->viewModes.at(PresetViewModeIds::VIEW_MODE_DEFAULT) = + settingsStringToViewMode(reinterpret_cast(value)); } else if (xmlStrcmp(name, reinterpret_cast("fullscreenViewModeAttributes")) == 0) { - this->viewModes.at(PresetViewModeIds::VIEW_MODE_FULLSCREEN) = settingsStringToViewMode(reinterpret_cast(value)); + this->viewModes.at(PresetViewModeIds::VIEW_MODE_FULLSCREEN) = + settingsStringToViewMode(reinterpret_cast(value)); } else if (xmlStrcmp(name, reinterpret_cast("presentationViewModeAttributes")) == 0) { - this->viewModes.at(PresetViewModeIds::VIEW_MODE_PRESENTATION) = settingsStringToViewMode(reinterpret_cast(value)); + this->viewModes.at(PresetViewModeIds::VIEW_MODE_PRESENTATION) = + settingsStringToViewMode(reinterpret_cast(value)); } else if (xmlStrcmp(name, reinterpret_cast("touchZoomStartThreshold")) == 0) { this->touchZoomStartThreshold = g_ascii_strtod(reinterpret_cast(value), nullptr); } else if (xmlStrcmp(name, reinterpret_cast("pageRerenderThreshold")) == 0) { @@ -936,7 +938,8 @@ void Settings::save() { auto defaultViewModeAttributes = viewModeToSettingsString(viewModes.at(PresetViewModeIds::VIEW_MODE_DEFAULT)); auto fullscreenViewModeAttributes = viewModeToSettingsString(viewModes.at(PresetViewModeIds::VIEW_MODE_FULLSCREEN)); - auto presentationViewModeAttributes = viewModeToSettingsString(viewModes.at(PresetViewModeIds::VIEW_MODE_PRESENTATION)); + auto presentationViewModeAttributes = + viewModeToSettingsString(viewModes.at(PresetViewModeIds::VIEW_MODE_PRESENTATION)); SAVE_STRING_PROP(defaultViewModeAttributes); ATTACH_COMMENT("Which GUI elements are shown in default view mode, separated by a colon (,)"); SAVE_STRING_PROP(fullscreenViewModeAttributes); @@ -948,7 +951,8 @@ void Settings::save() { ATTACH_COMMENT("The cursor icon used with a stylus, allowed values are \"none\", \"dot\", \"big\", \"arrow\""); xmlNode = saveProperty("eraserVisibility", eraserVisibilityToString(this->eraserVisibility), root); - ATTACH_COMMENT("The eraser cursor visibility used with a stylus, allowed values are \"never\", \"always\", \"hover\", \"touch\""); + ATTACH_COMMENT("The eraser cursor visibility used with a stylus, allowed values are \"never\", \"always\", " + "\"hover\", \"touch\""); xmlNode = saveProperty("iconTheme", iconThemeToString(this->iconTheme), root); ATTACH_COMMENT("The icon theme, allowed values are \"iconsColor\", \"iconsLucide\""); @@ -1614,7 +1618,9 @@ void Settings::setPresentationMode(bool presentationMode) { save(); } -auto Settings::isPresentationMode() const -> bool { return this->activeViewMode == PresetViewModeIds::VIEW_MODE_PRESENTATION; } +auto Settings::isPresentationMode() const -> bool { + return this->activeViewMode == PresetViewModeIds::VIEW_MODE_PRESENTATION; +} void Settings::setPressureSensitivity(gboolean presureSensitivity) { if (this->pressureSensitivity == presureSensitivity) { @@ -1810,10 +1816,6 @@ auto Settings::areStockIconsUsed() const -> bool { return this->useStockIcons; } auto Settings::isFullscreen() const -> bool { return this->fullscreenActive; } -void Settings::setIsFullscreen(bool isFullscreen) { - this->fullscreenActive = isFullscreen; -} - auto Settings::isSidebarVisible() const -> bool { return this->showSidebar; } void Settings::setSidebarVisible(bool visible) { @@ -1883,9 +1885,7 @@ auto Settings::getButtonConfig(unsigned int id) -> ButtonConfig* { return this->buttonConfig[id].get(); } -void Settings::setViewMode(ViewModeId mode, ViewMode viewMode) { - viewModes.at(mode) = viewMode; -} +void Settings::setViewMode(ViewModeId mode, ViewMode viewMode) { viewModes.at(mode) = viewMode; } auto Settings::getTouchZoomStartThreshold() const -> double { return this->touchZoomStartThreshold; } void Settings::setTouchZoomStartThreshold(double threshold) { diff --git a/src/core/control/settings/Settings.h b/src/core/control/settings/Settings.h index 433fdf1f70e4..11ececb92836 100644 --- a/src/core/control/settings/Settings.h +++ b/src/core/control/settings/Settings.h @@ -11,13 +11,13 @@ #pragma once +#include // for array #include // for size_t #include // for map #include // for make_shared, shared_ptr #include // for string, basic_string #include // for pair #include // for vector -#include // for array #include // for GdkInputSource, GdkD... #include // for gchar, gboolean, gint @@ -30,8 +30,8 @@ #include "LatexSettings.h" // for LatexSettings #include "SettingsEnums.h" // for InputDeviceTypeOption -#include "filesystem.h" // for path #include "ViewModes.h" // for ViewModes +#include "filesystem.h" // for path struct Palette; @@ -211,7 +211,6 @@ class Settings { bool isMainWndMaximized() const; bool isFullscreen() const; - void setIsFullscreen(bool isFullscreen); bool isSidebarVisible() const; void setSidebarVisible(bool visible); diff --git a/src/core/gui/LegacyRedrawable.h b/src/core/gui/LegacyRedrawable.h index 06df3e4cd27a..a03335f88757 100644 --- a/src/core/gui/LegacyRedrawable.h +++ b/src/core/gui/LegacyRedrawable.h @@ -46,7 +46,7 @@ class [[deprecated]] LegacyRedrawable { * for refreshing the view buffer (if you have changed the document) call rerender. */ virtual void repaintArea(double x1, double y1, double x2, double y2) const = 0; - void repaintRect(double x, double y, double width, double height) const; + [[maybe_unused]] void repaintRect(double x, double y, double width, double height) const; [[maybe_unused]] void repaintElement(Element* e) const; /** diff --git a/src/core/gui/MainWindow.h b/src/core/gui/MainWindow.h index 54509e7d44f4..b406f5ae4d80 100644 --- a/src/core/gui/MainWindow.h +++ b/src/core/gui/MainWindow.h @@ -112,9 +112,7 @@ class MainWindow: public GladeGui, public LayerCtrlListener { Layout* getLayout() const; - bool isGestureActive() const; - - Menubar* getMenubar() const; + [[maybe_unused]] Menubar* getMenubar() const; /** * Disable kinetic scrolling if there is a touchscreen device that was manually mapped to another enabled input diff --git a/src/core/gui/PageView.cpp b/src/core/gui/PageView.cpp index 4a1fd264fc2a..1ec4fbc89a7d 100644 --- a/src/core/gui/PageView.cpp +++ b/src/core/gui/PageView.cpp @@ -304,8 +304,9 @@ auto XojPageView::onButtonPressEvent(const PositionInputData& pos) -> bool { auto* zoomControl = this->getXournal()->getControl()->getZoomControl(); this->verticalSpace = std::make_unique(this->page, this->settings, y, pos.isControlDown()); this->overlayViews.emplace_back(this->verticalSpace->createView(this, zoomControl, this->settings)); - } else if (h->getToolType() == TOOL_SELECT_RECT || h->getToolType() == TOOL_SELECT_REGION || h->getToolType() == TOOL_SELECT_MULTILAYER_RECT || - h->getToolType() == TOOL_SELECT_MULTILAYER_REGION || h->getToolType() == TOOL_PLAY_OBJECT || h->getToolType() == TOOL_SELECT_OBJECT || + } else if (h->getToolType() == TOOL_SELECT_RECT || h->getToolType() == TOOL_SELECT_REGION || + h->getToolType() == TOOL_SELECT_MULTILAYER_RECT || h->getToolType() == TOOL_SELECT_MULTILAYER_REGION || + h->getToolType() == TOOL_PLAY_OBJECT || h->getToolType() == TOOL_SELECT_OBJECT || h->getToolType() == TOOL_SELECT_PDF_TEXT_LINEAR || h->getToolType() == TOOL_SELECT_PDF_TEXT_RECT) { if (h->getToolType() == TOOL_SELECT_RECT) { if (!selection) { @@ -778,8 +779,6 @@ void XojPageView::deleteOverlayView(xoj::view::OverlayView* v, const Range& rg) } } -int XojPageView::getDPIScaling() const { return xournal->getDpiScaleFactor(); } - double XojPageView::getZoom() const { return xournal->getZoom(); } ZoomControl* XojPageView::getZoomControl() const { return this->getXournal()->getControl()->getZoomControl(); } diff --git a/src/core/gui/PageView.h b/src/core/gui/PageView.h index 89699f292e6e..4879b4e33ba7 100644 --- a/src/core/gui/PageView.h +++ b/src/core/gui/PageView.h @@ -50,7 +50,7 @@ class XojPdfPage; namespace xoj::view { class OverlayView; class ToolView; -} +} // namespace xoj::view class XojPageView: public LegacyRedrawable, public PageListener, public xoj::view::Repaintable { public: @@ -78,7 +78,6 @@ class XojPageView: public LegacyRedrawable, public PageListener, public xoj::vie */ void deleteOverlayView(xoj::view::OverlayView* v, const Range& rg) override; - int getDPIScaling() const override; double getZoom() const override; ZoomControl* getZoomControl() const override; Range getVisiblePart() const override; diff --git a/src/core/gui/dialog/SettingsDialog.h b/src/core/gui/dialog/SettingsDialog.h index e9df9235fb2e..dc6d5f5e9d10 100644 --- a/src/core/gui/dialog/SettingsDialog.h +++ b/src/core/gui/dialog/SettingsDialog.h @@ -47,7 +47,7 @@ class SettingsDialog: public GladeGui { * Set active regions */ void enableWithCheckbox(const std::string& checkbox, const std::string& widget); - void disableWithCheckbox(const std::string& checkbox, const std::string& widget); + [[maybe_unused]] void disableWithCheckbox(const std::string& checkbox, const std::string& widget); /* * Listeners for changes to settings. diff --git a/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.cpp b/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.cpp index 15ee577f9e3a..46ce8062aba2 100644 --- a/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.cpp +++ b/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.cpp @@ -55,5 +55,3 @@ void ToolbarDragDropHandler::configure() { this->customizeDialog->show(GTK_WINDOW(win->getWindow())); } - -auto ToolbarDragDropHandler::isInDragAndDrop() -> bool { return !this->toolbars.empty(); } diff --git a/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.h b/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.h index f1daf98d503e..29accc6fcd25 100644 --- a/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.h +++ b/src/core/gui/dialog/toolbarCustomize/ToolbarDragDropHandler.h @@ -28,8 +28,6 @@ class ToolbarDragDropHandler { void toolbarConfigDialogClosed(); - bool isInDragAndDrop(); - public: void prepareToolbarsForDragAndDrop(); void clearToolbarsFromDragAndDrop(); diff --git a/src/core/gui/scroll/ScrollHandling.cpp b/src/core/gui/scroll/ScrollHandling.cpp index 6adf1132d840..3871f2334a5f 100644 --- a/src/core/gui/scroll/ScrollHandling.cpp +++ b/src/core/gui/scroll/ScrollHandling.cpp @@ -39,7 +39,3 @@ void ScrollHandling::setLayoutSize(int width, int height) { } #endif } - -auto ScrollHandling::getPreferredWidth() -> int { return layout->getMinimalWidth(); } - -auto ScrollHandling::getPreferredHeight() -> int { return layout->getMinimalHeight(); } diff --git a/src/core/gui/scroll/ScrollHandling.h b/src/core/gui/scroll/ScrollHandling.h index eb3d3a278eea..01a83eea89fc 100644 --- a/src/core/gui/scroll/ScrollHandling.h +++ b/src/core/gui/scroll/ScrollHandling.h @@ -29,9 +29,6 @@ class ScrollHandling { void setLayoutSize(int width, int height); - int getPreferredWidth(); - int getPreferredHeight(); - private: protected: GtkAdjustment* adjHorizontal = nullptr; diff --git a/src/core/gui/toolbarMenubar/ToolMenuHandler.h b/src/core/gui/toolbarMenubar/ToolMenuHandler.h index fc0f364e6cb5..cb2463e3083d 100644 --- a/src/core/gui/toolbarMenubar/ToolMenuHandler.h +++ b/src/core/gui/toolbarMenubar/ToolMenuHandler.h @@ -86,7 +86,7 @@ class ToolMenuHandler { void setTmpDisabled(bool disabled); - void removeColorToolItem(AbstractToolItem* it); + [[maybe_unused]] void removeColorToolItem(AbstractToolItem* it); void addColorToolItem(AbstractToolItem* it); ToolbarModel* getModel(); @@ -96,7 +96,7 @@ class ToolMenuHandler { Control* getControl(); - bool isColorInUse(Color color); + [[maybe_unused]] bool isColorInUse(Color color); void disableAudioPlaybackButtons(); diff --git a/src/core/model/Image.h b/src/core/model/Image.h index c1a021d0c29d..167d7941fdd2 100644 --- a/src/core/model/Image.h +++ b/src/core/model/Image.h @@ -72,7 +72,7 @@ class Image: public Element { /// Return the size of the raw image, or (-1, -1) if the image has not been rendered yet. std::pair getImageSize() const; - GdkPixbufFormat* getImageFormat() const; + [[maybe_unused]] GdkPixbufFormat* getImageFormat() const; static constexpr std::pair NOSIZE = std::make_pair(-1, -1); diff --git a/src/core/model/Snapping.cpp b/src/core/model/Snapping.cpp index 4804b5174ea5..f151a1c23b70 100644 --- a/src/core/model/Snapping.cpp +++ b/src/core/model/Snapping.cpp @@ -60,22 +60,4 @@ double distanceLine(Point const& pos, Point const& first, Point const& second) { } } -Point snapToLine(Point const& pos, Point const& first, Point const& second, double tolerance) { - if (first.x == second.x && first.y == second.y) { - return distance(pos, first) > tolerance ? pos : first; - } - const double dist = distanceLine(pos, first, second); - const double dist1 = distance(pos, first); - const double dist2 = distance(pos, second); - const double distance = std::min({dist, dist1, dist2}); - if (distance > tolerance) { - return pos; - } else if (distance == dist1) { - return first; - } else if (distance == dist2) { - return second; - } else { - return projToLine(pos, first, second); - } -} } // namespace Snapping diff --git a/src/core/model/Snapping.h b/src/core/model/Snapping.h index 1d767ee0932a..2797afc0b95c 100644 --- a/src/core/model/Snapping.h +++ b/src/core/model/Snapping.h @@ -74,12 +74,4 @@ namespace Snapping { */ [[nodiscard]] double distanceLine(Point const& pos, Point const& first, Point const& second); -/** - * @brief Snaps a given point to the closest point on a line segment specified by its end points - * @param pos the given point - * @param first the first end point of the line segement - * @param second the second end point of the line segment - * @param tolerance the tolerance (in pt) - */ -[[nodiscard]] Point snapToLine(Point const& pos, Point const& first, Point const& second, double tolerance); } // namespace Snapping diff --git a/src/core/model/Stroke.h b/src/core/model/Stroke.h index 8fcdda56f1e9..93d6317a1250 100644 --- a/src/core/model/Stroke.h +++ b/src/core/model/Stroke.h @@ -129,7 +129,7 @@ class Stroke: public AudioElement { void setPointVectorInternal(const Range* const snappingBox); public: - void deletePoint(int index); + [[maybe_unused]] void deletePoint(int index); void deletePointsFrom(size_t index); void setToolType(StrokeTool type); diff --git a/src/core/view/Repaintable.h b/src/core/view/Repaintable.h index 90faf9555a91..14c880f2e335 100644 --- a/src/core/view/Repaintable.h +++ b/src/core/view/Repaintable.h @@ -36,8 +36,6 @@ class Repaintable { */ virtual Range getVisiblePart() const = 0; - virtual int getDPIScaling() const = 0; - // Get the current zoom. virtual double getZoom() const = 0; virtual ZoomControl* getZoomControl() const = 0;