summaryrefslogtreecommitdiff
path: root/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-11-29 10:36:53 +0100
committerBenoit Foucher <benoit@zeroc.com>2007-11-29 10:36:53 +0100
commit3887ebfe20511f825f46a8efee3985341e9da1a8 (patch)
treee3013f9d0bcca6b18cd49bac5dcde04c82a87cd3 /cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
parentAdded execute permission to exe.config files. (diff)
downloadice-3887ebfe20511f825f46a8efee3985341e9da1a8.tar.bz2
ice-3887ebfe20511f825f46a8efee3985341e9da1a8.tar.xz
ice-3887ebfe20511f825f46a8efee3985341e9da1a8.zip
Fixed bug 2391
Diffstat (limited to 'cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp')
-rwxr-xr-xcpp/demo/IcePatch2/MFC/PatchClientDlg.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
index 0453190293f..e24bf943af7 100755
--- a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
+++ b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp
@@ -12,7 +12,6 @@
#include "PatchClientDlg.h"
#include <IcePatch2/ClientUtil.h>
-#include <IcePatch2/Util.h>
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -20,6 +19,25 @@
using namespace std;
+string
+getBasename(const string& path)
+{
+ string::size_type pos = path.rfind('/');
+ if(pos == string::npos)
+ {
+ pos = path.rfind('\\');
+ }
+
+ if(pos == string::npos)
+ {
+ return path;
+ }
+ else
+ {
+ return path.substr(pos + 1);
+ }
+}
+
class DialogPatcherFeedback : public IcePatch2::PatcherFeedback
{
public:
@@ -130,7 +148,7 @@ CPatchDlg::checksumProgress(const string& path)
// TODO: indicate busy progress
CString file;
- file.Format(L" %s", IceUtil::stringToWstring(IcePatch2::getBasename(path)).c_str());
+ file.Format(L" %s", IceUtil::stringToWstring(getBasename(path)).c_str());
_file->SetWindowText(file);
processMessages();
@@ -188,7 +206,7 @@ CPatchDlg::patchStart(const string& path, Ice::Long size, Ice::Long totalProgres
}
CString file;
- file.Format(L" %s", IceUtil::stringToWstring(IcePatch2::getBasename(path)).c_str());
+ file.Format(L" %s", IceUtil::stringToWstring(getBasename(path)).c_str());
_file->SetWindowText(file);
return patchProgress(0, size, totalProgress, totalSize);