[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kmameleon/main
From:       Primoz Anzur <zerokode () gmx ! net>
Date:       2005-06-05 16:12:45
Message-ID: 1117987965.616827.11395.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 422486 by zero:

Another patch from PacĂ´me MASSOL


 M  +27 -27    kmmgameslist.cc  


--- trunk/kdenonbeta/kmameleon/main/kmmgameslist.cc #422485:422486
@@ -58,40 +58,40 @@
 }
 
 void ItemGamesList::buildLists(void) {
+	bool found=false;
 
-	pixSnap->setPixmap(QPixmap(locate("data","kmameleon/pics/noss.png")));
+        pixSnap->setPixmap(QPixmap(locate("data","kmameleon/pics/noss.png")));
 
-	// catch some signals
-	connect (&infoProc, SIGNAL( receivedStdout (int , int &)), this, SLOT( getCheck( \
                int, int &)) );
-	connect (lvGameList, SIGNAL( selectionChanged( QListViewItem* ) ), this, SLOT( \
                selChanged( QListViewItem* ) ) );
-	connect (btPresents, SIGNAL( stateChanged( int ) ), this, SLOT( refreshPresents( \
                int ) ) );
-	connect (btSupported, SIGNAL( stateChanged( int ) ), this, SLOT( refreshSupported( \
                int ) ) );
-	connect (btnReload, SIGNAL( clicked( ) ), this, SLOT( reload(  ) ) );
+        // catch some signals
+        connect (&infoProc, SIGNAL( receivedStdout (int , int &)), this, SLOT( \
getCheck( int, int &)) ); +        connect (lvGameList, SIGNAL( selectionChanged( \
QListViewItem* ) ), this, SLOT( selChanged( QListViewItem* ) ) ); +        connect \
(btPresents, SIGNAL( stateChanged( int ) ), this, SLOT( refreshPresents( int ) ) ); + \
connect (btSupported, SIGNAL( stateChanged( int ) ), this, SLOT( refreshSupported( \
int ) ) ); +        connect (btnReload, SIGNAL( clicked( ) ), this, SLOT( reload(  ) \
) );  connect (btnQuit, SIGNAL( clicked( ) ), this, SLOT( close( ) ) );
 
-	//for now; we'll load path from the config fle..
-	config = kapp->config();
+        //for now; we'll load path from the config fle..
+        config = kapp->config();
 
-	// fill games lists
-	fillSupported();
-	fillPresent();
-	
-	// Select last game played
-	config -> setGroup("general");
-	QString lastPlayed = config -> readEntry("last_played","");
-	
-	QListViewItemIterator it( lvGameList );
-	while ( item = it.current() ) {
-		if(item->text(0)==lastPlayed)
-			lvGameList->setSelected(item, true);
-		++it;
-	}
-	
-	// by default, we displayed supported games
-	btSupported->setChecked(true);
+        // fill games lists
+        fillSupported();
+        fillPresent();
+
+        // Select last game played
+        config -> setGroup("general");
+        QString lastPlayed = config -> readEntry("last_played","");
+
+        QListViewItemIterator it( lvGameList );
+        while ( (item = it.current()) && !found) {
+                if(item->text(0)==lastPlayed) {
+                        lvGameList->setSelected(item, true);
+                        lvGameList->ensureItemVisible(item);
+                        found=true;
+                }
+                ++it;
+        }
 }
 
-
 void ItemGamesList::fillPresent(void) {
 
 	// presents list loaded from files in the rom path


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic