ColorSchemeManager::loadCustomColorScheme(const QString& path).
This commit is contained in:
@@ -639,6 +639,17 @@ void ColorSchemeManager::addColorScheme(ColorScheme* scheme)
|
||||
scheme->write(config);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool ColorSchemeManager::loadCustomColorScheme(const QString& path)
|
||||
{
|
||||
if (path.endsWith(QLatin1String(".colorscheme")))
|
||||
return loadColorScheme(path);
|
||||
else if (path.endsWith(QLatin1String(".schema")))
|
||||
return loadKDE3ColorScheme(path);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ColorSchemeManager::loadColorScheme(const QString& filePath)
|
||||
{
|
||||
if ( !filePath.endsWith(QLatin1String(".colorscheme")) || !QFile::exists(filePath) )
|
||||
|
||||
@@ -314,6 +314,19 @@ public:
|
||||
/** Returns the global color scheme manager instance. */
|
||||
static ColorSchemeManager* instance();
|
||||
|
||||
/** @brief Loads a custom color scheme under given \em path.
|
||||
*
|
||||
* The \em path may refer to either KDE 4 .colorscheme or KDE 3
|
||||
* .schema file
|
||||
*
|
||||
* The loaded color scheme is available under the name equal to
|
||||
* the base name of the \em path via the allColorSchemes() and
|
||||
* findColorScheme() methods after this call if loaded successfully.
|
||||
*
|
||||
* @param[in] path The path to KDE 4 .colorscheme or KDE 3 .schema.
|
||||
* @return Whether the color scheme is loaded successfully.
|
||||
*/
|
||||
bool loadCustomColorScheme(const QString& path);
|
||||
private:
|
||||
// loads a color scheme from a KDE 4+ .colorscheme file
|
||||
bool loadColorScheme(const QString& path);
|
||||
|
||||
Reference in New Issue
Block a user