Commit 58042614 authored by Gustavo Carneiro's avatar Gustavo Carneiro Committed by Kurt Hindenburg

ColorScheme Library remove private_core.

parent a08f907c
set(konsole_colorscheme_SRCS set(konsole_colorscheme_SRCS
hsluv.c hsluv.c
ColorScheme.cpp ColorScheme.cpp
...@@ -11,14 +12,20 @@ ki18n_wrap_ui(konsole_colorscheme_SRCS ...@@ -11,14 +12,20 @@ ki18n_wrap_ui(konsole_colorscheme_SRCS
ColorSchemeEditor.ui ColorSchemeEditor.ui
) )
ecm_qt_declare_logging_category(
konsole_colorscheme_SRCS
HEADER colorschemedebug.h
IDENTIFIER ColorSchemeDebug
CATEGORY_NAME org.kde.konsole.colorScheme
)
add_library(konsolecolorscheme add_library(konsolecolorscheme
STATIC STATIC
${konsole_colorscheme_SRCS} ${konsole_colorscheme_SRCS}
) )
generate_export_header(konsolecolorscheme BASE_NAME konsolecolorscheme)
target_include_directories(konsolecolorscheme PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries( target_link_libraries(
konsolecolorscheme konsolecolorscheme
${konsole_LIBS} ${konsole_LIBS}
konsoleprivate_core
) )
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <random> #include <random>
// Konsole // Konsole
#include "konsoledebug.h" #include "colorschemedebug.h"
#include "ColorSchemeWallpaper.h" #include "ColorSchemeWallpaper.h"
namespace { namespace {
...@@ -254,7 +254,7 @@ void ColorScheme::setColorTableEntry(int index, const ColorEntry &entry) ...@@ -254,7 +254,7 @@ void ColorScheme::setColorTableEntry(int index, const ColorEntry &entry)
_table[index] = entry; _table[index] = entry;
} else { } else {
_table[index] = defaultTable[index]; _table[index] = defaultTable[index];
qCDebug(KonsoleDebug)<<"ColorScheme"<<name()<<"has an invalid color index"<<index<<", using default table color"; qCDebug(ColorSchemeDebug)<<"ColorScheme"<<name()<<"has an invalid color index"<<index<<", using default table color";
} }
} }
...@@ -417,7 +417,7 @@ bool ColorScheme::hasDarkBackground() const ...@@ -417,7 +417,7 @@ bool ColorScheme::hasDarkBackground() const
void ColorScheme::setOpacity(qreal opacity) void ColorScheme::setOpacity(qreal opacity)
{ {
if (opacity < 0.0 || opacity > 1.0) { if (opacity < 0.0 || opacity > 1.0) {
qCDebug(KonsoleDebug)<<"ColorScheme"<<name()<<"has an invalid opacity"<<opacity<<"using 1"; qCDebug(ColorSchemeDebug)<<"ColorScheme"<<name()<<"has an invalid opacity"<<opacity<<"using 1";
opacity = 1.0; opacity = 1.0;
} }
_opacity = opacity; _opacity = opacity;
...@@ -472,7 +472,7 @@ void ColorScheme::readColorEntry(const KConfig &config, int index) ...@@ -472,7 +472,7 @@ void ColorScheme::readColorEntry(const KConfig &config, int index)
const auto readAndCheckConfigEntry = [&](const char *key, double min, double max) -> double { const auto readAndCheckConfigEntry = [&](const char *key, double min, double max) -> double {
const double value = configGroup.readEntry(key, min); const double value = configGroup.readEntry(key, min);
if (min > value || value > max) { if (min > value || value > max) {
qCDebug(KonsoleDebug) << QStringLiteral( qCDebug(ColorSchemeDebug) << QStringLiteral(
"Color scheme \"%1\": color index 2 has an invalid value: %3 = %4. " "Color scheme \"%1\": color index 2 has an invalid value: %3 = %4. "
"Allowed value range: %5 - %6. Using %7.") "Allowed value range: %5 - %6. Using %7.")
.arg(name()).arg(index).arg(QLatin1String(key)).arg(value, 0, 'g', 1) .arg(name()).arg(index).arg(QLatin1String(key)).arg(value, 0, 'g', 1)
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
// KDE // KDE
#include <QDialog> #include <QDialog>
#include "konsoleprivate_export.h" #include "konsolecolorscheme_export.h"
class QTableWidgetItem; class QTableWidgetItem;
...@@ -49,7 +49,7 @@ class ColorScheme; ...@@ -49,7 +49,7 @@ class ColorScheme;
* *
* When changes are made the colorsChanged() signal is emitted. * When changes are made the colorsChanged() signal is emitted.
*/ */
class KONSOLEPRIVATE_EXPORT ColorSchemeEditor : public QDialog class KONSOLECOLORSCHEME_EXPORT ColorSchemeEditor : public QDialog
{ {
Q_OBJECT Q_OBJECT
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// Own // Own
#include "ColorSchemeManager.h" #include "ColorSchemeManager.h"
#include "konsoledebug.h" #include "colorschemedebug.h"
// Qt // Qt
#include <QFileInfo> #include <QFileInfo>
...@@ -65,7 +65,7 @@ void ColorSchemeManager::loadAllColorSchemes() ...@@ -65,7 +65,7 @@ void ColorSchemeManager::loadAllColorSchemes()
} }
if (failed > 0) { if (failed > 0) {
qCDebug(KonsoleDebug) << "failed to load " << failed << " color schemes."; qCDebug(ColorSchemeDebug) << "failed to load " << failed << " color schemes.";
} }
_haveLoadedAll = true; _haveLoadedAll = true;
...@@ -94,7 +94,7 @@ bool ColorSchemeManager::loadColorScheme(const QString &filePath) ...@@ -94,7 +94,7 @@ bool ColorSchemeManager::loadColorScheme(const QString &filePath)
scheme->read(config); scheme->read(config);
if (scheme->name().isEmpty()) { if (scheme->name().isEmpty()) {
qCDebug(KonsoleDebug) << "Color scheme in" << filePath qCDebug(ColorSchemeDebug) << "Color scheme in" << filePath
<< "does not have a valid name and was not loaded."; << "does not have a valid name and was not loaded.";
delete scheme; delete scheme;
return false; return false;
...@@ -182,7 +182,7 @@ bool ColorSchemeManager::deleteColorScheme(const QString &name) ...@@ -182,7 +182,7 @@ bool ColorSchemeManager::deleteColorScheme(const QString &name)
delete _colorSchemes.take(name); delete _colorSchemes.take(name);
return true; return true;
} }
qCDebug(KonsoleDebug)<<"Failed to remove color scheme -"<<path; qCDebug(ColorSchemeDebug)<<"Failed to remove color scheme -"<<path;
return false; return false;
} }
...@@ -196,7 +196,7 @@ const ColorScheme *ColorSchemeManager::findColorScheme(const QString &name) ...@@ -196,7 +196,7 @@ const ColorScheme *ColorSchemeManager::findColorScheme(const QString &name)
// Konsole will create a sub-folder in that case (bko 315086) // Konsole will create a sub-folder in that case (bko 315086)
// More code will have to go in to prevent the users from doing that. // More code will have to go in to prevent the users from doing that.
if (name.contains(QLatin1String("/"))) { if (name.contains(QLatin1String("/"))) {
qCDebug(KonsoleDebug)<<name<<" has an invalid character / in the name ... skipping"; qCDebug(ColorSchemeDebug)<<name<<" has an invalid character / in the name ... skipping";
return defaultColorScheme(); return defaultColorScheme();
} }
...@@ -209,7 +209,7 @@ const ColorScheme *ColorSchemeManager::findColorScheme(const QString &name) ...@@ -209,7 +209,7 @@ const ColorScheme *ColorSchemeManager::findColorScheme(const QString &name)
return findColorScheme(name); return findColorScheme(name);
} }
qCDebug(KonsoleDebug) << "Could not find color scheme - " << name; qCDebug(ColorSchemeDebug) << "Could not find color scheme - " << name;
return nullptr; return nullptr;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment