Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Works for all reset played

By: a guest on Feb 20th, 2012  |  syntax: Diff  |  size: 5.90 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -urN -x '*cscope*' ./mixxx-1.10.0final/src/build.h ./mixxx-1.10.0/src/build.h
  2. --- ./mixxx-1.10.0final/src/build.h     2012-02-09 22:39:14.511227657 +0530
  3. +++ ./mixxx-1.10.0/src/build.h  1970-01-01 05:30:00.000000000 +0530
  4. @@ -1,3 +0,0 @@
  5. -#define BUILD_BRANCH ""
  6. -#define BUILD_REV ""
  7. -#define BUILD_FLAGS "hifieq mad midiscript optimize qdebug shoutcast verbose vinylcontrol"
  8. diff -urN -x '*cscope*' ./mixxx-1.10.0final/src/library/cratetablemodel.cpp ./mixxx-1.10.0/src/library/cratetablemodel.cpp
  9. --- ./mixxx-1.10.0final/src/library/cratetablemodel.cpp 2011-12-24 08:23:18.000000000 +0530
  10. +++ ./mixxx-1.10.0/src/library/cratetablemodel.cpp      2012-02-20 15:08:32.885922888 +0530
  11. @@ -169,7 +169,8 @@
  12.              | TRACKMODELCAPS_RELOADMETADATA
  13.              | TRACKMODELCAPS_LOADTODECK
  14.              | TRACKMODELCAPS_LOADTOSAMPLER
  15. -            | TRACKMODELCAPS_REMOVE;
  16. +            | TRACKMODELCAPS_REMOVE
  17. +           | TRACKMODELCAPS_RESETPLAYED;
  18.  
  19.      CrateDAO& crateDao = m_pTrackCollection->getCrateDAO();
  20.      bool locked = crateDao.isCrateLocked(m_iCrateId);
  21. diff -urN -x '*cscope*' ./mixxx-1.10.0final/src/library/librarytablemodel.cpp ./mixxx-1.10.0/src/library/librarytablemodel.cpp
  22. --- ./mixxx-1.10.0final/src/library/librarytablemodel.cpp       2011-12-24 08:23:19.000000000 +0530
  23. +++ ./mixxx-1.10.0/src/library/librarytablemodel.cpp    2012-02-20 14:54:04.889926366 +0530
  24. @@ -137,6 +137,7 @@
  25.  }
  26.  
  27.  TrackModel::CapabilitiesFlags LibraryTableModel::getCapabilities() const {
  28. +    //qDebug()<<"Library table model getCapabilities called";
  29.      return TRACKMODELCAPS_NONE
  30.              | TRACKMODELCAPS_RECEIVEDROPS
  31.              | TRACKMODELCAPS_ADDTOPLAYLIST
  32. @@ -145,5 +146,6 @@
  33.              | TRACKMODELCAPS_RELOADMETADATA
  34.              | TRACKMODELCAPS_LOADTODECK
  35.              | TRACKMODELCAPS_LOADTOSAMPLER
  36. -            | TRACKMODELCAPS_REMOVE;
  37. +            | TRACKMODELCAPS_REMOVE
  38. +           | TRACKMODELCAPS_RESETPLAYED;
  39.  }
  40. diff -urN -x '*cscope*' ./mixxx-1.10.0final/src/library/playlisttablemodel.cpp ./mixxx-1.10.0/src/library/playlisttablemodel.cpp
  41. --- ./mixxx-1.10.0final/src/library/playlisttablemodel.cpp      2011-12-24 08:23:20.000000000 +0530
  42. +++ ./mixxx-1.10.0/src/library/playlisttablemodel.cpp   2012-02-20 15:09:38.773926479 +0530
  43. @@ -318,7 +318,8 @@
  44.              | TRACKMODELCAPS_RELOADMETADATA
  45.              | TRACKMODELCAPS_LOADTODECK
  46.              | TRACKMODELCAPS_LOADTOSAMPLER
  47. -            | TRACKMODELCAPS_REMOVE;
  48. +            | TRACKMODELCAPS_REMOVE
  49. +           | TRACKMODELCAPS_RESETPLAYED;
  50.  
  51.      // Only allow Add to AutoDJ if we aren't currently showing the AutoDJ queue.
  52.      if (m_iPlaylistId != m_playlistDao.getPlaylistIdFromName(AUTODJ_TABLE)) {
  53. diff -urN -x '*cscope*' ./mixxx-1.10.0final/src/library/trackmodel.h ./mixxx-1.10.0/src/library/trackmodel.h
  54. --- ./mixxx-1.10.0final/src/library/trackmodel.h        2011-12-24 08:23:20.000000000 +0530
  55. +++ ./mixxx-1.10.0/src/library/trackmodel.h     2012-02-20 14:37:56.794930286 +0530
  56. @@ -35,6 +35,7 @@
  57.          TRACKMODELCAPS_LOADTOSAMPLER  = 0x0100,
  58.          TRACKMODELCAPS_REMOVE         = 0x0200,
  59.          TRACKMODELCAPS_RELOCATE       = 0x0400,
  60. +       TRACKMODELCAPS_RESETPLAYED    = 0x0800,
  61.      };
  62.  
  63.      typedef int CapabilitiesFlags; /** Enables us to do ORing */
  64. @@ -83,6 +84,7 @@
  65.          return NULL;
  66.      }
  67.      virtual TrackModel::CapabilitiesFlags getCapabilities() const {
  68. +        qDebug()<<"TrackModel getCapabilities() called";
  69.          return TRACKMODELCAPS_NONE;
  70.      }
  71.      virtual QString getModelSetting(QString name) {
  72. diff -urN -x '*cscope*' ./mixxx-1.10.0final/src/widget/wtracktableview.cpp ./mixxx-1.10.0/src/widget/wtracktableview.cpp
  73. --- ./mixxx-1.10.0final/src/widget/wtracktableview.cpp  2011-12-24 08:23:20.000000000 +0530
  74. +++ ./mixxx-1.10.0/src/widget/wtracktableview.cpp       2012-02-17 23:54:12.601950874 +0530
  75. @@ -261,6 +261,10 @@
  76.  
  77.      m_pReloadMetadataAct = new QAction(tr("Reload Track Metadata"), this);
  78.      connect(m_pReloadMetadataAct, SIGNAL(triggered()), this, SLOT(slotReloadTrackMetadata()));
  79. +
  80. +    m_pResetPlayed = new QAction(tr("Reset Played Count"), this);
  81. +    connect(m_pResetPlayed, SIGNAL(triggered()), this, SLOT(slotResetPlayed()));
  82. +
  83.  }
  84.  
  85.  void WTrackTableView::slotMouseDoubleClicked(const QModelIndex &index) {
  86. @@ -310,6 +314,25 @@
  87.      }
  88.  }
  89.  
  90. +void WTrackTableView::slotResetPlayed(){
  91. +    //qDebug()<<"slotResetPlayed called";
  92. +    QModelIndexList indices = selectionModel()->selectedRows();
  93. +
  94. +    TrackModel* trackModel = getTrackModel();
  95. +
  96. +    if (trackModel == NULL) {
  97. +        return;
  98. +    }
  99. +
  100. +    foreach (QModelIndex index, indices) {
  101. +        TrackPointer pTrack = trackModel->getTrack(index);
  102. +        if (pTrack) {
  103. +            pTrack->setTimesPlayed(0);
  104. +        }
  105. +    }
  106. +
  107. +}
  108. +
  109.  void WTrackTableView::slotShowTrackInfo() {
  110.      QModelIndexList indices = selectionModel()->selectedRows();
  111.  
  112. @@ -453,6 +476,12 @@
  113.      m_pPropertiesAct->setEnabled(oneSongSelected);
  114.      m_pMenu->addAction(m_pPropertiesAct);
  115.  
  116. +    if(modelHasCapabilities(TrackModel::TRACKMODELCAPS_RESETPLAYED)){
  117. +       m_pMenu->addAction(m_pResetPlayed);
  118. +    }
  119. +    else{
  120. +       qDebug()<<"Couldnt get flag i guess";
  121. +    }
  122.      //Create the right-click menu
  123.      m_pMenu->popup(event->globalPos());
  124.  }
  125. diff -urN -x '*cscope*' ./mixxx-1.10.0final/src/widget/wtracktableview.h ./mixxx-1.10.0/src/widget/wtracktableview.h
  126. --- ./mixxx-1.10.0final/src/widget/wtracktableview.h    2011-12-24 08:23:20.000000000 +0530
  127. +++ ./mixxx-1.10.0/src/widget/wtracktableview.h 2012-02-16 17:21:01.537726060 +0530
  128. @@ -46,6 +46,7 @@
  129.      void slotNextTrackInfo();
  130.      void slotPrevTrackInfo();
  131.      void slotSendToAutoDJ();
  132. +    void slotResetPlayed();
  133.      void slotReloadTrackMetadata();
  134.      void addSelectionToPlaylist(int iPlaylistId);
  135.      void addSelectionToCrate(int iCrateId);
  136. @@ -95,6 +96,9 @@
  137.  
  138.      // Show track-editor action
  139.      QAction *m_pPropertiesAct;
  140. +
  141. +    //Reset played count action
  142. +    QAction *m_pResetPlayed;
  143.  };
  144.  
  145.  #endif
clone this paste RAW Paste Data