diff --git a/src/common/FSNodeREGULAR.cxx b/src/common/FSNodeREGULAR.cxx index e39eb93ce..fd9835549 100644 --- a/src/common/FSNodeREGULAR.cxx +++ b/src/common/FSNodeREGULAR.cxx @@ -125,6 +125,18 @@ bool FSNodeREGULAR::hasParent() const return _path != "" && _path != ROOT_DIR; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +AbstractFSNodePtr FSNodeREGULAR::getParent() const +{ + if (_path == ROOT_DIR) + return nullptr; + + const char* start = _path.c_str(); + const char* end = lastPathComponent(_path); +cerr << " => path: " << _path << ", new: " << string(start, size_t(end - start)) << endl; + return make_unique(string(start, size_t(end - start))); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool FSNodeREGULAR::getChildren(AbstractFSList& myList, ListMode mode) const { @@ -278,15 +290,3 @@ bool FSNodeREGULAR::rename(const string& newfile) } return false; } - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AbstractFSNodePtr FSNodeREGULAR::getParent() const -{ - if (_path == ROOT_DIR) - return nullptr; - - const char* start = _path.c_str(); - const char* end = lastPathComponent(_path); -cerr << " => path: " << _path << ", new: " << string(start, size_t(end - start)) << endl; - return make_unique(string(start, size_t(end - start))); -} diff --git a/src/common/FSNodeREGULAR.hxx b/src/common/FSNodeREGULAR.hxx index ba352d69c..4be6ec60f 100644 --- a/src/common/FSNodeREGULAR.hxx +++ b/src/common/FSNodeREGULAR.hxx @@ -49,7 +49,6 @@ class FSNodeREGULAR : public AbstractFSNode void setName(const string& name) override { _displayName = name; } const string& getPath() const override { return _path; } string getShortPath() const override; - bool hasParent() const override; bool isDirectory() const override { return _isDirectory; } bool isFile() const override { return _isFile; } bool isReadable() const override { return _isReadable; } @@ -63,8 +62,9 @@ class FSNodeREGULAR : public AbstractFSNode size_t write(const ByteBuffer& buffer, size_t size) const override; size_t write(const stringstream& buffer) const override; - bool getChildren(AbstractFSList& list, ListMode mode) const override; + bool hasParent() const override; AbstractFSNodePtr getParent() const override; + bool getChildren(AbstractFSList& list, ListMode mode) const override; protected: fs::path _fspath; diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 92fb6300e..28053bc5e 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -991,7 +991,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, case EditableWidget::kChangedCmd: case EditableWidget::kAcceptCmd: { - bool subDirs = instance().settings().getBool("launchersubdirs"); + const bool subDirs = instance().settings().getBool("launchersubdirs"); myList->setIncludeSubDirs(subDirs); if(subDirs && cmd == EditableWidget::kChangedCmd)