all repos — fluxbox @ 7f8adc5a49c0ecf03be4f57ab284ee9accbf669a

custom fork of the fluxbox windowmanager

add style item only if the file is a regular file and not a .file or a backup~ file, thanks Ciaran McCreesh
fluxgen fluxgen
commit

7f8adc5a49c0ecf03be4f57ab284ee9accbf669a

parent

6018caf733ef099b2576cff90de1b1d7ac74d37f

1 files changed, 7 insertions(+), 4 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.251 2003/12/18 18:03:21 fluxgen Exp $ +// $Id: Screen.cc,v 1.252 2003/12/18 21:13:52 fluxgen Exp $ #include "Screen.hh"

@@ -2049,9 +2049,12 @@

// for each file in directory add filename and path to menu for (size_t file_index = 0; file_index < dir.entries(); file_index++) { std::string style(stylesdir + '/' + filelist[file_index]); - // add to menu only if the file is a regular file - if (FbTk::Directory::isRegularFile(style) || - FbTk::Directory::isRegularFile(style + "/theme.cfg")) + // add to menu only if the file is a regular file, and not a + // .file or a backup~ file + if ((FbTk::Directory::isRegularFile(style) && + (filelist[file_index][0] != '.') && + (style[style.length() - 1] != '~') + ) || FbTk::Directory::isRegularFile(style + "/theme.cfg")) menu.insert(new StyleMenuItem(filelist[file_index], style)); } // update menu graphics