Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
Konsole
Commits
58042614
Commit
58042614
authored
Oct 12, 2020
by
Gustavo Carneiro
Committed by
Kurt Hindenburg
Oct 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ColorScheme Library remove private_core.
parent
a08f907c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
15 deletions
+22
-15
src/colorscheme/CMakeLists.txt
src/colorscheme/CMakeLists.txt
+10
-3
src/colorscheme/ColorScheme.cpp
src/colorscheme/ColorScheme.cpp
+4
-4
src/colorscheme/ColorSchemeEditor.h
src/colorscheme/ColorSchemeEditor.h
+2
-2
src/colorscheme/ColorSchemeManager.cpp
src/colorscheme/ColorSchemeManager.cpp
+6
-6
No files found.
src/colorscheme/CMakeLists.txt
View file @
58042614
set
(
konsole_colorscheme_SRCS
hsluv.c
ColorScheme.cpp
...
...
@@ -11,14 +12,20 @@ ki18n_wrap_ui(konsole_colorscheme_SRCS
ColorSchemeEditor.ui
)
ecm_qt_declare_logging_category
(
konsole_colorscheme_SRCS
HEADER colorschemedebug.h
IDENTIFIER ColorSchemeDebug
CATEGORY_NAME org.kde.konsole.colorScheme
)
add_library
(
konsolecolorscheme
STATIC
${
konsole_colorscheme_SRCS
}
)
generate_export_header
(
konsolecolorscheme BASE_NAME konsolecolorscheme
)
target_include_directories
(
konsolecolorscheme PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
target_link_libraries
(
konsolecolorscheme
${
konsole_LIBS
}
konsoleprivate_core
)
src/colorscheme/ColorScheme.cpp
View file @
58042614
...
...
@@ -35,7 +35,7 @@
#include <random>
// Konsole
#include "
konsol
edebug.h"
#include "
colorschem
edebug.h"
#include "ColorSchemeWallpaper.h"
namespace
{
...
...
@@ -254,7 +254,7 @@ void ColorScheme::setColorTableEntry(int index, const ColorEntry &entry)
_table
[
index
]
=
entry
;
}
else
{
_table
[
index
]
=
defaultTable
[
index
];
qCDebug
(
Konsol
eDebug
)
<<
"ColorScheme"
<<
name
()
<<
"has an invalid color index"
<<
index
<<
", using default table color"
;
qCDebug
(
ColorSchem
eDebug
)
<<
"ColorScheme"
<<
name
()
<<
"has an invalid color index"
<<
index
<<
", using default table color"
;
}
}
...
...
@@ -417,7 +417,7 @@ bool ColorScheme::hasDarkBackground() const
void
ColorScheme
::
setOpacity
(
qreal
opacity
)
{
if
(
opacity
<
0.0
||
opacity
>
1.0
)
{
qCDebug
(
Konsol
eDebug
)
<<
"ColorScheme"
<<
name
()
<<
"has an invalid opacity"
<<
opacity
<<
"using 1"
;
qCDebug
(
ColorSchem
eDebug
)
<<
"ColorScheme"
<<
name
()
<<
"has an invalid opacity"
<<
opacity
<<
"using 1"
;
opacity
=
1.0
;
}
_opacity
=
opacity
;
...
...
@@ -472,7 +472,7 @@ void ColorScheme::readColorEntry(const KConfig &config, int index)
const
auto
readAndCheckConfigEntry
=
[
&
](
const
char
*
key
,
double
min
,
double
max
)
->
double
{
const
double
value
=
configGroup
.
readEntry
(
key
,
min
);
if
(
min
>
value
||
value
>
max
)
{
qCDebug
(
Konsol
eDebug
)
<<
QStringLiteral
(
qCDebug
(
ColorSchem
eDebug
)
<<
QStringLiteral
(
"Color scheme
\"
%1
\"
: color index 2 has an invalid value: %3 = %4. "
"Allowed value range: %5 - %6. Using %7."
)
.
arg
(
name
()).
arg
(
index
).
arg
(
QLatin1String
(
key
)).
arg
(
value
,
0
,
'g'
,
1
)
...
...
src/colorscheme/ColorSchemeEditor.h
View file @
58042614
...
...
@@ -26,7 +26,7 @@
// KDE
#include <QDialog>
#include "konsole
privat
e_export.h"
#include "konsole
colorschem
e_export.h"
class
QTableWidgetItem
;
...
...
@@ -49,7 +49,7 @@ class ColorScheme;
*
* When changes are made the colorsChanged() signal is emitted.
*/
class
KONSOLE
PRIVAT
E_EXPORT
ColorSchemeEditor
:
public
QDialog
class
KONSOLE
COLORSCHEM
E_EXPORT
ColorSchemeEditor
:
public
QDialog
{
Q_OBJECT
...
...
src/colorscheme/ColorSchemeManager.cpp
View file @
58042614
...
...
@@ -23,7 +23,7 @@
// Own
#include "ColorSchemeManager.h"
#include "
konsol
edebug.h"
#include "
colorschem
edebug.h"
// Qt
#include <QFileInfo>
...
...
@@ -65,7 +65,7 @@ void ColorSchemeManager::loadAllColorSchemes()
}
if
(
failed
>
0
)
{
qCDebug
(
Konsol
eDebug
)
<<
"failed to load "
<<
failed
<<
" color schemes."
;
qCDebug
(
ColorSchem
eDebug
)
<<
"failed to load "
<<
failed
<<
" color schemes."
;
}
_haveLoadedAll
=
true
;
...
...
@@ -94,7 +94,7 @@ bool ColorSchemeManager::loadColorScheme(const QString &filePath)
scheme
->
read
(
config
);
if
(
scheme
->
name
().
isEmpty
())
{
qCDebug
(
Konsol
eDebug
)
<<
"Color scheme in"
<<
filePath
qCDebug
(
ColorSchem
eDebug
)
<<
"Color scheme in"
<<
filePath
<<
"does not have a valid name and was not loaded."
;
delete
scheme
;
return
false
;
...
...
@@ -182,7 +182,7 @@ bool ColorSchemeManager::deleteColorScheme(const QString &name)
delete
_colorSchemes
.
take
(
name
);
return
true
;
}
qCDebug
(
Konsol
eDebug
)
<<
"Failed to remove color scheme -"
<<
path
;
qCDebug
(
ColorSchem
eDebug
)
<<
"Failed to remove color scheme -"
<<
path
;
return
false
;
}
...
...
@@ -196,7 +196,7 @@ const ColorScheme *ColorSchemeManager::findColorScheme(const QString &name)
// 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.
if
(
name
.
contains
(
QLatin1String
(
"/"
)))
{
qCDebug
(
Konsol
eDebug
)
<<
name
<<
" has an invalid character / in the name ... skipping"
;
qCDebug
(
ColorSchem
eDebug
)
<<
name
<<
" has an invalid character / in the name ... skipping"
;
return
defaultColorScheme
();
}
...
...
@@ -209,7 +209,7 @@ const ColorScheme *ColorSchemeManager::findColorScheme(const QString &name)
return
findColorScheme
(
name
);
}
qCDebug
(
Konsol
eDebug
)
<<
"Could not find color scheme - "
<<
name
;
qCDebug
(
ColorSchem
eDebug
)
<<
"Could not find color scheme - "
<<
name
;
return
nullptr
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment