Commit 928f4d0f authored by Scott Wheeler's avatar Scott Wheeler

Don't allow '/' in filenames.

CCMAIL:75864-done@bugs.kde.org

svn path=/trunk/kdemultimedia/juk/; revision=303074
parent 9b92b1a0
......@@ -34,9 +34,29 @@
#include <qcheckbox.h>
#include <qlayout.h>
#include <qdir.h>
#include <qvalidator.h>
#include <id3v1genres.h>
class FileNameValidator : public QValidator
{
public:
FileNameValidator(QObject *parent, const char *name = 0) :
QValidator(parent, name) {}
virtual void fixup(QString &s) const
{
s.remove('/');
}
virtual State validate(QString &s, int &) const
{
if(s.find('/' != -1))
return Invalid;
return Acceptable;
}
};
////////////////////////////////////////////////////////////////////////////////
// public members
////////////////////////////////////////////////////////////////////////////////
......@@ -351,6 +371,8 @@ void TagEditor::setupLayout()
horizontalSpacing);
m_fileNameBox = new KLineEdit(this, "fileNameBox");
m_fileNameBox->setValidator(new FileNameValidator(m_fileNameBox));
QLabel *fileNameIcon = new QLabel(this);
fileNameIcon->setPixmap(SmallIcon("sound"));
QWidget *fileNameLabel = addHidden(new QLabel(m_fileNameBox, i18n("&File name:"), this));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment