Exemplo n.º 1
0
void KoViewChild::slotFrameGeometryChanged()
{
  // Set our geometry from the frame geometry (R2 reversed)
  QRect geom = m_frame->geometry();
  int b = m_frame->border();
  QRect borderRect( geom.x() + b + parentView()->canvasXOffset(),
                    geom.y() + b + parentView()->canvasYOffset(),
                    geom.width() - b * 2,
                    geom.height() - b * 2 );
  setGeometry( borderRect );

  if(m_child)
  {
    // Set the child geometry from the frame geometry (R1 reversed)
    QRect borderLessRect( geom.x() + m_frame->leftBorder() + parentView()->canvasXOffset(),
                          geom.y() + m_frame->topBorder() + parentView()->canvasYOffset(),
                          geom.width() - m_frame->leftBorder() - m_frame->rightBorder(),
                          geom.height() - m_frame->topBorder() - m_frame->bottomBorder() );

    // We don't want to trigger slotDocGeometryChanged again
    lock();
    QRect childGeom = parentView()->reverseViewTransformations( borderLessRect );
    kdDebug() << "KoChild::slotFrameGeometryChanged child geometry "
              << ( geometry() == childGeom ? "already " : "set to " )
              << childGeom << endl;
    m_child->setGeometry( childGeom );
    unlock();
  }
}
Exemplo n.º 2
0
void QxtScheduleInternalItem::setStartTableOffset(int iOffset)
{
    if (parentView() && parentView()->model())
    {
        setData(parentView()->qxt_d().offsetToUnixTime(iOffset), Qxt::ItemStartTimeRole);
    }
}
Exemplo n.º 3
0
bool QxtScheduleInternalItem::setData(QVariant data, int role)
{
    if (parentView() && parentView()->model())
    {
        return parentView()->model()->setData(modelIndex(), data, role);
    }
    return false;
}
Exemplo n.º 4
0
void QxtScheduleInternalItem::setRowsUsed(int rows)
{
    if (parentView() && parentView()->model())
    {
        int seconds = rows * parentView()->currentZoomDepth(Qxt::Second);
        setData(seconds, Qxt::ItemDurationRole);
    }
}
Exemplo n.º 5
0
QModelIndex QxtScheduleInternalItem::modelIndex() const
{
    QModelIndex indx;
    if (parentView() && parentView()->model())
    {
        indx = parentView()->model()->index(this->m_iModelRow, 0);
    }
    return indx;
}
Exemplo n.º 6
0
/*******************************************************************************
    album part
*******************************************************************************/
void LocalScene::populateMostPlayedAlbum(int YPos)
{
    int albumRow  = 0;
    int Column    = 0;
    item_count    = (parentView()->width()/160 > 2) ? parentView()->width()/160 : 2;
    int maxPlaycount = 0;

    int char_entry = 0;

    CategorieGraphicItem *category = new CategorieGraphicItem(qobject_cast<QGraphicsView*> (parentView())->viewport());
    category->m_name = QString(tr("Most played albums"));
    category->setPos(0 ,YPos);
    addItem(category);

    //! get Album List from LocalTrackModel
    QList<MEDIA::AlbumPtr> albums = m_localTrackModel->albumItemList;

    //! sort
    qSort(albums.begin(), albums.end(), MEDIA::compareAlbumItemPlaycount);

    //! loop over album MediaItem
    foreach(MEDIA::AlbumPtr album, albums)
    {
      if(album->playcount == 0 || char_entry == MAX_CHART_ENTRY) break;

      if(maxPlaycount == 0)
        maxPlaycount = album->playcount;

      if( !m_localTrackModel->isMediaMatch(album) ) continue;

      AlbumGraphicItem_v3 *album_item = new AlbumGraphicItem_v3();
      album_item->media = album;
      album_item->setPos(4+160*Column, YPos + 35 + albumRow*190);

      addItem(album_item);
      char_entry++;

      if(Column < (item_count-1)) {
        Column++;
      }
      else {
        Column = 0;
        albumRow++;
      }
    }

    //! si liste vide --> message
    if(char_entry==0) {
      InfoGraphicItem *info = new InfoGraphicItem(qobject_cast<QGraphicsView*> (parentView())->viewport());
      info->_text = tr("No entry found");
      info->setPos( 0 , YPos + 50);
      addItem(info);
    }
}
Exemplo n.º 7
0
void LayoutBoxItem::appendItem(ViewItem *item) {
  if (item->parentItem() == this)
    return;

  item->setParentItem(this);
  layout()->addViewItem(item, layout()->rowCount(), 0, 1, layout()->columnCount());
  setPos(parentView()->sceneRect().topLeft());
  setViewRect(parentView()->sceneRect());
  //singleshot to give plots a chance to set a projection rect
  QTimer::singleShot(0, layout(), SLOT(update()));
}
Exemplo n.º 8
0
/*!
 * @desc returns the currently VISUAL offset (changes when a item moves)
 */
