Changeset View
Changeset View
Standalone View
Standalone View
src/drive/filesearchquery.cpp
Show All 14 Lines | |||||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU Lesser General Public License for more details. | 16 | * GNU Lesser General Public License for more details. | ||
17 | * | 17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public | ||
19 | * License along with this library. If not, see <https://www.gnu.org/licenses/>. | 19 | * License along with this library. If not, see <https://www.gnu.org/licenses/>. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "filesearchquery.h" | 22 | #include "filesearchquery.h" | ||
23 | #include "utils.h" | ||||
23 | 24 | | |||
24 | #include <QString> | 25 | #include <QString> | ||
25 | #include <QDateTime> | 26 | #include <QDateTime> | ||
26 | 27 | | |||
27 | using namespace KGAPI2; | 28 | using namespace KGAPI2; | ||
28 | using namespace KGAPI2::Drive; | 29 | using namespace KGAPI2::Drive; | ||
29 | 30 | | |||
30 | 31 | | |||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 66 | { | |||
73 | case Readers: | 74 | case Readers: | ||
74 | return QStringLiteral("'%1'").arg(var.toString().replace(QLatin1Char('\''), QLatin1String("\\\'"))); | 75 | return QStringLiteral("'%1'").arg(var.toString().replace(QLatin1Char('\''), QLatin1String("\\\'"))); | ||
75 | case ModifiedDate: | 76 | case ModifiedDate: | ||
76 | case LastViewedByMeDate: | 77 | case LastViewedByMeDate: | ||
77 | return QStringLiteral("'%1'").arg(var.toDateTime().toUTC().toString(QStringLiteral("yyyy-MM-ddThh:mm:ss"))); | 78 | return QStringLiteral("'%1'").arg(var.toDateTime().toUTC().toString(QStringLiteral("yyyy-MM-ddThh:mm:ss"))); | ||
78 | case Trashed: | 79 | case Trashed: | ||
79 | case Starred: | 80 | case Starred: | ||
80 | case SharedWithMe: | 81 | case SharedWithMe: | ||
81 | return (var.toBool() == true ? QStringLiteral("true") : QStringLiteral("false")); | 82 | return Utils::bool2Str(var.toBool()); | ||
82 | } | 83 | } | ||
83 | 84 | | |||
84 | Q_ASSERT(false); | 85 | Q_ASSERT(false); | ||
85 | return QString(); | 86 | return QString(); | ||
86 | } | 87 | } | ||
87 | 88 | | |||
88 | void FileSearchQuery::addQuery(FileSearchQuery::Field field, FileSearchQuery::CompareOperator op, const QVariant &value) | 89 | void FileSearchQuery::addQuery(FileSearchQuery::Field field, FileSearchQuery::CompareOperator op, const QVariant &value) | ||
89 | { | 90 | { | ||
Show All 32 Lines |