Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,23 @@ void add_custom_color_scheme_dir(const QString& custom_dir)
}

/*! Helper function to get possible locations of color schemes.
By default the COLORSCHEMES_DIR is used (linux/BSD/macports).
By default the COLORSCHEMES_DIRS is used (linux/BSD/macports).
But in some cases (apple bundle) there can be more locations).
*/
const QStringList get_color_schemes_dirs()
{
// qDebug() << __FILE__ << __FUNCTION__;

QStringList rval;
QString k(qgetenv("COLORSCHEMES_DIR"));
QDir d(k);
QDir d;

// qDebug() << "default COLORSCHEMES_DIR: " << k;
QString dirs(qgetenv("COLORSCHEMES_DIRS"));
for (auto dirname : dirs.split(":")) {
d.setPath(dirname);

if (d.exists())
rval << k.append(QLatin1Char('/'));
if (d.exists())
rval << dirname.append(QLatin1Char('/'));
}

#ifdef Q_OS_MAC
// subdir in the app location
Expand Down
9 changes: 8 additions & 1 deletion src/qmltermwidget_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ void QmltermwidgetPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
}

setenv("KB_LAYOUT_DIR",kbl.toUtf8().constData(),1);
setenv("COLORSCHEMES_DIR",cs.toUtf8().constData(),1);

auto colorschemes = cs.toUtf8();

if (auto dirs = getenv("COLORSCHEMES_DIRS")) {
colorschemes.push_back(':');
colorschemes.append(dirs);
}
setenv("COLORSCHEMES_DIRS",colorschemes.constData(),1);
}
}