Bug 68074 - priority of data sources
Summary: priority of data sources
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-12 22:59 UTC by Andrew Walker
Modified: 2004-07-28 19:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2003-11-12 22:59:35 UTC
Version:           0.92 (using KDE KDE 3.1)
Installed from:    RedHat RPMs
OS:          Linux

There may be situations in which more than one of the KstDataSource plugins is willing to try and read in a given datafile, based on the filename, format, etc.

It might be advantageous to add an out parameter to the "understands" function such that a KstDataSource can indicate its level of certainty that it does understand a particular file. (e.g. UNDERSTAND_DEFINITE, UNDERSTAND_POSSIBLE, UNDERSTAND_WILL_GIVE_IT_A_GO) This parameter could then be used to select the best suited KstDataSource. All else being equal the first KstDataSource queried will be assigned the file.
Comment 1 George Staikos 2003-11-12 23:01:37 UTC
Subject: Re: [Kst]  New: priority of data sources

On Wednesday 12 November 2003 16:59, Andrew Walker wrote:
> There may be situations in which more than one of the KstDataSource plugins
> is willing to try and read in a given datafile, based on the filename,
> format, etc.
>
> It might be advantageous to add an out parameter to the "understands"
> function such that a KstDataSource can indicate its level of certainty that
> it does understand a particular file. (e.g. UNDERSTAND_DEFINITE,
> UNDERSTAND_POSSIBLE, UNDERSTAND_WILL_GIVE_IT_A_GO) This parameter could
> then be used to select the best suited KstDataSource. All else being equal
> the first KstDataSource queried will be assigned the file.

   Yes we have been discussing this as well.  There are a couple of approaches 
to this and I expect I will make this change sometime before the end of the 
month.

Comment 2 George Staikos 2004-07-28 19:19:56 UTC
CVS commit by staikos: 

implement data source priorities

understands_ now returns an int, defined to be 0..100 as a "percentage match"
CCMAIL: 68074-done@bugs.kde.org


  M +1 -1      devel-docs/RELEASE_PLAN   1.19
  M +30 -6     kst/kstdatasource.cpp   1.25
  M +4 -4      kst/datasources/ascii/ascii.cpp   1.18
  M +4 -4      kst/datasources/dirfile/dirfile.cpp   1.8
  M +3 -3      kst/datasources/frame/frame.cpp   1.5
  M +5 -5      kst/datasources/indirect/indirect.cpp   1.3
  M +3 -5      kst/datasources/lfiio/lfiio.cpp   1.8
  M +2 -2      kst/datasources/planck/planck.cpp   1.17
  M +4 -2      kst/datasources/template/template.cpp   1.4