summaryrefslogtreecommitdiff
path: root/shared/dragAndDrop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shared/dragAndDrop.cpp')
-rw-r--r--shared/dragAndDrop.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/shared/dragAndDrop.cpp b/shared/dragAndDrop.cpp
index 89f4da4d..581aac96 100644
--- a/shared/dragAndDrop.cpp
+++ b/shared/dragAndDrop.cpp
@@ -1,3 +1,9 @@
+// **************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
+// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+//
#include "dragAndDrop.h"
#include <wx/dnd.h>
#include <wx/window.h>
@@ -5,7 +11,8 @@
#include <wx/textctrl.h>
#include <wx/filepicker.h>
#include <wx/filename.h>
-
+#include "fileHandling.h"
+#include "stringConv.h"
//define new event type
const wxEventType FFS_DROP_FILE_EVENT = wxNewEventType();
@@ -115,24 +122,14 @@ void DragDropOnMainDlg::OnFilesDropped(FFSFileDropEvent& event)
}
else //should never be reached
event.Skip();
-};
-
-
-wxString formatDirectory(const wxString& dirname)
-{
- wxString dirnameTmp = dirname;
- dirnameTmp.Trim(true); //remove whitespace characters from right
- dirnameTmp.Trim(false); //remove whitespace characters from left
-
- return dirnameTmp;
}
void DragDropOnMainDlg::OnWriteDirManually(wxCommandEvent& event)
{
- const wxString newDir = formatDirectory(event.GetString());
- if (wxDirExists(newDir))
- dirPicker_->SetPath(newDir);
+ const Zstring newDir = getFormattedDirectoryName(wxToZ(event.GetString()));
+ if (dirExists(newDir))
+ dirPicker_->SetPath(zToWx(newDir));
event.Skip();
}
@@ -193,14 +190,14 @@ void DragDropOnDlg::OnFilesDropped(FFSFileDropEvent& event)
}
else //should never be reached
event.Skip();
-};
+}
void DragDropOnDlg::OnWriteDirManually(wxCommandEvent& event)
{
- const wxString newDir = formatDirectory(event.GetString());
- if (wxDirExists(newDir))
- dirPicker_->SetPath(newDir);
+ const Zstring newDir = FreeFileSync::getFormattedDirectoryName(wxToZ(event.GetString()));
+ if (dirExists(newDir))
+ dirPicker_->SetPath(zToWx(newDir));
event.Skip();
}
bgstack15