| Summary: | Indirect file datasources require a .cur extension for kst to make sense of them. | ||
|---|---|---|---|
| Product: | [Applications] kst | Reporter: | D. V. Wiebe <dvw> |
| Component: | general | Assignee: | kst |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.0.0 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Proposed fix...
Perhaps a better fix |
||
|
Description
D. V. Wiebe
2004-12-01 04:40:17 UTC
On Tuesday 30 November 2004 22:40, D.V.Wiebe wrote:
> It seems to me it would be fairly simple to guess whether the file in
> question is a indirect file or not, ie. is it a smallish ASCII file that
> contains a valid file/path name.
This is by design presently.
Created attachment 8500 [details]
Proposed fix...
Get rid of check for .cur (as it checks other aspects unique to an indirect
file as well)
Created attachment 8501 [details]
Perhaps a better fix
Perhaps this is a better way...
On Tuesday 30 November 2004 23:52, Matthew Truch wrote:
> Perhaps this is a better way...
that should be endsWith(), not !endsWith() I think. Or switch the values
for ret. Anyway, I guess it can't hurt. Anyone object to me applying this
style of change? I might fudge with the numbers a bit more based on what
other data sources (especially ASCII) return, but in principle I don't think
it hurts anything.
The approach seems fine... On December 1, 2004 12:19 am, George Staikos wrote: > ------- You are receiving this mail because: ------- > You are the assignee for the bug, or are watching the assignee. > > http://bugs.kde.org/show_bug.cgi?id=94197 > > > > > ------- Additional Comments From staikos kde org 2004-12-01 06:19 ------- > > On Tuesday 30 November 2004 23:52, Matthew Truch wrote: > > Perhaps this is a better way... > > that should be endsWith(), not !endsWith() I think. Or switch the > values for ret. Anyway, I guess it can't hurt. Anyone object to me > applying this style of change? I might fudge with the numbers a bit more > based on what other data sources (especially ASCII) return, but in > principle I don't think it hurts anything. > _______________________________________________ > Kst mailing list > Kst@kde.org > https://mail.kde.org/mailman/listinfo/kst > that should be endsWith(), not !endsWith() I think. Or switch the values
> for ret.
Boy, do I feel sheepish. Correct.
CVS commit by staikos:
indirect files no longer have to end in .cur, adjust ascii to return a weaker
match percentage if it also looks like an indirect file.
FEATURE: 94197
M +1 -1 ascii/ascii.cpp 1.28
M +5 -3 indirect/indirect.cpp 1.12
--- kdeextragear-2/kst/kst/datasources/ascii/ascii.cpp #1.27:1.28
@@ -364,5 +364,5 @@ int understands_ascii(KConfig *cfg, cons
} else if (QRegExp("^[\\s]*(([Nn][Aa][Nn]|(\\-\\+)?[Ii][Nn][Ff]|[0-9\\+\\-\\.eE]+)[\\s]*)+").exactMatch(s)) {
// a number - this may be an ascii file - assume that it is
- return 75;
+ return QFile::exists(s.stripWhiteSpace()) ? 49 : 75;
} else {
return 20;
--- kdeextragear-2/kst/kst/datasources/indirect/indirect.cpp #1.11:1.12
@@ -131,6 +131,8 @@ QStringList provides_indirect() {
int understands_indirect(KConfig*, const QString& filename) {
- if (!filename.endsWith(".cur")) { // Do we really have to do this?
- return 0;
+ int percent = 50;
+
+ if (filename.endsWith(".cur")) { // Do we really have to do this?
+ percent = 100;
}
@@ -145,5 +147,5 @@ int understands_indirect(KConfig*, const
}
- return QFile::exists(ifn.stripWhiteSpace()) ? 100 : 0;
+ return QFile::exists(ifn.stripWhiteSpace()) ? percent : 0;
}
|