From d901b987aacc63c04a69f9d3787f5e8eaa695497 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 18 Dec 2021 14:15:58 -0330 Subject: [PATCH] Fix minor warnings from clang-13. --- src/gui/FavoritesManager.cxx | 2 ++ src/gui/FileListWidget.cxx | 2 ++ src/gui/Icon.hxx | 4 ++-- src/gui/Icons.hxx | 1 + src/gui/NavigationWidget.hxx | 8 ++++---- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/FavoritesManager.cxx b/src/gui/FavoritesManager.cxx index 9ba3cf0aa..70f8bd9c9 100644 --- a/src/gui/FavoritesManager.cxx +++ b/src/gui/FavoritesManager.cxx @@ -216,6 +216,7 @@ void FavoritesManager::addRecent(const string& path) myRecentList.erase(myRecentList.begin()); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool FavoritesManager::removeRecent(const string& path) { auto it = std::find(myRecentList.begin(), myRecentList.end(), path); @@ -260,6 +261,7 @@ const FavoritesManager::RecentList& FavoritesManager::recentList() const return sortedList; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool FavoritesManager::removePopular(const string& path) { return myPopularMap.erase(path); diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index 7c61ded4e..19c9cf859 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -155,6 +155,7 @@ void FileListWidget::getChildren(const FilesystemNode::CancelCheck& isCancelled) } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FileListWidget::IconType FileListWidget::getIconType(const string& path) const { const FilesystemNode node(path); @@ -239,6 +240,7 @@ bool FileListWidget::hasNextHistory() return _currentHistory != std::prev(_history.end(), 1); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string& FileListWidget::fixPath(string& path) { if(path.back() == FilesystemNode::PATH_SEPARATOR) diff --git a/src/gui/Icon.hxx b/src/gui/Icon.hxx index 11b4f1b6b..0129d9a60 100644 --- a/src/gui/Icon.hxx +++ b/src/gui/Icon.hxx @@ -27,8 +27,8 @@ namespace GUI { struct IconDesc { - int width; - int height; + int width{0}; + int height{0}; explicit IconDesc(int _width, int _height) : width{_width}, height{_height} {} diff --git a/src/gui/Icons.hxx b/src/gui/Icons.hxx index d5c19ef13..163671188 100644 --- a/src/gui/Icons.hxx +++ b/src/gui/Icons.hxx @@ -527,4 +527,5 @@ static const Icon icon_help_large( }); } // namespace GUI + #endif diff --git a/src/gui/NavigationWidget.hxx b/src/gui/NavigationWidget.hxx index 17e6e6c04..2a3f01a48 100644 --- a/src/gui/NavigationWidget.hxx +++ b/src/gui/NavigationWidget.hxx @@ -40,7 +40,7 @@ class NavigationWidget : public Widget public: FolderLinkWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& text, const string& path); - ~FolderLinkWidget() = default; + ~FolderLinkWidget() override = default; void setPath(const string& path) { myPath = path; } const string& getPath() const { return myPath; } @@ -63,7 +63,7 @@ class NavigationWidget : public Widget public: PathWidget(GuiObject* boss, CommandReceiver* target, const GUI::Font& font, int x, int y, int w, int h); - ~PathWidget() = default; + ~PathWidget() override = default; void setPath(const string& path); const string& getPath(int idx) const; @@ -78,7 +78,7 @@ class NavigationWidget : public Widget : path{_path}, widget{_widget} {} }; std::vector myFolderList; - CommandReceiver* myTarget; + CommandReceiver* myTarget{nullptr}; private: // Following constructors and assignment operators not supported @@ -92,7 +92,7 @@ class NavigationWidget : public Widget public: NavigationWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h); - ~NavigationWidget() = default; + ~NavigationWidget() override = default; void setWidth(int w) override; void setList(FileListWidget* list);