Changed: Path can be too long, so display only filename

This commit is contained in:
kervala 2016-02-13 23:40:25 +01:00
parent aa4f7eae76
commit c851313a66

View file

@ -1018,12 +1018,12 @@ float CPatchManager::getCurrentFileProgress() const
// **************************************************************************** // ****************************************************************************
void CPatchManager::setRWAccess (const string &filename, bool bThrowException) void CPatchManager::setRWAccess (const string &filename, bool bThrowException)
{ {
ucstring s = CI18N::get("uiSetAttrib") + " " + filename; ucstring s = CI18N::get("uiSetAttrib") + " " + CFile::getFilename(filename);
setState(true, s); setState(true, s);
if (!NLMISC::CFile::setRWAccess(filename) && bThrowException) if (!NLMISC::CFile::setRWAccess(filename) && bThrowException)
{ {
s = CI18N::get("uiAttribErr") + " " + filename + " (" + toString(errno) + "," + strerror(errno) + ")"; s = CI18N::get("uiAttribErr") + " " + CFile::getFilename(filename) + " (" + toString(errno) + "," + strerror(errno) + ")";
setState(true, s); setState(true, s);
throw Exception (s.toString()); throw Exception (s.toString());
} }
@ -1032,7 +1032,7 @@ void CPatchManager::setRWAccess (const string &filename, bool bThrowException)
// **************************************************************************** // ****************************************************************************
string CPatchManager::deleteFile (const string &filename, bool bThrowException, bool bWarning) string CPatchManager::deleteFile (const string &filename, bool bThrowException, bool bWarning)
{ {
ucstring s = CI18N::get("uiDelFile") + " " + filename; ucstring s = CI18N::get("uiDelFile") + " " + CFile::getFilename(filename);
setState(true, s); setState(true, s);
if (!NLMISC::CFile::fileExists(filename)) if (!NLMISC::CFile::fileExists(filename))
@ -1044,7 +1044,7 @@ string CPatchManager::deleteFile (const string &filename, bool bThrowException,
if (!NLMISC::CFile::deleteFile(filename)) if (!NLMISC::CFile::deleteFile(filename))
{ {
s = CI18N::get("uiDelErr") + " " + filename + " (" + toString(errno) + "," + strerror(errno) + ")"; s = CI18N::get("uiDelErr") + " " + CFile::getFilename(filename) + " (" + toString(errno) + "," + strerror(errno) + ")";
if(bWarning) if(bWarning)
setState(true, s); setState(true, s);
if(bThrowException) if(bThrowException)
@ -1272,7 +1272,7 @@ void CPatchManager::downloadFileWithCurl (const string &source, const string &de
try try
{ {
#ifdef USE_CURL #ifdef USE_CURL
ucstring s = CI18N::get("uiDLWithCurl") + " " + dest; ucstring s = CI18N::get("uiDLWithCurl") + " " + CFile::getFilename(dest);
setState(true, s); setState(true, s);
// user agent = nel_launcher // user agent = nel_launcher