* mu-cmd-server: set default to 500 results (thanks to Frank Terbeck)
This commit is contained in:
@ -837,6 +837,8 @@ cmd_extract (ServerContext *ctx, GHashTable *args, GError **err)
|
|||||||
return MU_OK;
|
return MU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MAX_NUM_DEFAULT 500
|
||||||
|
|
||||||
/* parse the find parameters, and return the values as out params */
|
/* parse the find parameters, and return the values as out params */
|
||||||
static MuError
|
static MuError
|
||||||
get_find_params (GHashTable *args, MuMsgFieldId *sortfield,
|
get_find_params (GHashTable *args, MuMsgFieldId *sortfield,
|
||||||
@ -845,7 +847,7 @@ get_find_params (GHashTable *args, MuMsgFieldId *sortfield,
|
|||||||
const char *maxnumstr, *sortfieldstr;
|
const char *maxnumstr, *sortfieldstr;
|
||||||
|
|
||||||
/* defaults */
|
/* defaults */
|
||||||
*maxnum = 500;
|
*maxnum = MAX_NUM_DEFAULT;
|
||||||
*qflags = MU_QUERY_FLAG_NONE;
|
*qflags = MU_QUERY_FLAG_NONE;
|
||||||
*sortfield = MU_MSG_FIELD_ID_NONE;
|
*sortfield = MU_MSG_FIELD_ID_NONE;
|
||||||
|
|
||||||
@ -866,7 +868,8 @@ get_find_params (GHashTable *args, MuMsgFieldId *sortfield,
|
|||||||
|
|
||||||
/* maximum number of results */
|
/* maximum number of results */
|
||||||
maxnumstr = get_string_from_args (args, "maxnum", TRUE, NULL);
|
maxnumstr = get_string_from_args (args, "maxnum", TRUE, NULL);
|
||||||
*maxnum = maxnumstr ? atoi (maxnumstr) : 0;
|
if (maxnumstr)
|
||||||
|
*maxnum = atoi (maxnumstr);
|
||||||
|
|
||||||
if (get_bool_from_args (args, "reverse", TRUE, NULL))
|
if (get_bool_from_args (args, "reverse", TRUE, NULL))
|
||||||
*qflags |= MU_QUERY_FLAG_DESCENDING;
|
*qflags |= MU_QUERY_FLAG_DESCENDING;
|
||||||
|
|||||||
Reference in New Issue
Block a user