Changeset View
Changeset View
Standalone View
Standalone View
src/runtime/kwalletd/backend/kwalletbackend.cc
Show All 31 Lines | |||||
32 | #include <KLocalizedString> | 32 | #include <KLocalizedString> | ||
33 | 33 | | |||
34 | #include <QDir> | 34 | #include <QDir> | ||
35 | #include <QFile> | 35 | #include <QFile> | ||
36 | #include <QFileInfo> | 36 | #include <QFileInfo> | ||
37 | #include <QSaveFile> | 37 | #include <QSaveFile> | ||
38 | #include <QRegExp> | 38 | #include <QRegExp> | ||
39 | #include <QCryptographicHash> | 39 | #include <QCryptographicHash> | ||
40 | #include <QRegularExpression> | ||||
40 | #include <QStandardPaths> | 41 | #include <QStandardPaths> | ||
41 | 42 | | |||
42 | #include "blowfish.h" | 43 | #include "blowfish.h" | ||
43 | #include "sha1.h" | 44 | #include "sha1.h" | ||
44 | #include "cbc.h" | 45 | #include "cbc.h" | ||
45 | 46 | | |||
46 | #include <assert.h> | 47 | #include <assert.h> | ||
47 | 48 | | |||
▲ Show 20 Lines • Show All 477 Lines • ▼ Show 20 Line(s) | |||||
525 | QList<Entry *> Backend::readEntryList(const QString &key) | 526 | QList<Entry *> Backend::readEntryList(const QString &key) | ||
526 | { | 527 | { | ||
527 | QList<Entry *> rc; | 528 | QList<Entry *> rc; | ||
528 | 529 | | |||
529 | if (!_open) { | 530 | if (!_open) { | ||
530 | return rc; | 531 | return rc; | ||
531 | } | 532 | } | ||
532 | 533 | | |||
533 | const QRegExp re(key, Qt::CaseSensitive, QRegExp::Wildcard); | 534 | // HACK: see Wallet::WalletPrivate::forEachItemThatMatches() | ||
535 | const QString pattern = QRegularExpression::wildcardToRegularExpression(key).replace( | ||||
536 | QLatin1String("[^/]"), QLatin1String(".")); | ||||
537 | const QRegularExpression re(pattern); | ||||
534 | 538 | | |||
535 | const EntryMap &map = _entries[_folder]; | 539 | const EntryMap &map = _entries[_folder]; | ||
536 | for (EntryMap::ConstIterator i = map.begin(); i != map.end(); ++i) { | 540 | for (EntryMap::ConstIterator i = map.begin(); i != map.end(); ++i) { | ||
537 | if (re.exactMatch(i.key())) { | 541 | if (re.match(i.key()).hasMatch()) { | ||
538 | rc.append(i.value()); | 542 | rc.append(i.value()); | ||
539 | } | 543 | } | ||
540 | } | 544 | } | ||
541 | return rc; | 545 | return rc; | ||
542 | } | 546 | } | ||
543 | 547 | | |||
544 | bool Backend::createFolder(const QString &f) | 548 | bool Backend::createFolder(const QString &f) | ||
545 | { | 549 | { | ||
▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines |