Patch level : 12.0 1186
Files correlati : xvaga.dll Commento: Le cache di file si aggiornano meglio, abbiamo aggiornato la data di modifica dei file ad ogni srittura cion la nuova funzione xvt_fsys_set_file_time in xvaga. le relapp per default aggiornano le cache di file
This commit is contained in:
parent
caa96b90e2
commit
73aee14c89
@ -63,6 +63,12 @@ void OsLinux_UpdateWindow(unsigned int handle)
|
||||
// non deve fare nulla in Linux, sembra di si verificare SORRY_BOX();
|
||||
}
|
||||
|
||||
void OsLinux_Set_FileTime(const char * file, struct tm * ctime, struct tm * atime, struct tm * mtime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Hardlock Support
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -6,6 +6,8 @@ int OsLinux_EnumerateSizes(const char* name, long* sizes, short* scalable, int m
|
||||
void OsLinux_PlaceProcessInWindow(unsigned int instance, const char* name, unsigned int parent);
|
||||
void OsLinux_UpdateWindow(unsigned int handle);
|
||||
|
||||
void OsLinux_Set_FileTime(const char * file, struct tm * ctime, struct tm * atime, struct tm * mtime);
|
||||
|
||||
bool OsLinux_HL_Crypt(unsigned short* data);
|
||||
bool OsLinux_HL_Login(unsigned short address, const unsigned char* label, const unsigned char* password);
|
||||
bool OsLinux_HL_Logout() ;
|
||||
|
@ -20,6 +20,12 @@
|
||||
#include <psapi.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
template<typename T> void safe_delete(T*& a)
|
||||
{
|
||||
delete a;
|
||||
a = nullptr;
|
||||
}
|
||||
|
||||
bool OsWin32_CheckPrinterInfo(const void* data, unsigned int size)
|
||||
{
|
||||
bool ok = data != NULL;
|
||||
@ -912,6 +918,50 @@ wxIcon OsWin32_LoadIcon(const char* filename)
|
||||
return ico;
|
||||
}
|
||||
|
||||
static void TimetToFileTime(time_t t, LPFILETIME pft)
|
||||
{
|
||||
ULARGE_INTEGER time_value;
|
||||
time_value.QuadPart = (t * 10000000LL) + 116444736000000000LL;
|
||||
pft->dwLowDateTime = time_value.LowPart;
|
||||
pft->dwHighDateTime = time_value.HighPart;
|
||||
}
|
||||
|
||||
void OsWin32_Set_FileTime(const char * file, struct tm * ctime, struct tm * atime, struct tm * mtime)
|
||||
{
|
||||
HANDLE h = CreateFileA(file, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
FILETIME *fctime = nullptr;
|
||||
FILETIME *fatime = nullptr;
|
||||
FILETIME *fmtime = nullptr;
|
||||
|
||||
if (ctime != nullptr)
|
||||
{
|
||||
time_t t = mktime(ctime);
|
||||
|
||||
fctime = new FILETIME;
|
||||
TimetToFileTime(t, fctime);
|
||||
}
|
||||
if (atime != nullptr)
|
||||
{
|
||||
time_t t = mktime(atime);
|
||||
|
||||
fatime = new FILETIME;
|
||||
TimetToFileTime(t, fatime);
|
||||
}
|
||||
if (mtime != nullptr)
|
||||
{
|
||||
time_t t = mktime(mtime);
|
||||
|
||||
fmtime = new FILETIME;
|
||||
TimetToFileTime(t, fmtime);
|
||||
}
|
||||
SetFileTime(h, fctime, fatime, fmtime);
|
||||
safe_delete(fctime);
|
||||
safe_delete(fatime);
|
||||
safe_delete(fmtime);
|
||||
CloseHandle(h);
|
||||
}
|
||||
|
||||
// action = [ open, edit, print ];
|
||||
bool OsWin32_GotoUrl(const char* url, const char* action)
|
||||
{
|
||||
|
@ -10,6 +10,8 @@ wxString OsWin32_File2App(const char* filename);
|
||||
bool OsWin32_GotoUrl(const char* url, const char* action);
|
||||
wxIcon OsWin32_LoadIcon(const char* file);
|
||||
|
||||
void OsWin32_Set_FileTime(const char * file, struct tm * ctime, struct tm * atime, struct tm * mtime);
|
||||
|
||||
int OsWin32_EnumerateFamilies(WXHDC hDC, char** families, int max_count);
|
||||
int OsWin32_EnumerateSizes(WXHDC hDC, const char* name, long* sizes, short* scalable, int max_count);
|
||||
void OsWin32_SetCaptionStyle(WXHWND handle, long style);
|
||||
|
@ -1840,8 +1840,17 @@ long xvt_fsys_file_attr(const char* path, long attr)
|
||||
// Original XVT implementation
|
||||
long xvt_fsys_get_file_attr(const FILE_SPEC* fs, long attr)
|
||||
{
|
||||
char mbs[_MAX_PATH]; xvt_fsys_convert_fspec_to_str(fs, mbs, sizeof(mbs));
|
||||
return xvt_fsys_file_attr(mbs, attr);
|
||||
char mbs[_MAX_PATH]; xvt_fsys_convert_fspec_to_str(fs, mbs, sizeof(mbs));
|
||||
return xvt_fsys_file_attr(mbs, attr);
|
||||
}
|
||||
|
||||
void xvt_fsys_set_file_time(const char * file, struct tm * ctime, struct tm * atime, struct tm * mtime)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
OsWin32_Set_FileTime(file, ctime, atime, mtime);
|
||||
#else
|
||||
Oslinux_Set_FileTime(file, ctime, atime, mtime);
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -3542,7 +3551,7 @@ long xvt_sys_execute(const char* cmdline, BOOLEAN sync, BOOLEAN iconizetask)
|
||||
delete p;
|
||||
}
|
||||
else
|
||||
exitcode = wxExecute(cmd, wxEXEC_ASYNC /* | wxEXEC_HIDE_CONSOLE*/);
|
||||
exitcode = wxExecute(cmd, wxEXEC_ASYNC);
|
||||
}
|
||||
|
||||
return exitcode;
|
||||
|
@ -188,6 +188,7 @@ XVTDLL void xvt_fsys_restore_dir();
|
||||
XVTDLL void xvt_fsys_save_dir();
|
||||
XVTDLL BOOLEAN xvt_fsys_set_dir(const DIRECTORY* dirp);
|
||||
XVTDLL long xvt_fsys_get_file_attr(const FILE_SPEC *fs, long attr);
|
||||
XVTDLL void xvt_fsys_set_file_time(const char * file, struct tm * ctime, struct tm * atime, struct tm * mtime);
|
||||
XVTDLL BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest);
|
||||
|
||||
// Added by Guy
|
||||
|
Loading…
x
Reference in New Issue
Block a user