Revert "transmission: update from 2.13 to 2.22"
[tomato.git] / release / src / router / transmission / qt / filters.cc
blob9a52c886a2028405e1173da6fa95d93521720b02
1 /*
2 * This file Copyright (C) Mnemosyne LLC
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10 * $Id: filters.cc 11196 2010-09-06 00:19:37Z charles $
13 #include "filters.h"
15 const QString FilterMode::names[NUM_MODES] =
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",
28 int
29 FilterMode :: modeFromName( const QString& name )
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
37 const 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-id"
49 int
50 SortMode :: modeFromName( const QString& name )
52 for( int i=0; i<NUM_MODES; ++i )
53 if( names[i] == name )
54 return i;
55 return SortMode().mode(); // use the default value