[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE
From: Michael Leupold <lemma () confuego ! org>
Date: 2008-11-16 19:15:56
Message-ID: 1226862956.306152.22255.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 885210 by mleupold:
Allow UTF-8 strings as wallet names.
BUG: 113708
M +2 -2 kdebase/runtime/kwalletd/kwalletd.cpp
M +6 -12 kdeutils/kwallet/kwalletmanager.cpp
--- trunk/KDE/kdebase/runtime/kwalletd/kwalletd.cpp #885209:885210
@@ -265,7 +265,7 @@
return -1;
}
- if (!QRegExp("^[A-Za-z0-9]+[A-Za-z0-9\\s\\-_]*$").exactMatch(wallet)) {
+ if (!QRegExp("^[\\w\\^\\&\\'\\@\\{\\}\\[\\]\\,\\$\\=\\!\\-\\#\\(\\)\\%\\.\\+\\_]+$").exactMatch(wallet)) \
{ return -1;
}
@@ -768,7 +768,7 @@
QDir dir(path, "*.kwl");
QStringList rc;
- dir.setFilter(QDir::Files);
+ dir.setFilter(QDir::Files | QDir::Hidden);
foreach (const QFileInfo &fi, dir.entryInfoList()) {
QString fn = fi.fileName();
--- trunk/KDE/kdeutils/kwallet/kwalletmanager.cpp #885209:885210
@@ -42,6 +42,7 @@
#include <Q3PtrStack>
#include <QRegExp>
+#include <QRegExpValidator>
#include <QTimer>
#include <ktoolinvocation.h>
#include <kicon.h>
@@ -358,13 +359,11 @@
}
}
-
void KWalletManager::createWallet() {
QString n;
bool ok;
- // FIXME: support international names
- QRegExp regexp("^[A-Za-z0-9]+[A-Za-z0-9_\\s\\-]*$");
QString txt = i18n("Please choose a name for the new wallet:");
+ QRegExpValidator validator(QRegExp("^[\\w\\^\\&\\'\\@\\{\\}\\[\\]\\,\\$\\=\\!\\-\\#\\(\\)\\%\\.\\+\\_]+$"), \
this);
if (!KWallet::Wallet::isEnabled()) {
// FIXME: KMessageBox::warningYesNo(this, i1_8n("KWallet is not enabled. Do you \
want to enable it?"), QString(), i18n("Enable"), i18n("Keep Disabled")); @@ -372,11 \
+371,8 @@ }
do {
- n = KInputDialog::getText(i18n("New Wallet"),
- txt,
- QString(),
- &ok,
- this);
+ n = KInputDialog::getText(i18n("New Wallet"), txt, QString(), &ok, this,
+ &validator);
if (!ok) {
return;
@@ -388,13 +384,11 @@
return;
}
n.clear();
- } else if (regexp.exactMatch(n)) {
+ } else {
break;
- } else {
- txt = i18n("Please choose a name that contains only alphanumeric characters:");
}
} while (true);
-
+
// Small race here - the wallet could be created on us already.
if (!n.isEmpty()) {
openWallet(n, true);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic