1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2006 David Faure <faure@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-only |
6 | */ |
7 | |
8 | #include "kfile.h" |
9 | |
10 | bool KFile::isSortByName(const QDir::SortFlags &sort) |
11 | { |
12 | return (sort & QDir::Time) != QDir::Time && (sort & QDir::Size) != QDir::Size && (sort & QDir::Type) != QDir::Type; |
13 | } |
14 | |
15 | bool KFile::isSortBySize(const QDir::SortFlags &sort) |
16 | { |
17 | return (sort & QDir::Size) == QDir::Size; |
18 | } |
19 | |
20 | bool KFile::isSortByDate(const QDir::SortFlags &sort) |
21 | { |
22 | return (sort & QDir::Time) == QDir::Time; |
23 | } |
24 | |
25 | bool KFile::isSortByType(const QDir::SortFlags &sort) |
26 | { |
27 | return (sort & QDir::Type) == QDir::Type; |
28 | } |
29 | |
30 | bool KFile::isSortDirsFirst(const QDir::SortFlags &sort) |
31 | { |
32 | return (sort & QDir::DirsFirst) == QDir::DirsFirst; |
33 | } |
34 | |
35 | bool KFile::isSortCaseInsensitive(const QDir::SortFlags &sort) |
36 | { |
37 | return (sort & QDir::IgnoreCase) == QDir::IgnoreCase; |
38 | } |
39 | |
40 | bool KFile::isDefaultView(const FileView &view) |
41 | { |
42 | return (view & Default) == Default; |
43 | } |
44 | |
45 | bool KFile::isSimpleView(const FileView &view) |
46 | { |
47 | return (view & Simple) == Simple; |
48 | } |
49 | |
50 | bool KFile::isDetailView(const FileView &view) |
51 | { |
52 | return (view & Detail) == Detail; |
53 | } |
54 | |
55 | bool KFile::isSeparateDirs(const FileView &view) |
56 | { |
57 | return (view & SeparateDirs) == SeparateDirs; |
58 | } |
59 | |
60 | bool KFile::isPreviewContents(const FileView &view) |
61 | { |
62 | return (view & PreviewContents) == PreviewContents; |
63 | } |
64 | |
65 | bool KFile::isPreviewInfo(const FileView &view) |
66 | { |
67 | return (view & PreviewInfo) == PreviewInfo; |
68 | } |
69 | |
70 | bool KFile::isTreeView(const FileView &view) |
71 | { |
72 | return (view & Tree) == Tree; |
73 | } |
74 | |
75 | bool KFile::isDetailTreeView(const FileView &view) |
76 | { |
77 | return (view & DetailTree) == DetailTree; |
78 | } |
79 | |
80 | #include "moc_kfile.cpp" |
81 | |