[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kde4/kdelibs/kdecore
From: Caleb Tennis <caleb () gentoo ! org>
Date: 2005-07-12 0:27:38
Message-ID: 1121128058.717658.22632.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 433853 by ctennis:
Another Q3PtrList -> QList
M +14 -16 kapplication.cpp
--- branches/work/kde4/kdelibs/kdecore/kapplication.cpp #433852:433853
@@ -175,7 +175,7 @@
// replaced by unpatched one
KDECORE_EXPORT bool qt_qclipboard_bailout_hack = false;
-template class Q3PtrList<KSessionManaged>;
+template class QList<KSessionManaged*>;
#ifdef Q_WS_X11
extern "C" {
@@ -563,11 +563,9 @@
}
// the help class for session management communication
-static Q3PtrList<KSessionManaged>* sessionClients()
+static QList<KSessionManaged *> sessionClients()
{
- static Q3PtrList<KSessionManaged>* session_clients = 0L;
- if ( !session_clients )
- session_clients = new Q3PtrList<KSessionManaged>;
+ static QList<KSessionManaged*> session_clients;
return session_clients;
}
@@ -1034,13 +1032,13 @@
KSessionManaged::KSessionManaged()
{
- sessionClients()->remove( this );
- sessionClients()->append( this );
+ sessionClients().removeAll( this );
+ sessionClients().append( this );
}
KSessionManaged::~KSessionManaged()
{
- sessionClients()->remove( this );
+ sessionClients().removeAll( this );
}
bool KSessionManaged::saveState(QSessionManager&)
@@ -1185,11 +1183,12 @@
{
d->session_save = true;
bool canceled = false;
- for (KSessionManaged* it = sessionClients()->first();
- it && !canceled;
- it = sessionClients()->next() ) {
- canceled = !it->commitData( sm );
+
+ foreach (KSessionManaged *it, sessionClients()) {
+ if(canceled) break;
+ canceled = !it->commitData( sm );
}
+
if ( canceled )
sm.cancel();
@@ -1286,10 +1285,9 @@
// finally: do session management
emit saveYourself(); // for compatibility
bool canceled = false;
- for (KSessionManaged* it = sessionClients()->first();
- it && !canceled;
- it = sessionClients()->next() ) {
- canceled = !it->saveState( sm );
+ foreach(KSessionManaged* it, sessionClients()) {
+ if(canceled) break;
+ canceled = !it->saveState( sm );
}
// if we created a new session config object, register a proper discard command
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic