[MPlayer-cvslog] r34180 - in trunk/gui/win32: dialogs.c gui.c playlist.c skinload.c

ib subversion at mplayerhq.hu
Thu Oct 6 14:09:06 CEST 2011


Author: ib
Date: Thu Oct  6 14:09:05 2011
New Revision: 34180

Log:
Don't use the Windows style path separator character in Win32 GUI.

We use the Unix style path separator character throughout everywhere
else, so use it here as well.

Although Cygwin and MinGW tolerate a mixed Unix and Windows style, it
beautifies the messages.

Modified:
   trunk/gui/win32/dialogs.c
   trunk/gui/win32/gui.c
   trunk/gui/win32/playlist.c
   trunk/gui/win32/skinload.c

Modified: trunk/gui/win32/dialogs.c
==============================================================================
--- trunk/gui/win32/dialogs.c	Thu Oct  6 12:04:40 2011	(r34179)
+++ trunk/gui/win32/dialogs.c	Thu Oct  6 14:09:05 2011	(r34180)
@@ -129,7 +129,7 @@ int display_openfilewindow(gui_t *gui, i
             filespec = &fileopen.lpstrFile[fileopen.nFileOffset];
             filename[0] = 0;
             strcat(filename, directory);
-            strcat(filename, "\\");
+            strcat(filename, "/");
             strcat(filename, filespec);
 
             if (GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY)
@@ -712,7 +712,7 @@ static LRESULT CALLBACK SkinBrowserWndPr
                         SendMessage(listbox, LB_GETTEXT, (WPARAM) index, (LPARAM) skinName);
                         /* fill out the full pathname to the skin */
                         strcpy(skinspath, get_path("skins"));
-                        strcat(skinspath, "\\");
+                        strcat(skinspath, "/");
                         strcat(skinspath, skinName);
                         ShowWindow(hwnd, SW_HIDE);
                         Shell_NotifyIcon(NIM_DELETE, &nid);

Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c	Thu Oct  6 12:04:40 2011	(r34179)
+++ trunk/gui/win32/gui.c	Thu Oct  6 14:09:05 2011	(r34180)
@@ -1036,14 +1036,14 @@ static LRESULT CALLBACK EventProc(HWND h
                             } else {
                                 HANDLE searchhndl;
                                 WIN32_FIND_DATA finddata;
-                                sprintf(searchpath, "%smpegav\\*.dat", device + pos);
+                                sprintf(searchpath, "%smpegav/*.dat", device + pos);
                                 if((searchhndl=FindFirstFile(searchpath, &finddata)) != INVALID_HANDLE_VALUE)
                                 {
                                     mp_msg(MSGT_GPLAYER,MSGL_V, "Opening VCD/SVCD\n");
                                     gui->playlist->clear_playlist(gui->playlist);
                                     do
                                     {
-                                        sprintf(filename, "%smpegav\\%s", device + pos, finddata.cFileName);
+                                        sprintf(filename, "%smpegav/%s", device + pos, finddata.cFileName);
                                         gui->playlist->add_track(gui->playlist, filename, NULL, NULL, 0);
                                     }
                                     while(FindNextFile(searchhndl, &finddata));
@@ -1552,7 +1552,7 @@ gui_t *create_gui(char *skindir, void (*
     /* create playlist */
     gui->playlist = create_playlist();
 
-    sprintf(temp, "%s\\%s", skindir, skinName);
+    sprintf(temp, "%s/%s", skindir, skinName);
     if(create_window(gui, temp)) return NULL;
     if(create_subwindow(gui)) return NULL;
     if(console) console_toggle();

Modified: trunk/gui/win32/playlist.c
==============================================================================
--- trunk/gui/win32/playlist.c	Thu Oct  6 12:04:40 2011	(r34179)
+++ trunk/gui/win32/playlist.c	Thu Oct  6 14:09:05 2011	(r34180)
@@ -36,7 +36,7 @@ int adddirtoplaylist(playlist_t *playlis
     char findpath[MAX_PATH], filename[MAX_PATH];
     char *filepart;
 
-    sprintf(findpath, "%s\\*.*", path);
+    sprintf(findpath, "%s/*.*", path);
 
     findHandle = FindFirstFile(findpath, &finddata);
 
@@ -44,7 +44,7 @@ int adddirtoplaylist(playlist_t *playlis
     do
     {
         if (finddata.cFileName[0] == '.' || strstr(finddata.cFileName, "Thumbs.db")) continue;
-        sprintf(findpath, "%s\\%s", path, finddata.cFileName);
+        sprintf(findpath, "%s/%s", path, finddata.cFileName);
 
         if (GetFileAttributes(findpath) & FILE_ATTRIBUTE_DIRECTORY)
         {

Modified: trunk/gui/win32/skinload.c
==============================================================================
--- trunk/gui/win32/skinload.c	Thu Oct  6 12:04:40 2011	(r34179)
+++ trunk/gui/win32/skinload.c	Thu Oct  6 14:09:05 2011	(r34180)
@@ -120,7 +120,7 @@ static image *pngRead(skin_t *skin, cons
     if(!(fp = fopen(fname, "rb")))
     {
         filename = calloc(1, strlen(skin->skindir) + strlen(fname) + 6);
-        sprintf(filename, "%s\\%s.png", skin->skindir, fname);
+        sprintf(filename, "%s/%s.png", skin->skindir, fname);
         if(!(fp = fopen(filename, "rb")))
         {
             mp_msg(MSGT_GPLAYER, MSGL_ERR, "[png] cannot find image %s\n", filename);
@@ -509,7 +509,7 @@ static void loadfonts(skin_t* skin)
         char *tmp = calloc(1, MAX_LINESIZE);
         char *desc = calloc(1, MAX_LINESIZE);
         filename = calloc(1, strlen(skin->skindir) + strlen(skin->fonts[x]->name) + 6);
-        sprintf(filename, "%s\\%s.fnt", skin->skindir, skin->fonts[x]->name);
+        sprintf(filename, "%s/%s.fnt", skin->skindir, skin->fonts[x]->name);
         if(!(fp = fopen(filename,"rb")))
         {
             mp_msg(MSGT_GPLAYER, MSGL_ERR, "[FONT LOAD] Font not found \"%s\"\n", skin->fonts[x]->name);
@@ -601,7 +601,7 @@ skin_t* loadskin(char* skindir, int desk
     skin->skindir = strdup(skindir);
 
     filename = calloc(1, strlen(skin->skindir) + strlen("skin") + 2);
-    sprintf(filename, "%s\\skin", skin->skindir);
+    sprintf(filename, "%s/skin", skin->skindir);
     if(!(fp = fopen(filename, "rb")))
     {
         mp_msg(MSGT_GPLAYER, MSGL_FATAL, "[SKIN LOAD] Skin \"%s\" not found\n", skindir);


More information about the MPlayer-cvslog mailing list