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

List:       kde-commits
Subject:    =?utf-8?q?=5Bgluon=5D_player=3A_KDE_Extended_Player=3A_Fix_the_s?=
From:       Laszlo Papp <djszapi () archlinux ! us>
Date:       2011-02-06 22:19:34
Message-ID: 20110206221934.92CC9A60C6 () git ! kde ! org
[Download RAW message or body]

Git commit 517ee2a154ec7fc47be26cc9dda4525adfbe7afb by Laszlo Papp.
Committed on 06/02/11 at 23:12.
Pushed by lpapp into branch 'master'.

KDE Extended Player: Fix the slotPlayClicked signal, slot way.

M  +4    -3    player/kdeext/delegates/itemsviewdelegate.cpp     
M  +2    -1    player/kdeext/delegates/itemsviewdelegate.h     
M  +1    -1    player/kdeext/gamesoverlay.cpp     
M  +17   -15   player/kdeext/mainwindow.cpp     

http://commits.kde.org/gluon/517ee2a154ec7fc47be26cc9dda4525adfbe7afb

diff --git a/player/kdeext/delegates/itemsviewdelegate.cpp \
b/player/kdeext/delegates/itemsviewdelegate.cpp index 15c8293..f08827e 100644
--- a/player/kdeext/delegates/itemsviewdelegate.cpp
+++ b/player/kdeext/delegates/itemsviewdelegate.cpp
@@ -177,8 +177,9 @@ QSize ItemsViewDelegate::sizeHint(const QStyleOptionViewItem & \
option, const QMo  
 void ItemsViewDelegate::slotPlayClicked()
 {
-    QModelIndex index = focusedIndex();
-    if (index.isValid())
-        emit gameSelected( index );
+    m_index = focusedIndex();
+    if (m_index.isValid()) {
+        emit gameToPlaySelected( m_index );
+    }
 }
 
diff --git a/player/kdeext/delegates/itemsviewdelegate.h \
b/player/kdeext/delegates/itemsviewdelegate.h index a42fbc2..0ea782e 100644
--- a/player/kdeext/delegates/itemsviewdelegate.h
+++ b/player/kdeext/delegates/itemsviewdelegate.h
@@ -53,13 +53,14 @@ namespace GluonKDEPlayer
             virtual QSize sizeHint(const QStyleOptionViewItem& option, const \
QModelIndex& index) const;  
         signals:
-            void gameSelected( const QModelIndex& index );
+            void gameToPlaySelected( const QModelIndex& index );
 
         protected slots:
             bool eventFilter(QObject *watched, QEvent *event);
             void slotPlayClicked();
 
         protected:
+            QModelIndex m_index;
             QAbstractItemView *m_itemView;
             KIcon* m_preview;
             QSize m_buttonSize;
diff --git a/player/kdeext/gamesoverlay.cpp b/player/kdeext/gamesoverlay.cpp
index 16a4db9..0b761af 100644
--- a/player/kdeext/gamesoverlay.cpp
+++ b/player/kdeext/gamesoverlay.cpp
@@ -40,7 +40,7 @@ GamesOverlay::GamesOverlay( QWidget* parent, Qt::WindowFlags wFlags \
)  
     m_model->appendPair(qMakePair(i18n("Installed"), new KIcon( "applications-games" \
)));  m_gamesView->setItemDelegate(m_gamesDelegate);
-    connect( m_gamesDelegate, SIGNAL( gameSelected( QModelIndex ) ), SIGNAL( \
gameSelected( QModelIndex ) ) ); +    connect( m_gamesDelegate, SIGNAL( \
gameToPlaySelected( QModelIndex ) ), SIGNAL( gameToPlaySelected( QModelIndex ) ) );  \
m_gamesView->setModel(m_gameItemsModel);  m_stackedWidget->addWidget(m_gamesView);
 
diff --git a/player/kdeext/mainwindow.cpp b/player/kdeext/mainwindow.cpp
index 5707b13..a2c3dbf 100644
--- a/player/kdeext/mainwindow.cpp
+++ b/player/kdeext/mainwindow.cpp
@@ -130,32 +130,32 @@ void MainWindow::setupActions()
 
 void MainWindow::startGame( )
 {
-    if( GluonEngine::Game::instance()->isRunning() )
-    {
-        GluonEngine::Game::instance()->setPause( false );
-        stateChanged( "paused", StateReverse );
-    }
-    else
-    {
-        stateChanged( "playing" );
+    // if( GluonEngine::Game::instance()->isRunning() )
+    // {
+        // GluonEngine::Game::instance()->setPause( false );
+        // stateChanged( "paused", StateReverse );
+    // }
+    // else
+    // {
+        // stateChanged( "playing" );
 
-        QString currentSceneName = \
GluonEngine::Game::instance()->currentScene()->fullyQualifiedName(); +        // \
QString currentSceneName = \
GluonEngine::Game::instance()->currentScene()->fullyQualifiedName();  // \
saveProject();  
         //Set the focus to the entire window, so that we do not accidentally trigger \
                actions
-        setFocus();
+        // setFocus();
 
         //Start the game loop
         //Note that this starts an infinite loop in Game
         GluonEngine::Game::instance()->runGame();
 
         //This happens after we exit the game loop
-        stateChanged( "playing", StateReverse );
+        // stateChanged( "playing", StateReverse );
 
         // openProject( d->fileName );
-        GluonEngine::Game::instance()->setCurrentScene( currentSceneName );
-        GluonEngine::Game::instance()->initializeAll();
-    }
+        // GluonEngine::Game::instance()->setCurrentScene( currentSceneName );
+        // GluonEngine::Game::instance()->initializeAll();
+    // }
 }
 
 void MainWindow::pauseGame()
@@ -293,7 +293,9 @@ void MainWindow::openProject()
         return;
     }
 
-    GluonCore::GluonObjectFactory::instance()->loadPlugins();
+    // GluonCore::GluonObjectFactory::instance()->loadPlugins();
+    d->widget = new GluonGraphics::RenderWidget( this );
+    setCentralWidget( d->widget );
 
     m_project->loadFromFile( m_gameFileName );
     GluonEngine::Game::instance()->setGameProject( m_project );


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

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