CopperSpice API  1.9.2
Plugin 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 a default 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, the cs.conf file can be used to instruct CopperSpice where to look.

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

  • Searches the .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

Conf File Details

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

Every path in the conf file is relative to the Prefix.

(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

Using the following sample cs.conf file, the PostgreSQL plugin library must be located in \myAppPath\plugins\sqldrivers and the translation files must be located in \myAppPath\il8n.

[Paths]
Prefix = \myAppPath
Plugins = plugins
Translations = il8n

Refer to Creating Plugins for further details about creating plugins.