Skip to content

Commit

Permalink
Remove UI for 'Always accept files matching"
Browse files Browse the repository at this point in the history
This feature, in the ascii dialog is
i) very confusing
ii) as far as I can tell, useless
So, this patch hides it.
  • Loading branch information
netterfield committed Apr 19, 2017
1 parent c0b2a41 commit d246b89
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/datasources/ascii/asciiconfigwidget.cpp
Expand Up @@ -201,7 +201,18 @@ void AsciiConfigWidgetInternal::setFilename(const QString& filename)
void AsciiConfigWidgetInternal::setConfig(const AsciiSourceConfig& config)
{
_delimiters->setText(config._delimiters);
_fileNamePattern->setText(config._fileNamePattern);

// "Always accept files matching" is ... odd and currently worthless.
// Here is what it does:
// If _fileNamePattern, which is saved only associated with <filename>
// matches <filename> then assume <filename> is ascii and do no further
// checks. Why one would want this is unclear to me.
// TODO: fix this!
// Here we hide the 'feature' until it is made into something useful.
//_fileNamePattern->setText(config._fileNamePattern);
_fileNamePattern->hide();
textLabel1_2->hide();

_columnDelimiter->setText(config._columnDelimiter);
_columnWidth->setValue(config._columnWidth);
_colWidthConst->setChecked(config._columnWidthIsConst);
Expand Down
5 changes: 5 additions & 0 deletions src/datasources/ascii/asciiplugin.cpp
Expand Up @@ -154,6 +154,11 @@ int AsciiPlugin::understands(QSettings *cfg, const QString& filename) const {
return 0;
}

// Apparently "Always accept files matching" is ... odd..
// If _fileNamePattern, which is saved only associated with <filename>
// matches <filename> then assume <filename> is ascii and do no further
// checks. Why one would want this is unclear to me.
// TODO: fix this!
if (!config._fileNamePattern.value().isEmpty()) {
QRegExp filenamePattern(config._fileNamePattern);
filenamePattern.setPatternSyntax(QRegExp::Wildcard);
Expand Down

0 comments on commit d246b89

Please sign in to comment.