Author: rharabien
Date: Wed Oct 12 21:30:50 2011
New Revision: 54098
URL:
http://svn.reactos.org/svn/reactos?rev=54098&view=rev
Log:
[DESK]
- Fix duplicated entries in screensaver selector. Patch by Carlo Bramix <carlo dot
bramix at libero dot it>.
See issue #6533 for more details.
Modified:
trunk/reactos/dll/cpl/desk/screensaver.c
Modified: trunk/reactos/dll/cpl/desk/screensaver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/screensaver.c…
==============================================================================
--- trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] Wed Oct 12 21:30:50 2011
@@ -410,6 +410,7 @@
{
HWND hwndScreenSavers = GetDlgItem(hwndDlg, IDC_SCREENS_LIST);
TCHAR szSearchPath[MAX_PATH];
+ TCHAR szLocalPath[MAX_PATH];
INT i;
ScreenSaverItem *ScreenSaverItem = NULL;
LPTSTR lpBackSlash;
@@ -437,22 +438,24 @@
// Initialize number of items into the list
pData->ScreenSaverCount = 1;
+ // Add all the screensavers where the applet is stored.
+ GetModuleFileName(hApplet, szLocalPath, MAX_PATH);
+ lpBackSlash = _tcsrchr(szLocalPath, _T('\\'));
+ if (lpBackSlash != NULL)
+ {
+ *lpBackSlash = '\0';
+ SearchScreenSavers(hwndScreenSavers, szLocalPath, pData);
+ }
+
// Add all the screensavers in the C:\ReactOS\System32 directory.
GetSystemDirectory(szSearchPath, MAX_PATH);
- SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
+ if (lpBackSlash != NULL && _tcsicmp(szSearchPath, szLocalPath) != 0)
+ SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
// Add all the screensavers in the C:\ReactOS directory.
GetWindowsDirectory(szSearchPath, MAX_PATH);
- SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
-
- // Add all the screensavers where the applet is stored.
- GetModuleFileName(hApplet, szSearchPath, MAX_PATH);
- lpBackSlash = _tcsrchr(szSearchPath, _T('\\'));
- if (lpBackSlash != NULL)
- {
- *lpBackSlash = '\0';
+ if (lpBackSlash != NULL && _tcsicmp(szSearchPath, szLocalPath) != 0)
SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
- }
}