Skip to content

Commit

Permalink
remove _app_listview_sort_ex
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypp committed Jan 25, 2024
1 parent 5e053ec commit 66fd40b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
10 changes: 5 additions & 5 deletions src/editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ INT_PTR CALLBACK EditorPagesProc (
_app_listview_refreshgroups (hwnd, IDC_RULE_APPS_ID);

// sort column
_app_listview_sort (hwnd, IDC_RULE_APPS_ID);
_app_listview_sort (hwnd, IDC_RULE_APPS_ID, -1, FALSE);
}

// app group
Expand Down Expand Up @@ -831,7 +831,7 @@ INT_PTR CALLBACK EditorPagesProc (
_app_listview_refreshgroups (hwnd, IDC_APP_RULES_ID);

// sort column
_app_listview_sort (hwnd, IDC_APP_RULES_ID);
_app_listview_sort (hwnd, IDC_APP_RULES_ID, -1, FALSE);
}

// hints
Expand Down Expand Up @@ -1089,7 +1089,7 @@ INT_PTR CALLBACK EditorPagesProc (
lpnmlv = (LPNMLISTVIEW)lparam;
listview_id = (INT)(INT_PTR)lpnmlv->hdr.idFrom;

_app_listview_sort_ex (hwnd, listview_id, lpnmlv->iSubItem, TRUE);
_app_listview_sort (hwnd, listview_id, lpnmlv->iSubItem, TRUE);

break;
}
Expand Down Expand Up @@ -1157,7 +1157,7 @@ INT_PTR CALLBACK EditorPagesProc (
_app_editor_settabtitle (hwnd, listview_id);

_app_listview_refreshgroups (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id, -1, FALSE);
}
}
else if (listview_id == IDC_RULE_REMOTE_ID || listview_id == IDC_RULE_LOCAL_ID)
Expand Down Expand Up @@ -1396,7 +1396,7 @@ INT_PTR CALLBACK EditorPagesProc (
_app_listview_lock (hwnd, listview_id, FALSE);

_app_listview_refreshgroups (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id, -1, FALSE);

break;
}
Expand Down
14 changes: 3 additions & 11 deletions src/listview.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ VOID _app_listview_showitemby_param (

if (listview_id != _app_listview_getcurrent (hwnd))
{
_app_listview_sort (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id, -1, FALSE);

_app_listview_resize (hwnd, listview_id, FALSE);
}
Expand Down Expand Up @@ -516,7 +516,7 @@ VOID _app_listview_updateby_id (
_app_listview_refreshgroups (hwnd, listview_id);

if (!(flags & PR_UPDATE_NOSORT))
_app_listview_sort (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id, -1, FALSE);

if (!(flags & PR_UPDATE_NORESIZE))
_app_listview_resize (hwnd, listview_id, FALSE);
Expand Down Expand Up @@ -1114,7 +1114,7 @@ INT CALLBACK _app_listview_compare_callback (
return is_descend ? -result : result;
}

VOID _app_listview_sort_ex (
VOID _app_listview_sort (
_In_ HWND hwnd,
_In_ INT listview_id,
_In_ LONG column_id,
Expand Down Expand Up @@ -1164,11 +1164,3 @@ VOID _app_listview_sort_ex (

_r_wnd_sendmessage (hwnd, listview_id, LVM_SORTITEMSEX, (WPARAM)hlistview, (LPARAM)&_app_listview_compare_callback);
}

VOID _app_listview_sort (
_In_ HWND hwnd,
_In_ INT listview_id
)
{
_app_listview_sort_ex (hwnd, listview_id, -1, FALSE);
}
7 changes: 1 addition & 6 deletions src/listview.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,9 @@ INT CALLBACK _app_listview_compare_callback (
_In_ LPARAM lparam
);

VOID _app_listview_sort_ex (
VOID _app_listview_sort (
_In_ HWND hwnd,
_In_ INT listview_id,
_In_ LONG column_id,
_In_ BOOLEAN is_notifycode
);

VOID _app_listview_sort (
_In_ HWND hwnd,
_In_ INT listview_id
);
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BOOLEAN _app_changefilters (

listview_id = _app_listview_getcurrent (hwnd);

_app_listview_sort (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id, -1, FALSE);

if (is_forced || _wfp_isfiltersinstalled ())
{
Expand Down Expand Up @@ -2567,7 +2567,7 @@ INT_PTR CALLBACK DlgProc (
lpnmlv = (LPNMLISTVIEW)lparam;
ctrl_id = (INT)(INT_PTR)lpnmlv->hdr.idFrom;

_app_listview_sort_ex (hwnd, ctrl_id, lpnmlv->iSubItem, TRUE);
_app_listview_sort (hwnd, ctrl_id, lpnmlv->iSubItem, TRUE);

break;
}
Expand Down Expand Up @@ -3183,7 +3183,7 @@ INT_PTR CALLBACK DlgProc (
listview_id = _app_listview_getcurrent (hwnd);

_r_listview_redraw (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id);
_app_listview_sort (hwnd, listview_id, -1, FALSE);

break;
}
Expand Down

0 comments on commit 66fd40b

Please sign in to comment.