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

List:       kde-devel
Subject:    File with valid license but reported as "UNKNOWN"
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2013-10-23 22:52:11
Message-ID: 3780538.qmiHhpE4QM () xps
[Download RAW message or body]

Hmmm, anyone knows where the license checker lives?

It's complaining about players/spectatorplayer_gui.h in konquest having an 
invalid license when it seems quite ok to me.

Cheers,
  Albert

El Dimecres, 23 d'octubre de 2013, a les 23:19:47, Nemanja Hirsl va escriure:
> Hi Albert et al.
> 
> I'm not sure what might be wrong with license for spectacorplayer_gui.h, do
> you know what it could be? License header it the same as for other files
> here.
> 
> Thanks,
> Nemanja
> 
> On Wednesday, 23. October 2013. 20.39.12 you wrote:
> > Git commit 447d9b1dfac51706a64cfe05b4dd955e2041e5db by Nemanja Hirsl, on
> > behalf of Alexander Schuch. Committed on 23/10/2013 at 20:32.
> > Pushed by nhirsl into branch 'master'.
> > 
> > For AI development it is useful to watch the AIs play. This patch adds a
> > new local human spectator player controller which does not have any
> > planets and does not count as active player.
> > In case all selected player controllers are spectators, or only one
> > non-spectating player controller is set, consider the match as
> > spectator-only and reject it as there is either no winner at all, or the
> > winner is known already (the only non-spectating player).
> > REVIEW:113113
> > 
> > M  +2    -0    CMakeLists.txt
> > M  +67   -7    dialogs/newgamedlg.cc
> > M  +3    -0    dialogs/newgamedlg.h
> > M  +1    -1    game.cpp
> > M  +9    -0    gameview.cc
> > M  +5    -1    players/computerplayer.cpp
> > M  +1    -0    players/computerplayer.h
> > M  +1    -4    players/localplayer.cpp
> > M  +0    -2    players/localplayer.h
> > M  +1    -1    players/localplayer_gui.cpp
> > M  +6    -1    players/player.cpp
> > M  +1    -0    players/player.h
> > C  +16   -7    players/spectatorplayer.cpp [from:
> > players/localplayer_gui.cpp - 071% similarity] C  +25   -9   
> > players/spectatorplayer.h [from: players/localplayer_gui.cpp - 057%
> > similarity] C  +6    -6    players/spectatorplayer_gui.cpp [from:
> > players/localplayer_gui.cpp - 071% similarity] C  +10   -11  
> > players/spectatorplayer_gui.h [from: players/localplayer_gui.cpp - 072%
> > similarity]     [License: UNKNOWN]  *
> > 
> > The files marked with a * at the end have a non valid license. Please
> > read: http://techbase.kde.org/Policies/Licensing_Policy and use the
> > headers which are listed at that page.
> > 
> > 
> > http://commits.kde.org/konquest/447d9b1dfac51706a64cfe05b4dd955e2041e5db
> > 
> > diff --git a/CMakeLists.txt b/CMakeLists.txt
> > index b67b4ba..1eb87aa 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -52,6 +52,8 @@ set(konquest_SRCS
> > 
> >      players/neutralplayer.cpp
> >      players/player.cpp
> >      players/player_gui.cpp
> > 
> > +    players/spectatorplayer.cpp
> > +    players/spectatorplayer_gui.cpp
> > 
> >  )
> >  
> >  kde4_add_ui_files(konquest_SRCS dialogs/newGameDialog.ui )
> > 
> > diff --git a/dialogs/newgamedlg.cc b/dialogs/newgamedlg.cc
> > index 6f376ed..c52f338 100644
> > --- a/dialogs/newgamedlg.cc
> > +++ b/dialogs/newgamedlg.cc
> > @@ -30,6 +30,8 @@
> > 
> >  #include "../players/player_gui.h"
> >  #include "../players/localplayer.h"
> >  #include "../players/localplayer_gui.h"
> > 
> > +#include "../players/spectatorplayer.h"
> > +#include "../players/spectatorplayer_gui.h"
> > 
> >  #include "../game.h"
> >  #include <kconfig.h>
> >  #include <klocale.h>
> > 
> > @@ -68,10 +70,13 @@ class playersListModel : public QAbstractTableModel
> > 
> >  {
> >  
> >      typedef QPair<QColor, QString> PlayerId;
> >      QLinkedList<PlayerId> m_availablePlayerId;
> > 
> > +    NewGameDlg *m_newGameDlg;
> > 
> >  public:
> > -    playersListModel(QObject *parent, Game *game, const QList<PlayerGui*>
> > &selectablePlayer) : -        QAbstractTableModel(parent), m_game(game),
> > +    playersListModel(NewGameDlg *newGameDlg, Game *game, const
> > QList<PlayerGui*> &selectablePlayer) : +       
> > QAbstractTableModel(newGameDlg),
> > +        m_newGameDlg(newGameDlg),
> > +        m_game(game),
> > 
> >          m_selectablePlayer(selectablePlayer)
> >      
> >      {
> >      
> >          for(int a = 0; a < MAX_PLAYERS; ++a)
> > 
> > @@ -139,11 +144,17 @@ public:
> >              Player *player = m_players.at(row);
> >              if (column == 0)
> >              {
> > 
> > +
> > +                // The player name changed.
> > +
> > 
> >                  player->setName(value.toString());
> >                  result = true;
> >              
> >              }
> >              else if (column == 1)
> >              {
> > 
> > +
> > +                // The player controller changed.
> > +
> > 
> >                  QString text = value.toString();
> >                  
> >                  Player *newPlayer = getNewPlayerByGuiName(text,
> >                  player->name(), player->color());> 
> > @@ -152,6 +163,8 @@ public:
> >                      m_players[row] = newPlayer;
> >                      m_game->map()->turnOverPlayerPlanets(player,
> >                      newPlayer);
> >                      player->deleteLater();
> > 
> > +
> > +                    m_newGameDlg->updateButtonOk();
> > 
> >                      result = true;
> >                  
> >                  }
> >              
> >              }
> > 
> > @@ -189,6 +202,7 @@ public:
> >                  m_availablePlayerId.pop_front();
> >                  m_players.append(player);
> >                  m_game->setPlayers(m_players);
> > 
> > +                m_newGameDlg->updateButtonOk();
> > 
> >              }
> >              
> >              endInsertRows();
> > 
> > @@ -211,11 +225,36 @@ public:
> >              m_availablePlayerId.push_back(PlayerId(player->color(),
> >              player->name()));
> >              m_players.removeAt(row);
> >              m_game->setPlayers(m_players);
> > 
> > +            m_newGameDlg->updateButtonOk();
> > 
> >              endRemoveRows();
> >          
> >          }
> >          return player;
> >      
> >      }
> > 
> > +
> > +    /**
> > +     * Check if the match is a spectator match, that is, there are not at
> > least +     * two non-spectating player controllers added.
> > +     */
> > +
> > +    bool isSpectatorMatch()
> > +    {
> > +        int nonSpectatorCount = 0;
> > +
> > +        foreach (Player* player, m_players) {
> > +            if (!player->isSpectator()) {
> > +
> > +                // The number of players is very limited so it is not
> > worth to +                // have an additional break in here as soon as
> > more than one +                // non-spectating player controller is
> > found.
> > +
> > +                ++nonSpectatorCount;
> > +            }
> > +        }
> > +
> > +        return nonSpectatorCount < 2;
> > +    }
> > +
> > 
> >  private:
> >      /**
> > 
> > @@ -313,6 +352,7 @@ NewGameDlg::NewGameDlg( QWidget *parent, Game *game)
> > 
> >      showButtonSeparator(true);
> >      
> >      m_selectablePlayer.push_back(new LocalPlayerGui());
> > 
> > +    m_selectablePlayer.push_back(new SpectatorPlayerGui());
> > 
> >      m_selectablePlayer.push_back(new AiDefaultWeakGui());
> >      m_selectablePlayer.push_back(new AiDefaultNormalGui());
> >      m_selectablePlayer.push_back(new AiDefaultHardGui());
> > 
> > @@ -363,6 +403,7 @@ NewGameDlg::updateOwnerCB()
> > 
> >      m_w->OwnerCB->addItem(i18n("neutral"));
> >  
> >  }
> > 
> > +
> > 
> >  void
> >  NewGameDlg::init()
> >  {
> > 
> > @@ -419,11 +460,11 @@ NewGameDlg::slotAddPlayer()
> > 
> >      playersListModel *model =
> >      static_cast<playersListModel*>(m_w->playerList->model());
> >      
> >      Player *player = model->addPlayer();
> > 
> > -    if (player)
> > +    if (player) {
> > 
> >          m_game->map()->addPlayerPlanetSomewhere(player);
> > 
> > +    }
> > 
> > -    enableButtonOk(model->rowCount() > 1);
> > -
> > +    updateButtonOk();
> > 
> >      updateOwnerCB();
> >  
> >  }
> > 
> > @@ -438,8 +479,7 @@ NewGameDlg::slotRemovePlayer()
> > 
> >          delete player;
> >      
> >      }
> > 
> > -    enableButtonOk(model->rowCount() > 1);
> > -
> > +    updateButtonOk();
> > 
> >      updateOwnerCB();
> >  
> >  }
> > 
> > @@ -586,3 +626,23 @@ NewGameDlg::slotUpdateNeutrals(int count)
> > 
> >      if(m_w->map->hasSelection())
> >      
> >          slotUpdateSelection(m_w->map->selection());
> >  
> >  }
> > 
> > +
> > +
> > +/**
> > + * Enable the "ok" button if the game settings are sane.
> > + */
> > +
> > +void
> > +NewGameDlg::updateButtonOk()
> > +{
> > +    playersListModel *model =
> > static_cast<playersListModel*>(m_w->playerList->model()); +
> > +    /**
> > +     * @todo Check if all non-spectator players have at least one planet.
> > +     */
> > +
> > +    enableButtonOk(
> > +        (model->rowCount() > 1) &&
> > +        (!model->isSpectatorMatch())
> > +    );
> > +}
> > diff --git a/dialogs/newgamedlg.h b/dialogs/newgamedlg.h
> > index 70e8a1a..bd7333b 100644
> > --- a/dialogs/newgamedlg.h
> > +++ b/dialogs/newgamedlg.h
> > 
> > @@ -72,6 +72,9 @@ protected slots:
> >      void  slotNewKillPercentage(double);
> >      void  slotNewProduction(int);
> > 
> > +public:
> > +    void  updateButtonOk();
> > +
> > 
> >  private:
> >      void  updateOwnerCB();
> >      void  init();
> > 
> > diff --git a/game.cpp b/game.cpp
> > index 5746b22..43811ca 100644
> > --- a/game.cpp
> > +++ b/game.cpp
> > @@ -180,7 +180,7 @@ void Game::findWinner()
> > 
> >      // Check for survivors
> >      Player *winner = 0;
> >      foreach (Player *player, m_players) {
> > 
> > -        if (player->isNeutral()) {
> > +        if (player->isNeutral() || player->isSpectator()) {
> > 
> >              continue;
> >          
> >          }
> >          if (!player->isDead()) {
> > 
> > diff --git a/gameview.cc b/gameview.cc
> > index ebba726..a01bfde 100644
> > --- a/gameview.cc
> > +++ b/gameview.cc
> > @@ -467,6 +467,15 @@ GameView::startNewGame()
> > 
> >      delete newGame;
> >      
> >      foreach (Player *player, m_game->players()) {
> > 
> > +        if (player->isSpectator()) {
> > +
> > +            // All planets a spectator player has assigned are turned
> > into
> > +            // neutral planets so that a spectator player starts without
> > +            // any planet.
> > +
> > +            m_game->map()->turnOverPlayerPlanets(player,
> > m_game->neutral()); +        }
> > +
> > 
> >          LocalPlayer *local = qobject_cast<LocalPlayer*>(player);
> >          if (local)
> >          
> >              connect(local, SIGNAL(canPlay()), this, SLOT(turn()));
> > 
> > diff --git a/players/computerplayer.cpp b/players/computerplayer.cpp
> > index f4fd7a2..997894c 100644
> > --- a/players/computerplayer.cpp
> > +++ b/players/computerplayer.cpp
> > @@ -22,7 +22,6 @@
> > 
> >  #include "computerplayer.h"
> >  #include "../game.h"
> > 
> > -#include "../planet.h"
> > 
> >  #include <KDebug>
> >  #include <cmath>
> > 
> > @@ -33,5 +32,10 @@ ComputerPlayer::ComputerPlayer(Game *game,
> > 
> >                                 const QColor &color)
> >      : 
> >      : Player(game, newName, color)
> >  
> >  {
> > 
> > +}
> > +
> > 
> > +bool ComputerPlayer::isAiPlayer()
> > +{
> > +    return true;
> > 
> >  }
> > 
> > diff --git a/players/computerplayer.h b/players/computerplayer.h
> > index 29b6b77..e0637e5 100644
> > --- a/players/computerplayer.h
> > +++ b/players/computerplayer.h
> > @@ -33,6 +33,7 @@ class ComputerPlayer : public Player
> > 
> >  protected:
> >      explicit ComputerPlayer(Game *game, const QString &newName, const
> >      QColor &color);> 
> > +    virtual bool isAiPlayer();
> > 
> >      virtual void play() = 0;
> >  
> >  signals:
> > diff --git a/players/localplayer.cpp b/players/localplayer.cpp
> > index dbb47f3..e02d687 100644
> > --- a/players/localplayer.cpp
> > +++ b/players/localplayer.cpp
> > @@ -28,10 +28,6 @@ LocalPlayer::LocalPlayer(Game *game, const QString
> > &newName, const QColor &color> 
> >  {
> >  }
> > 
> > -bool LocalPlayer::isAiPlayer()
> > -{
> > -    return false;
> > -}
> > 
> >  void LocalPlayer::play()
> >  {
> > 
> > @@ -39,6 +35,7 @@ void LocalPlayer::play()
> > 
> >      emit(canPlay());
> >  
> >  }
> > 
> > +
> > 
> >  void LocalPlayer::done()
> >  {
> >  
> >      kDebug() << name() << "::done";
> > 
> > diff --git a/players/localplayer.h b/players/localplayer.h
> > index a12b46f..ce1ca86 100644
> > --- a/players/localplayer.h
> > +++ b/players/localplayer.h
> > @@ -31,8 +31,6 @@ class LocalPlayer : public Player
> > 
> >  public:
> >      explicit LocalPlayer(Game *game, const QString &newName, const QColor
> >      &color);> 
> > -    virtual bool isAiPlayer();
> > -
> > 
> >      virtual void play();
> >      
> >      void done();
> > 
> > diff --git a/players/localplayer_gui.cpp b/players/localplayer_gui.cpp
> > index 44a04b5..58b51b1 100644
> > --- a/players/localplayer_gui.cpp
> > +++ b/players/localplayer_gui.cpp
> > @@ -21,7 +21,7 @@
> > 
> >  LocalPlayerGui::LocalPlayerGui() :
> > -    PlayerGui(i18nc("A human player", "Human"))
> > +    PlayerGui(i18nc("A human player", "Human (Player)"))
> > 
> >  {
> >  }
> > 
> > diff --git a/players/player.cpp b/players/player.cpp
> > index 7135127..2bf1306 100644
> > --- a/players/player.cpp
> > +++ b/players/player.cpp
> > @@ -79,7 +79,7 @@ bool Player::isDead()
> > 
> >  bool Player::isAiPlayer()
> >  {
> > 
> > -    return true;
> > +    return false;
> > 
> >  }
> >  
> >  bool Player::isNeutral()
> > 
> > @@ -87,6 +87,11 @@ bool Player::isNeutral()
> > 
> >      return false;
> >  
> >  }
> > 
> > +bool Player::isSpectator()
> > +{
> > +    return false;
> > +}
> > +
> > 
> >  QString Player::coloredName() const
> >  {
> >  
> >      return QString("<font color=\"%1\">%2</font>").arg(m_color.name(),
> >      m_name);
> > 
> > diff --git a/players/player.h b/players/player.h
> > index a6d91c4..278b740 100644
> > --- a/players/player.h
> > +++ b/players/player.h
> > 
> > @@ -36,6 +36,7 @@ public:
> >      virtual bool isNeutral();
> >      virtual bool isAiPlayer();
> > 
> > +    virtual bool isSpectator();
> > 
> >      // Getters and Setters for some fundamental properties.
> >      QString name()        const { return m_name; }
> > 
> > diff --git a/players/localplayer_gui.cpp b/players/spectatorplayer.cpp
> > similarity index 71%
> > copy from players/localplayer_gui.cpp
> > copy to players/spectatorplayer.cpp
> > index 44a04b5..67895c9 100644
> > --- a/players/localplayer_gui.cpp
> > +++ b/players/spectatorplayer.cpp
> > @@ -16,18 +16,27 @@
> > 
> >      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> >      02110-1301, USA.>   
> >   */
> > 
> > -#include "localplayer_gui.h"
> > -#include "localplayer.h"
> > +#include "spectatorplayer.h"
> > +
> > +SpectatorPlayer::SpectatorPlayer(
> > +        Game *game,
> > +        const QString &newName,
> > +        const QColor &color)
> > +    : LocalPlayer(
> > +        game,
> > +        newName,
> > +        color)
> > +{
> > +}
> > 
> > 
> > -LocalPlayerGui::LocalPlayerGui() :
> > -    PlayerGui(i18nc("A human player", "Human"))
> > +bool SpectatorPlayer::isDead()
> > 
> >  {
> > 
> > +    return false;
> > 
> >  }
> > 
> > -Player*
> > -LocalPlayerGui::createInstance(Game *game, const QString &newName, const
> > QColor &color) const +bool SpectatorPlayer::isSpectator()
> > 
> >  {
> > 
> > -    return new LocalPlayer(game, newName, color);
> > +    return true;
> > 
> >  }
> > 
> > diff --git a/players/localplayer_gui.cpp b/players/spectatorplayer.h
> > similarity index 57%
> > copy from players/localplayer_gui.cpp
> > copy to players/spectatorplayer.h
> > index 44a04b5..db7e74d 100644
> > --- a/players/localplayer_gui.cpp
> > +++ b/players/spectatorplayer.h
> > @@ -16,18 +16,34 @@
> > 
> >      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> >      02110-1301, USA.>   
> >   */
> > 
> > -#include "localplayer_gui.h"
> > +#ifndef SPECTATORPLAYER_H
> > +#define SPECTATORPLAYER_H
> > +
> > 
> >  #include "localplayer.h"
> > 
> > -LocalPlayerGui::LocalPlayerGui() :
> > -    PlayerGui(i18nc("A human player", "Human"))
> > +/**
> > + * a spectator player controller
> > + *
> > + * A spectator is very much like a local human player, except that it has
> > no + * planets. It cannot die and it does not count as active player. Its
> > main + * purpose is to watch the game, for example watch AIs play against
> > each other. + */
> > +
> > +class SpectatorPlayer : public LocalPlayer
> > 
> >  {
> > 
> > -}
> > +    Q_OBJECT
> > 
> > +public:
> > +    explicit SpectatorPlayer(Game *game, const QString &newName, const
> > QColor &color);
> > 
> > -Player*
> > -LocalPlayerGui::createInstance(Game *game, const QString &newName, const
> > QColor &color) const -{
> > -    return new LocalPlayer(game, newName, color);
> > -}
> > +    virtual bool isDead();
> > +    virtual bool isSpectator();
> > +
> > +signals:
> > +
> > +public slots:
> > +
> > +};
> > +
> > +#endif // SPECTATORPLAYER_H
> > diff --git a/players/localplayer_gui.cpp b/players/spectatorplayer_gui.cpp
> > similarity index 71%
> > copy from players/localplayer_gui.cpp
> > copy to players/spectatorplayer_gui.cpp
> > index 44a04b5..eb83e53 100644
> > --- a/players/localplayer_gui.cpp
> > +++ b/players/spectatorplayer_gui.cpp
> > @@ -16,18 +16,18 @@
> > 
> >      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> >      02110-1301, USA.>   
> >   */
> > 
> > -#include "localplayer_gui.h"
> > -#include "localplayer.h"
> > +#include "spectatorplayer_gui.h"
> > +#include "spectatorplayer.h"
> > 
> > 
> > -LocalPlayerGui::LocalPlayerGui() :
> > -    PlayerGui(i18nc("A human player", "Human"))
> > +SpectatorPlayerGui::SpectatorPlayerGui() :
> > +    PlayerGui(i18nc("A human spectator", "Human (Spectator)"))
> > 
> >  {
> >  }
> >  
> >  
> >  Player*
> > 
> > -LocalPlayerGui::createInstance(Game *game, const QString &newName, const
> > QColor &color) const +SpectatorPlayerGui::createInstance(Game *game,
> > const QString &newName, const QColor &color) const> 
> >  {
> > 
> > -    return new LocalPlayer(game, newName, color);
> > +    return new SpectatorPlayer(game, newName, color);
> > 
> >  }
> > 
> > diff --git a/players/localplayer_gui.cpp b/players/spectatorplayer_gui.h
> > similarity index 72%
> > copy from players/localplayer_gui.cpp
> > copy to players/spectatorplayer_gui.h
> > index 44a04b5..ec0a123 100644
> > --- a/players/localplayer_gui.cpp
> > +++ b/players/spectatorplayer_gui.h
> > @@ -16,18 +16,17 @@
> > 
> >      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> >      02110-1301, USA.>   
> >   */
> > 
> > -#include "localplayer_gui.h"
> > -#include "localplayer.h"
> > +#ifndef SPECTATOR_PLAYER_GUI_H
> > +#define SPECTATOR_PLAYER_GUI_H
> > 
> > -
> > -LocalPlayerGui::LocalPlayerGui() :
> > -    PlayerGui(i18nc("A human player", "Human"))
> > -{
> > -}
> > +#include "player_gui.h"
> > 
> > 
> > -Player*
> > -LocalPlayerGui::createInstance(Game *game, const QString &newName, const
> > QColor &color) const +class SpectatorPlayerGui : public PlayerGui
> > 
> >  {
> > 
> > -    return new LocalPlayer(game, newName, color);
> > -}
> > +public:
> > +    explicit SpectatorPlayerGui();
> > +    virtual Player* createInstance(Game *game, const QString &newName,
> > const QColor &color) const; +};
> > +
> > +#endif // SPECTATOR_PLAYER_GUI_H


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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