File indexing completed on 2024-05-19 05:28:21

0001 // SPDX-FileCopyrightText: Jonah BrĂ¼chert <jbb@kaidan.im>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 #include "tools.h"
0005 
0006 #include <QCoreApplication>
0007 #include <QDir>
0008 #include <QtDebug>
0009 
0010 Q_LOGGING_CATEGORY(qtermwidgetLogger, "qtermwidget", QtWarningMsg)
0011 
0012 /*! Helper function to get possible location of layout files.
0013 By default the KB_LAYOUT_DIR is used (linux/BSD/macports).
0014 But in some cases (apple bundle) there can be more locations).
0015 */
0016 QString kbLayoutDir()
0017 {
0018     return QStringLiteral(":/konsoleqml/kb-layouts/");
0019 }
0020 
0021 /*! Helper function to add custom location of color schemes.
0022  */
0023 namespace
0024 {
0025 QStringList custom_color_schemes_dirs;
0026 }
0027 void add_custom_color_scheme_dir(const QString &custom_dir)
0028 {
0029     if (!custom_color_schemes_dirs.contains(custom_dir))
0030         custom_color_schemes_dirs << custom_dir;
0031 }
0032 
0033 /*! Helper function to get possible locations of color schemes.
0034 By default the COLORSCHEMES_DIR is used (linux/BSD/macports).
0035 But in some cases (apple bundle) there can be more locations).
0036 */
0037 const QStringList colorSchemesDirs()
0038 {
0039     return {QStringLiteral(":/konsoleqml/color-schemes/")};
0040 }