Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
Plasma Workspace
Commits
6e87542d
Commit
6e87542d
authored
Dec 01, 2017
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove weird use of QList on the heap
parent
853333c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
ksmserver/autostart.cpp
ksmserver/autostart.cpp
+6
-9
ksmserver/autostart.h
ksmserver/autostart.h
+1
-2
No files found.
ksmserver/autostart.cpp
View file @
6e87542d
...
...
@@ -35,14 +35,11 @@ public:
AutoStart
::
AutoStart
()
:
m_phase
(
-
1
),
m_phasedone
(
false
)
{
m_startList
=
new
AutoStartList
;
}
AutoStart
::~
AutoStart
()
{
qDeleteAll
(
*
m_startList
);
m_startList
->
clear
();
delete
m_startList
;
qDeleteAll
(
m_startList
);
}
void
...
...
@@ -104,14 +101,14 @@ AutoStart::loadAutoStartList()
if
(
item
->
phase
<
0
)
{
item
->
phase
=
0
;
}
m_startList
->
append
(
item
);
m_startList
.
append
(
item
);
}
}
QString
AutoStart
::
startService
()
{
if
(
m_startList
->
isEmpty
())
{
if
(
m_startList
.
isEmpty
())
{
return
QString
();
}
...
...
@@ -119,7 +116,7 @@ AutoStart::startService()
// Check for items that depend on previously started items
QString
lastItem
=
m_started
[
0
];
QMutableListIterator
<
AutoStartItem
*>
it
(
*
m_startList
);
QMutableListIterator
<
AutoStartItem
*>
it
(
m_startList
);
while
(
it
.
hasNext
())
{
AutoStartItem
*
item
=
it
.
next
();
if
(
item
->
phase
==
m_phase
...
...
@@ -136,7 +133,7 @@ AutoStart::startService()
// Check for items that don't depend on anything
AutoStartItem
*
item
;
QMutableListIterator
<
AutoStartItem
*>
it
(
*
m_startList
);
QMutableListIterator
<
AutoStartItem
*>
it
(
m_startList
);
while
(
it
.
hasNext
())
{
item
=
it
.
next
();
if
(
item
->
phase
==
m_phase
...
...
@@ -150,7 +147,7 @@ AutoStart::startService()
}
// Just start something in this phase
it
=
*
m_startList
;
it
=
m_startList
;
while
(
it
.
hasNext
())
{
item
=
it
.
next
();
if
(
item
->
phase
==
m_phase
)
{
...
...
ksmserver/autostart.h
View file @
6e87542d
...
...
@@ -23,7 +23,6 @@
#include <QtCore/QStringList>
class
AutoStartItem
;
typedef
QList
<
AutoStartItem
*>
AutoStartList
;
class
AutoStart
{
...
...
@@ -45,7 +44,7 @@ public:
}
private:
AutoStart
List
*
m_startList
;
QList
<
AutoStart
Item
*>
m_startList
;
QStringList
m_started
;
int
m_phase
;
bool
m_phasedone
;
...
...
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