int QxtScheduleInternalItem::visualStartTableOffset() const
{
    if (m_geometries.size() == 0 || !parentView())
        return -1;

    //are we in a move?
    if (!m_moving)
        return startTableOffset();

    int offset = parentView()->qxt_d().pointToOffset(parentView()->mapToViewport((this->geometry()[0].topLeft())));
    return offset;
}
Exemplo n.º 9
0
/*!
 * @desc returns the currently VISUAL offset (changes when a item moves)
 */
int QxtScheduleInternalItem::visualEndTableOffset() const
{
    if (m_geometries.size() == 0 || !parentView())
        return -1;

    //are we in a move?
    if (!m_moving)
        return endTableOffset();

    QRect rect = m_geometries[m_geometries.size()-1];
    int endTableOffset = parentView()->qxt_d().pointToOffset(parentView()->mapToViewport(rect.bottomRight()));
    return endTableOffset;
}
Exemplo n.º 10
0
KoViewChild::KoViewChild( KoDocumentChild *child, KoView *_parentView )
{
  d = new KoViewChildPrivate;
  m_parentView = _parentView;
  m_child = child;

  m_frame = new KoFrame( parentView()->canvas() );
  KoView *view = child->document()->createView( m_frame );
  view->setXMLGUIBuildDocument( child->document()->viewBuildDocument( view ) );

  view->setPartManager( parentView()->partManager() );

  // hack? (Werner)
  view->setZoom( parentView()->zoom() * QMAX(child->xScaling(), child->yScaling()) );

  m_frame->setView( view );
  m_frame->show();
  m_frame->raise();

  parentView()->canvasAddChild( this );


  /*
   KoViewChild has basically three geometries to keep in sync.
   - The KoDocumentChild geometry (i.e. the embedded object's geometry, unzoomed)
   - Its own geometry (used for hit-test etc.)
   - The KoFrame geometry (the graphical widget for moving the object when active)

   So we need to subtract the scrollview's offset for the frame geometry, since it's a widget.

   The rules are
   (R1) frameGeometry = viewGeometry(childGeometry) "+" m_frame->{left|right|top|bottom}Border() - scrollview offset,
   (R2) frameGeometry = myGeometry "+" active_frame_border - scrollview offset.

   So: (R3, unused) myGeometry = viewGeometry(childGeometry) "+" m_frame->{left|right|top|bottom}Border() "-" active_frame_border

   Notes: active_frame_border is m_frame->border() (0 when inactive, 5 when active).
          {left|right|top|bottom}Border are the borders used in kspread (0 when inactive, big when active).
          "+" border means we add a border, so it's a subtraction on x, y and an addition on width, height.

          viewGeometry() applies the zoom as well as any other translation the app might want to do
   */

  // Setting the frameGeometry is done in setInitialFrameGeometry, which is
  // also called right after activation.

  connect( view, SIGNAL( activated( bool ) ),
           parentView(), SLOT( slotChildActivated( bool ) ) );
}
Exemplo n.º 11
0
/*******************************************************************************
    resizeScene
*******************************************************************************/
void FileScene::resizeScene()
{
    if(loading_directory) return;

    int new_item_count = (parentView()->width()/140 > 2) ? parentView()->width()/140 : 2;

    if(item_count != new_item_count)  
    {
      slot_on_directory_loaded();
    }
    else
    {
      update();
    }
} 
Exemplo n.º 12
0
LayoutBoxItem::LayoutBoxItem(View *parent)
    : ViewItem(parent) {
  setName("Layout Box");
  setZValue(LAYOUTBOX_ZVALUE);
  setPen(Qt::NoPen);
  setBrush(Qt::NoBrush);
  setAllowedGripModes(Move);

  parentView()->scene()->addItem(this);
  //setZValue(1);
  setPos(parentView()->sceneRect().topLeft());
  setViewRect(parentView()->sceneRect());

  setEnabled(true);
}
Exemplo n.º 13
0
void ArrowItem::paint(QPainter *painter) {
  painter->drawLine(line());

  start.clear();
  end.clear();
  if (_startArrowHead) {
    //FIXME: this assumes that pixelSize == pointSize, which it only might...
    double deltax = parentView()->defaultFont(_startArrowScale).pointSizeF()*0.5;
    double theta = atan2(double(line().y2() - line().y1()), double(line().x2() - line().x1())) - M_PI / 2.0;
    double sina = sin(theta);
    double cosa = cos(theta);
    double yin = sqrt(3.0) * deltax;
    double x1, y1, x2, y2;
    QMatrix m(cosa, sina, -sina, cosa, 0.0, 0.0);

    m.map( deltax, yin, &x1, &y1);
    m.map(-deltax, yin, &x2, &y2);

    QPolygonF pts;
    pts.append(line().p1());
    pts.append(line().p1() + QPointF(x1, y1));
    pts.append(line().p1() + QPointF(x2, y2));
    painter->drawPolygon(pts);
    start = pts;
  }

  if (_endArrowHead) {
    //FIXME: this assumes that pixelSize == pointSize, which it only might...
    double deltax = parentView()->defaultFont(_endArrowScale).pointSizeF()*0.5;
    double theta = atan2(double(line().y1() - line().y2()), double(line().x1() - line().x2())) - M_PI / 2.0;
    double sina = sin(theta);
    double cosa = cos(theta);
    double yin = sqrt(3.0) * deltax;
    double x1, y1, x2, y2;
    QMatrix m(cosa, sina, -sina, cosa, 0.0, 0.0);

    m.map( deltax, yin, &x1, &y1);
    m.map(-deltax, yin, &x2, &y2);

    QPolygonF pts;
    pts.append(line().p2());
    pts.append(line().p2() + QPointF(x1, y1));
    pts.append(line().p2() + QPointF(x2, y2));
    painter->drawPolygon(pts);
    end = pts;
  }
}
Exemplo n.º 14
0
void KoViewChild::slotDocGeometryChanged()
{
  if ( locked() )
      return;
  // Set frame geometry from child geometry (R1)
  // The frame's resizeEvent will call slotFrameGeometryChanged.
  QRect geom = parentView()->applyViewTransformations( m_child->geometry() );
  QRect borderRect( geom.x() - m_frame->leftBorder() - parentView()->canvasXOffset(),
                    geom.y() - m_frame->topBorder() - parentView()->canvasYOffset(),
                    geom.width() + m_frame->leftBorder() + m_frame->rightBorder(),
                    geom.height() + m_frame->topBorder() + m_frame->bottomBorder() );
  kdDebug() << "KoViewChild::slotDocGeometryChanged frame geometry "
            << ( m_frame->geometry() == borderRect ? "already " : "set to " )
            << borderRect << endl;

  m_frame->setGeometry( borderRect );
}
Exemplo n.º 15
0
void LineItem::creationPolygonChanged(View::CreationEvent event) {
  if (event == View::MousePress) {
    const QPolygonF poly = mapFromScene(parentView()->creationPolygon(View::MousePress));
    setPos(poly.first().x(), poly.first().y());
    setViewRect(QRectF(0.0, 0.0, 0.0, sizeOfGrip().height()));
    parentView()->scene()->addItem(this);
    //setZValue(1);
    return;
  }

  if (event == View::MouseMove) {
    const QPolygonF poly = mapFromScene(parentView()->creationPolygon(View::MouseMove));
    if (!rect().isEmpty()) {
      rotateTowards(line().p2(), poly.last());
    }
    QRectF r = rect();
    r.setSize(QSizeF(QLineF(line().p1(), poly.last()).length(), r.height()));
    setViewRect(r);
    return;
  }

  if (event == View::MouseRelease) {
    const QPolygonF poly = mapFromScene(parentView()->creationPolygon(View::MouseRelease));
    parentView()->disconnect(this, SLOT(deleteLater())); //Don't delete ourself
    parentView()->disconnect(this, SLOT(creationPolygonChanged(View::CreationEvent)));
    parentView()->setMouseMode(View::Default);
    maybeReparent();
    emit creationComplete();
    return;
  }
}
Exemplo n.º 16
0
int QxtScheduleInternalItem::startTableOffset() const
{
    if (parentView() && parentView()->model())
    {
        int startTime = data(Qxt::ItemStartTimeRole).toInt();
        int zoomDepth = parentView()->currentZoomDepth(Qxt::Second);

        qint32 offset = startTime - parentView()->qxt_d().m_startUnixTime;

        //the start of the current item does not fit in the view
        //so we have to align it to the nearest boundaries
        if (offset % zoomDepth)
        {
            int lower = offset / zoomDepth * zoomDepth;
            int upper = lower + zoomDepth;

            offset = (offset - lower >= upper - offset ? upper : lower);

            return parentView()->qxt_d().unixTimeToOffset(offset + parentView()->qxt_d().m_startUnixTime);
        }

        return parentView()->qxt_d().unixTimeToOffset(startTime);
    }
    return -1;
}
Exemplo n.º 17
0
QPainterPath ArrowItem::shape() const {
  QPainterPath selectPath;
  selectPath.setFillRule(Qt::WindingFill);
  selectPath.addPolygon(rect());
  selectPath.addPolygon(start);
  selectPath.addPolygon(end);
  if ((!isSelected() && !isHovering()) || (parentView()->mouseMode() == View::Create)) {
  } else {
    selectPath.addPath(grips());
  }
  return selectPath;
}
Exemplo n.º 18
0
int QxtScheduleInternalItem::rows() const
{
    if (parentView() && parentView()->model())
    {
        int iNumSecs = data(Qxt::ItemDurationRole).toInt();
        int zoomDepth = parentView()->currentZoomDepth(Qxt::Second);

        //the length of the current item does not fit in the view
        //so we have to align it to the nearest boundaries
        if (iNumSecs % zoomDepth)
        {
            int lower = iNumSecs / zoomDepth * zoomDepth;
            int upper = lower + zoomDepth;

            return (iNumSecs - lower >= upper - iNumSecs ? (upper / zoomDepth) : (lower / zoomDepth));

        }
        return (iNumSecs / zoomDepth);
    }
    return -1;
}
Exemplo n.º 19
0
/*******************************************************************************
    initScene
*******************************************************************************/
void SettingsScene::initScene()
{
    // create pages
    m_pages[SETTINGS::GENERAL]   = new PageGeneral(parentView());
    m_pages[SETTINGS::PLAYER]    = new PagePlayer(parentView());
    m_pages[SETTINGS::LIBRARY]   = new PageLibrary(parentView());
    m_pages[SETTINGS::SHORTCUT]  = new PageShortcut(parentView());
    m_pages[SETTINGS::SCROBBLER] = new PageScrobbler(parentView());
    m_pages[SETTINGS::SONGINFO]  = new PageSongInfo(parentView());

    /* first init => always restore settings */
    restore_settings();
    
    /*  layout */
    m_layout    = new QGraphicsLinearLayout(Qt::Vertical);
    m_layout->setSpacing(10);
    m_layout->addItem( m_pages.value(SETTINGS::GENERAL) );
    m_layout->addItem( m_pages.value(SETTINGS::PLAYER) );
    m_layout->addItem( m_pages.value(SETTINGS::LIBRARY) );
    m_layout->addItem( m_pages.value(SETTINGS::SHORTCUT) );
    m_layout->addItem( m_pages.value(SETTINGS::SONGINFO) );
    m_layout->addItem( m_pages.value(SETTINGS::SCROBBLER) );

    m_container = new QGraphicsWidget();
    m_container->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
    m_container->setLayout(m_layout);
    m_container->setPos(0,0);
    this->addItem(m_container);

    /* il faut interdire la modification des parametres de collection si un database builder est en cours */
    connect(ThreadManager::instance(), SIGNAL(dbBuildStart()), this, SLOT(slot_dbBuilder_stateChange()));
    connect(ThreadManager::instance(), SIGNAL(dbBuildFinished()), this, SLOT(slot_dbBuilder_stateChange()));

    connect(Database::instance(), SIGNAL(settingsChanged()), this, SLOT(slot_database_settingsChanged()));
    
    connect(MainLeftWidget::instance(), SIGNAL(dbNameChanged()), this, SLOT(slot_database_settingsChanged()));
    connect(MainLeftWidget::instance(), SIGNAL(settings_save_clicked()), this, SLOT(slot_apply_settings()));
    connect(MainLeftWidget::instance(), SIGNAL(settings_cancel_clicked()), this, SLOT(slot_cancel_settings()));
        
    
    connect(m_pages[SETTINGS::GENERAL], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::PLAYER], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::LIBRARY], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::SHORTCUT], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::SCROBBLER], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::SONGINFO], SIGNAL(layout_changed()), this, SLOT(populateScene()));    
    
    setInit(true);
}
Exemplo n.º 20
0
/*******************************************************************************
    initScene
*******************************************************************************/
void SettingsScene::initScene()
{
    // create pages
    m_pages[SETTINGS::GENERAL]   = new PageGeneral(parentView());
    m_pages[SETTINGS::PLAYER]    = new PagePlayer(parentView());
    m_pages[SETTINGS::LIBRARY]   = new PageLibrary(parentView());
    m_pages[SETTINGS::SHORTCUT]  = new PageShortcut(parentView());
    m_pages[SETTINGS::SCROBBLER] = new PageScrobbler(parentView());
    m_pages[SETTINGS::SONGINFO]  = new PageSongInfo(parentView());

    connect(m_pages[SETTINGS::GENERAL], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::PLAYER], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::LIBRARY], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::SHORTCUT], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::SCROBBLER], SIGNAL(layout_changed()), this, SLOT(populateScene()));
    connect(m_pages[SETTINGS::SONGINFO], SIGNAL(layout_changed()), this, SLOT(populateScene()));

    m_header = new HeaderItem(qobject_cast<QGraphicsView*> (parentView())->viewport());
    m_header->setText( tr("Settings") );

    /* bottom widget */
    m_bottomWidget  = new BottomWidget();
    connect(m_bottomWidget, SIGNAL(save_clicked()), this, SLOT(slot_apply_settings()));
    connect(m_bottomWidget, SIGNAL(cancel_clicked()), this, SLOT(slot_cancel_settings()));
    
    
    this->addItem(m_header);
    this->addItem(m_pages.value(SETTINGS::GENERAL));
    this->addItem(m_pages.value(SETTINGS::PLAYER));
    this->addItem(m_pages.value(SETTINGS::LIBRARY));
    this->addItem(m_pages.value(SETTINGS::SHORTCUT));
    this->addItem(m_pages.value(SETTINGS::SCROBBLER));
    this->addItem(m_pages.value(SETTINGS::SONGINFO));

    /* first init => always restore settings */
    restore_settings();

    /* il faut interdire la modification des parametres de collection si un database builder est en cours */
    connect(ThreadManager::instance(), SIGNAL(dbBuildStart()), this, SLOT(slot_dbBuilder_stateChange()));
    connect(ThreadManager::instance(), SIGNAL(dbBuildFinished()), this, SLOT(slot_dbBuilder_stateChange()));
    
    setInit(true);
}
Exemplo n.º 21
0
void LocalScene::populateTopRatedArtist(int YPos)
{
    int artistRow  = 0;
    int Column     = 0;
    item_count = (parentView()->width()/160 > 2) ? parentView()->width()/160 : 2;
    int char_entry = 0;

    CategorieGraphicItem *category = new CategorieGraphicItem(qobject_cast<QGraphicsView*> (parentView())->viewport());
    category->m_name = QString(tr("Top rated artists"));
    category->setPos(0 ,YPos);
    addItem(category);

    //! get artists List from LocalTrackModel
    QList<MEDIA::ArtistPtr> artists;
    for (int i=0 ; i < m_localTrackModel->rootItem()->childCount(); i++ ) {
       artists << MEDIA::ArtistPtr::staticCast(m_localTrackModel->rootItem()->child(i));
     }

    //! sort
    qSort(artists.begin(), artists.end(), MEDIA::compareArtistItemRating);

    //! loop over artist MediaItem
    foreach(MEDIA::ArtistPtr artist, artists)
    {
      if(artist->rating == 0.0 || char_entry == MAX_CHART_ENTRY) break;

      if( !m_localTrackModel->isMediaMatch(artist) ) continue;

      ArtistGraphicItem_v3 *artist_item = new ArtistGraphicItem_v3();
      artist_item->media = artist;
      artist_item->setPos(4+160*Column, YPos + 35 + artistRow*190);

      addItem(artist_item);
      char_entry++;

      /* ALBUM COVER LOOP */
        artist_item->albums_covers.clear();
        for(int j = artist->childCount()-1 ; j >= 0; j--) {
          if(!m_localTrackModel->isMediaMatch(artist->child(j)) ) continue;
          MEDIA::AlbumPtr album = MEDIA::AlbumPtr::staticCast(artist->child(j));

          artist_item->albums_covers.prepend(album);

          /* WARNING limite de l'affichage à 6 cover max */
          if(artist_item->albums_covers.size() >=6) break;
        }

      if(Column < (item_count-1)) {
        Column++;
      }
      else {
        Column = 0;
        artistRow++;
      }
    }

    //! si liste vide --> message
    if(char_entry==0) {
      InfoGraphicItem *info = new InfoGraphicItem(qobject_cast<QGraphicsView*> (parentView())->viewport());
      info->_text = tr("No entry found");
      info->setPos( 0 , YPos + 50);
      addItem(info);
    }
}
Exemplo n.º 22
0
/*******************************************************************************
    slot_on_directory_loaded
*******************************************************************************/
void FileScene::slot_on_directory_loaded()
{
    loading_directory = true;
    Debug::debug() << "   [FileScene] slot_on_directory_loaded";

    /* clear the scene FIRST */
    clear();
    m_infosize = 0;
    
    QStringList urls;
    
    /* populate scene */
    int folderRow     = 0;
    int trackRow      = 0;
    int Column        = 0;
    int categorieRow  = 0;
    
    item_count = (parentView()->width()/140 > 2) ? parentView()->width()/140 : 2;


    
    //! header item
    HeaderItem* header = new HeaderItem(qobject_cast<QGraphicsView*> (parentView())->viewport());
    header->setText( tr("Directories") );
    header->setPos(0, 5);
    addItem(header);    

    categorieRow++;
    
    CategorieGraphicItem *cat = new CategorieGraphicItem(qobject_cast<QGraphicsView*> (parentView())->viewport());
    cat->m_name = m_model->rootPath();
    cat->setPos( 0 ,10 + categorieRow*50);
    categorieRow++;
    addItem(cat);


    
    QModelIndex root_idx = m_model->index(m_current_path);
    
    
    for(int childRow = 0; childRow < m_model->rowCount(root_idx); ++childRow) 
    {
        QModelIndex childIndex = root_idx.child(childRow, 0);

        QFileInfo fileInfo = m_model->fileInfo ( childIndex );

        const QString path = fileInfo.canonicalFilePath();

        if(!m_filter.isEmpty() && !path.contains(m_filter,Qt::CaseInsensitive)) continue;

        if(fileInfo.isDir()) {
          DirectoryGraphicItem *item = new DirectoryGraphicItem();
          item->setPath(fileInfo.canonicalFilePath());
          item->setDirname(QDir(fileInfo.canonicalFilePath()).dirName());
          item->setPixmap(m_folder_pixmap);
          item->setPos(4+140*Column, 10 + folderRow*150 + categorieRow*50);
          addItem(item);
          //Debug::debug() << "FileScene::PopulateScene add item : " << item->path();
          m_infosize++;
        } // isDir
        else
        {
          urls << path;
          continue;
        }

        if(Column < (item_count-1)) {
          Column++;
        }
        else {
          Column = 0;
          folderRow++;
        }
    }  

    if(Column > 0)
      folderRow++;
    
    foreach (QString url, urls) 
    {    
        TrackGraphicItem_v4 *track_item = new TrackGraphicItem_v4();
      
        MEDIA::TrackPtr track = MEDIA::FromDataBase(url);
  
        //Debug::debug() << "FileScene try find url : " << url;
        if(!track) 
        {
          track = MEDIA::TrackPtr(new MEDIA::Track());

          track->id           =  -1;
          track->url          =  url;
          track->isPlaying    =  false;
          track->isBroken     =  false;
          track->isPlayed     =  false;
          track->isStopAfter  =  false;
  
          map_graphic_items[url] = track_item;
          QtConcurrent::run(this, &FileScene::async_load_item, track, url);
        }


        track_item->media = track;
        track_item->setPos(30,  10 + folderRow*150 + categorieRow*50 + trackRow*20);
        track_item->_width = parentView()->width()-30-20;
        addItem(track_item);
        trackRow++; 
        m_infosize++;


    }