source: trunk/qt/filters.cc @ 11086

Last change on this file since 11086 was 11086, checked in by Longinus00, 12 years ago

(trunk) #3471:Add 'finished' to filterbar

  • Property svn:keywords set to Date Rev Author Id
File size: 1.3 KB
Line 
1/*
2 * This file Copyright (C) 2009-2010 Mnemosyne LLC
3 *
4 * This file is licensed by the GPL version 2.  Works owned by the
5 * Transmission project are granted a special exemption to clause 2(b)
6 * so that the bulk of its code can remain under the MIT license.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: filters.cc 11086 2010-08-01 17:43:35Z Longinus00 $
11 */
12
13#include "filters.h"
14
15const QString FilterMode::names[NUM_MODES] =
16{
17    "show-all",
18    "show-active",
19    "show-downloading",
20    "show-seeding",
21    "show-paused",
22    "show-finished",
23    "show-queued",
24    "show-verifying",
25    "show-error",
26};
27
28int
29FilterMode :: modeFromName( const QString& name )
30{
31    for( int i=0; i<NUM_MODES; ++i )
32        if( names[i] == name )
33            return i;
34    return FilterMode().mode(); // use the default value
35}
36
37const QString SortMode::names[NUM_MODES] = {
38    "sort-by-activity",
39    "sort-by-age",
40    "sort-by-eta",
41    "sort-by-name",
42    "sort-by-progress",
43    "sort-by-ratio",
44    "sort-by-size",
45    "sort-by-state",
46    "sort-by-tracker",
47    "sort-by-id"
48};
49
50int
51SortMode :: modeFromName( const QString& name )
52{
53    for( int i=0; i<NUM_MODES; ++i )
54        if( names[i] == name )
55            return i;
56    return SortMode().mode(); // use the default value
57}
Note: See TracBrowser for help on using the repository browser.