Changeset 846 for trunk/dll/rename.c
- Timestamp:
- Sep 27, 2007, 11:16:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/rename.c
r841 r846 11 11 22 Mar 07 GKY Use QWL_USER 12 12 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 13 27 Sep 07 SHL Correct ULONGLONG size formatting 13 14 14 15 ***********************************************************************/ … … 30 31 MRESULT EXPENTRY RenameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 31 32 { 32 33 33 MOVEIT *mv; 34 34 … … 52 52 if (mv->rename || !stricmp(mv->target, mv->source)) { 53 53 54 CHAR *p; 55 56 p = strrchr(mv->target, '\\'); 54 CHAR *p = strrchr(mv->target, '\\'); 57 55 if (p) { 58 56 59 57 USHORT sello, selhi; 60 58 61 sello = (p - mv->target)+ 1;59 sello = p - mv->target + 1; 62 60 selhi = strlen(mv->target); 63 61 … … 66 64 EM_SETSEL, MPFROM2SHORT(sello, selhi), MPVOID); 67 65 } 68 // WinShowWindow(WinWindowFromID(hwnd,REN_DONTASK),FALSE);69 66 WinShowWindow(WinWindowFromID(hwnd, REN_OVEROLD), FALSE); 70 67 WinShowWindow(WinWindowFromID(hwnd, REN_OVERNEW), FALSE); … … 80 77 CHAR s[CCHMAXPATH * 2], *p, chkname[CCHMAXPATH]; 81 78 INT sourceexists = 0, targetexists = 0, 82 sourcenewer = 0, sourcesmaller = 0;79 sourcenewer = 0, sourcesmaller = 0; 83 80 84 81 p = mv->target; … … 93 90 WinSetDlgItemText(hwnd, REN_SOURCE, mv->source); 94 91 if (!DosQueryPathInfo(mv->source, FIL_STANDARDL, &fs1, sizeof(fs1))) { 92 // 27 Sep 07 SHL fixme to use CommaFmtULL 95 93 sprintf(s, 96 " %s%lu %ss %04u/%02u/%02u %02u:%02u:%02u", 97 (fs1.attrFile & FILE_DIRECTORY) ? 98 GetPString(IDS_DIRBRKTTEXT) : 99 NullStr, 94 " %s%llu %ss %04u/%02u/%02u %02u:%02u:%02u", 95 fs1.attrFile & FILE_DIRECTORY ? 96 GetPString(IDS_DIRBRKTTEXT) : NullStr, 100 97 fs1.cbFile, 101 98 GetPString(IDS_BYTETEXT), … … 107 104 WinSetDlgItemText(hwnd, REN_SOURCEINFO, s); 108 105 sourceexists = 1; 109 if (fs1.attrFile & (FILE_DIRECTORY))106 if (fs1.attrFile & FILE_DIRECTORY) 110 107 sourceexists = 3; 111 108 } … … 120 117 } 121 118 if (!DosQueryPathInfo(chkname, FIL_STANDARDL, &fs2, sizeof(fs2))) { 119 // 27 Sep 07 SHL fixme to use CommaFmtULL 122 120 sprintf(s, 123 " %s%lu %ss %04u/%02u/%02u %02u:%02u:%02u", 124 (fs2.attrFile & FILE_DIRECTORY) ? 125 GetPString(IDS_DIRBRKTTEXT) : 126 NullStr, 121 " %s%llu %ss %04u/%02u/%02u %02u:%02u:%02u", 122 fs2.attrFile & FILE_DIRECTORY ? 123 GetPString(IDS_DIRBRKTTEXT) : NullStr, 127 124 fs2.cbFile, 128 125 GetPString(IDS_BYTETEXT), … … 147 144 sprintf(s, 148 145 GetPString(IDS_SOURCEISATEXT), 149 (sourceexists & 2) ?150 GetPString(IDS_DIRECTORYTEXT) :GetPString(IDS_FILETEXT));146 sourceexists & 2 ? GetPString(IDS_DIRECTORYTEXT) : 147 GetPString(IDS_FILETEXT)); 151 148 { 152 149 FILE *fp = NULL; 153 154 if (!(sourceexists & 2)) 150 if (~sourceexists & 2) 155 151 fp = fopen(mv->source, "ab"); 156 if ((!fp && !(sourceexists & 2)) || !sourceexists)152 if ((!fp && ~sourceexists & 2) || !sourceexists) 157 153 strcpy(s, GetPString(IDS_CANTACCESSSOURCETEXT)); 158 154 if (fp) … … 162 158 sprintf(&s[strlen(s)], 163 159 GetPString(IDS_TARGETEXISTSISATEXT), 164 (targetexists & 2) ?165 GetPString(IDS_DIRECTORYTEXT) :GetPString(IDS_FILETEXT));160 targetexists & 2 ? GetPString(IDS_DIRECTORYTEXT) : 161 GetPString(IDS_FILETEXT)); 166 162 if (targetexists && stricmp(mv->source, mv->target)) 167 163 strcpy(&s[strlen(s)], GetPString(IDS_CLICKOVERWRITETEXT)); … … 169 165 strcpy(&s[strlen(s)], GetPString(IDS_ENTERNEWTARGETTEXT)); 170 166 WinEnableWindow(WinWindowFromID(hwnd, REN_OVERWRITE), 171 (stricmp(mv->target, mv->source) &&172 (!mv->rename || strcmp(mv->target, mv->source))));167 stricmp(mv->target, mv->source) && 168 (!mv->rename || strcmp(mv->target, mv->source))); 173 169 174 170 if (targetexists == 1 && sourceexists == 1) { 175 171 sourcenewer = 176 (fs1.fdateLastWrite.year < 177 fs2.fdateLastWrite.year) ? 1 : (fs1.fdateLastWrite.year > 178 fs2.fdateLastWrite. 179 year) ? -1 : (fs1.fdateLastWrite. 180 month < 181 fs2.fdateLastWrite. 182 month) ? 1 : (fs1. 183 fdateLastWrite. 184 month 185 > 186 fs2. 187 fdateLastWrite. 188 month) 189 ? -1 : (fs1.fdateLastWrite.day < 190 fs2.fdateLastWrite.day) ? 1 : (fs1.fdateLastWrite.day > 191 fs2.fdateLastWrite. 192 day) ? -1 : (fs1. 193 ftimeLastWrite. 194 hours < 195 fs2. 196 ftimeLastWrite. 197 hours) ? 1 198 : (fs1.ftimeLastWrite.hours > 199 fs2.ftimeLastWrite.hours) ? -1 : (fs1.ftimeLastWrite.minutes < 200 fs2.ftimeLastWrite. 201 minutes) ? 1 : (fs1. 202 ftimeLastWrite. 203 minutes > 204 fs2. 205 ftimeLastWrite. 206 minutes) ? -1 207 : (fs1.ftimeLastWrite.twosecs < 208 fs2.ftimeLastWrite.twosecs) ? 1 : (fs1.ftimeLastWrite.twosecs > 209 fs2.ftimeLastWrite. 210 twosecs) ? -1 : 0; 211 sourcesmaller = 212 (fs1.cbFile < fs2.cbFile) ? -1 : (fs1.cbFile > 213 fs2.cbFile) ? 1 : 0; 172 (fs1.fdateLastWrite.year < fs2.fdateLastWrite.year) ? 1 : 173 (fs1.fdateLastWrite.year > fs2.fdateLastWrite.year) ? -1 : 174 (fs1.fdateLastWrite.month < fs2.fdateLastWrite.month) ? 1 : 175 (fs1.fdateLastWrite.month > fs2.fdateLastWrite.month) ? -1 : 176 (fs1.fdateLastWrite.day < fs2.fdateLastWrite.day) ? 1 : 177 (fs1.fdateLastWrite.day > fs2.fdateLastWrite.day) ? -1 : 178 (fs1.ftimeLastWrite.hours < fs2. ftimeLastWrite. hours) ? 1 : 179 (fs1.ftimeLastWrite.hours > fs2.ftimeLastWrite.hours) ? -1 : 180 (fs1.ftimeLastWrite.minutes < fs2.ftimeLastWrite.minutes) ? 1 : 181 (fs1.ftimeLastWrite.minutes > fs2.ftimeLastWrite.minutes) ? -1 : 182 (fs1.ftimeLastWrite.twosecs < fs2.ftimeLastWrite.twosecs) ? 1 : 183 (fs1.ftimeLastWrite.twosecs > fs2.ftimeLastWrite.twosecs) ? -1 : 0; 184 sourcesmaller = (fs1.cbFile < fs2.cbFile) ? -1 : 185 (fs1.cbFile > fs2.cbFile) ? 1 : 186 0; 214 187 sprintf(&s[strlen(s)], GetPString(IDS_SOURCEISTEXT), 215 (sourcenewer == 216 -1) ? GetPString(IDS_NEWERTEXT) : (sourcenewer == 217 1) ? 218 GetPString(IDS_OLDERTEXT) : GetPString(IDS_SAMEDATETEXT), 219 (sourcesmaller == 220 -1) ? GetPString(IDS_SMALLERTEXT) : (sourcesmaller == 221 1) ? 222 GetPString(IDS_LARGERTEXT) : GetPString(IDS_SAMESIZETEXT)); 188 (sourcenewer == -1) ? GetPString(IDS_NEWERTEXT) : 189 (sourcenewer == 1) ? GetPString(IDS_OLDERTEXT) : 190 GetPString(IDS_SAMEDATETEXT), 191 (sourcesmaller == -1) ? GetPString(IDS_SMALLERTEXT) : 192 (sourcesmaller == 1) ? GetPString(IDS_LARGERTEXT) : 193 GetPString(IDS_SAMESIZETEXT)); 223 194 } 224 195 WinSetDlgItemText(hwnd, REN_INFORMATION, s);
Note:
See TracChangeset
for help on using the changeset viewer.