Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Konsole
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Utilities
Konsole
Commits
cda9c083
Commit
cda9c083
authored
May 04, 2007
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make deletion of color schemes persistant.
svn path=/branches/work/konsole-split-view/; revision=660885
parent
9678685c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
konsole/ColorScheme.cpp
konsole/ColorScheme.cpp
+25
-6
konsole/ColorScheme.h
konsole/ColorScheme.h
+2
-0
No files found.
konsole/ColorScheme.cpp
View file @
cda9c083
...
...
@@ -334,7 +334,8 @@ bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath)
qDebug
()
<<
"loading KDE 3 format color scheme from "
<<
filePath
;
QFile
file
(
filePath
);
file
.
open
(
QIODevice
::
ReadOnly
);
if
(
!
filePath
.
endsWith
(
".schema"
)
||
!
file
.
open
(
QIODevice
::
ReadOnly
))
return
false
;
KDE3ColorSchemeReader
reader
(
&
file
);
ColorScheme
*
scheme
=
reader
.
read
();
...
...
@@ -374,6 +375,9 @@ void ColorSchemeManager::addColorScheme(ColorScheme* scheme)
}
bool
ColorSchemeManager
::
loadColorScheme
(
const
QString
&
filePath
)
{
if
(
!
filePath
.
endsWith
(
".colorscheme"
)
||
!
QFile
::
exists
(
filePath
)
)
return
false
;
QFileInfo
info
(
filePath
);
qDebug
()
<<
"loading KDE 4 native color scheme from "
<<
filePath
;
...
...
@@ -427,7 +431,23 @@ void ColorSchemeManager::deleteColorScheme(const QString& name)
_colorSchemes
.
remove
(
name
);
qWarning
()
<<
"Color scheme removed - make this change persistant."
;
// lookup the path and delete
QString
path
=
findColorSchemePath
(
name
);
if
(
QFile
::
remove
(
path
)
)
qDebug
()
<<
"Removed color scheme -"
<<
path
;
else
qDebug
()
<<
"Failed to remove color scheme -"
<<
path
;
}
QString
ColorSchemeManager
::
findColorSchemePath
(
const
QString
&
name
)
const
{
QString
path
=
KStandardDirs
::
locate
(
"data"
,
"konsole/"
+
name
+
".colorscheme"
);
if
(
!
path
.
isEmpty
()
)
return
path
;
path
=
KStandardDirs
::
locate
(
"data"
,
"konsole/"
+
name
+
".schema"
);
return
path
;
}
const
ColorScheme
*
ColorSchemeManager
::
findColorScheme
(
const
QString
&
name
)
{
...
...
@@ -441,15 +461,14 @@ const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name)
else
{
// look for this color scheme
QString
path
=
KStandardDirs
::
locate
(
"data"
,
"konsole/"
+
name
+
".colorscheme"
);
QString
path
=
findColorSchemePath
(
name
);
if
(
!
path
.
isEmpty
()
&&
loadColorScheme
(
path
)
)
{
return
findColorScheme
(
name
);
}
else
// look for a KDE 3 format color scheme by this name
else
{
QString
kde3path
=
KStandardDirs
::
locate
(
"data"
,
"konsole/"
+
name
+
".schema"
);
if
(
!
kde3path
.
isEmpty
()
&&
loadKDE3ColorScheme
(
kde3path
))
if
(
!
path
.
isEmpty
()
&&
loadKDE3ColorScheme
(
path
))
return
findColorScheme
(
name
);
}
...
...
konsole/ColorScheme.h
View file @
cda9c083
...
...
@@ -242,6 +242,8 @@ private:
QList
<
QString
>
listKDE3ColorSchemes
();
// loads all of the color schemes
void
loadAllColorSchemes
();
// finds the path of a color scheme
QString
findColorSchemePath
(
const
QString
&
name
)
const
;
QHash
<
QString
,
const
ColorScheme
*>
_colorSchemes
;
QSet
<
ColorScheme
*>
_modifiedSchemes
;
...
...
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