CopperSpice Overview  1.5.1
Path Configuration

The cs.conf file overrides the hard coded paths compiled into the CopperSpice libraries. If the cs.conf file does not exist, the methods in the QLibraryInfo class will return the locations specified when CopperSpice was built.

CopperSpice uses the path to look for plugins and translation files. Since the specified path may not exist or may not be available on the user's computer at runtime, cs.conf is used to tell CopperSpice where to look instead.

The QLibraryInfo class will look for cs.conf in the following locations:

  • Searches .qrc files visible to your application for a file named,":/etc/cs.conf"
  • On Mac OS X, searches in the Resource directory inside the application bundle.
    For example: myapp.app/Contents/Resources/cs.conf
  • In the directory containing the application executable.
    QCoreApplication::applicationDirPath() + QDir::separator() + "cs.conf"

Conf File Details

The cs.conf file is an INI text file, as described in the QSettings documentation. The file should have a Paths group which contains entries corresponding to each value of the QLibraryInfo::LibraryLocation enum. Refer to the QLibraryInfo documentation for details of the various locations.

Entry Default Value Feature Required Path
Prefix QCoreApplication::applicationDirPath()
Plugins plugins
Accessible accessible
Gui Styles styles
Image Format Addons imageformats
Phonon phonon_backend
Sql Drivers sqldrivers
Text Codecs codecs
Translations translations


All paths in the conf file are relative to the Prefix value.

(1) On Windows and X11, the Prefix is the directory containing the application executable, QCoreApplication::applicationDirPath().

(2) On Mac OS X, the Prefix is relative to the Contents in the application bundle. For example, application.app/Contents/plugins/ is the default location for loading plugins.

Sample

Plugins need to be placed in specific sub-directories. The required folders are specified in column four in the table shown above.

Using the following sample cs.conf, the Phonon backend library must be located in \myAppPath\plugins\phonon_backend and your translation files must be \myAppPath\il8n

1 [Paths]
2  Prefix = myAppPath
3  Plugins = plugins
4  Translations = il8n

Refer to Creating Plugins for further details about plugins.