1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 09:04:33 +02:00

* Set maximum amount of temp pages to 15.

This commit is contained in:
Christian Muehlhaeuser
2012-12-18 14:00:02 +01:00
parent 5a52586945
commit 7d61881c10

View File

@@ -28,7 +28,7 @@
using namespace Tomahawk; using namespace Tomahawk;
const unsigned int MAX_HISTORY_ITEMS = 0; // 0 disables this feature const unsigned int MAX_HISTORY_ITEMS = 15; // 0 disables this feature
HistoryItem::HistoryItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, int peerSortValue ) HistoryItem::HistoryItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, int peerSortValue )
@@ -63,7 +63,7 @@ HistoryItem::tempPageActivated( Tomahawk::ViewPage* v )
} }
// Only keep a certain amount of temporary pages at once // Only keep a certain amount of temporary pages at once
while ( MAX_HISTORY_ITEMS > 0 && m_tempItems.size() > MAX_HISTORY_ITEMS ) while ( MAX_HISTORY_ITEMS > 0 && m_tempItems.size() > MAX_HISTORY_ITEMS - 1 )
{ {
TemporaryPageItem* item = m_tempItems.takeFirst(); TemporaryPageItem* item = m_tempItems.takeFirst();
QTimer::singleShot( 0, item, SLOT( removeFromList() ) ); QTimer::singleShot( 0, item, SLOT( removeFromList() ) );