From 9a44ba4aa45032e64e195554dd9e3300181ef87f Mon Sep 17 00:00:00 2001 From: Comment Date: Wed, 30 Jan 2013 10:38:31 +0000 Subject: urldecoding etc --- bin/data/settings.xml | 86 +++++++++++++-------------------------------------- src/testApp.cpp | 20 ++++++++++-- 2 files changed, 40 insertions(+), 66 deletions(-) diff --git a/bin/data/settings.xml b/bin/data/settings.xml index d5554e5..f411e8d 100755 --- a/bin/data/settings.xml +++ b/bin/data/settings.xml @@ -1,68 +1,26 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/src/testApp.cpp b/src/testApp.cpp index 312aa57..e443c1e 100755 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -1,4 +1,20 @@ #include "testApp.h" +string urlDecode(string &SRC) { + string ret; + char ch; + int i, ii; + for (i=0; i(ii); + ret+=ch; + i=i+2; + } else { + ret+=SRC[i]; + } + } + return (ret); +} //-------------------------------------------------------------- guiWindow::~guiWindow(){ cout << "gui window destroyed" << endl; @@ -245,7 +261,6 @@ void testApp::mousePressed(int x, int y, int button){ case 0: selectedPoint=boundaries[selectedBoundary].findPoint(p); if (selectedPoint<0) { - selectedPoint=boundaries[selectedBoundary].points.size(); boundaries[selectedBoundary].add(p); } else boundaries[selectedBoundary].points[selectedPoint]=p; @@ -286,7 +301,8 @@ void testApp::dragEvent(ofDragInfo dragInfo) { printf("got draginfo: %f,%f,%f\n",dragInfo.position.x,dragInfo.position.y,dragInfo.position.z); int sta=dragInfo.files[0].find_last_of("\\/")+1; int len=(dragInfo.files[0].find_last_of(".")+4)-sta; - string filename=dragInfo.files[0].substr(sta,len); + string f=dragInfo.files[0].substr(sta,len); + string filename=urlDecode(f); for (int i=0;i