summaryrefslogtreecommitdiff
path: root/src/client/Client.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2012-10-02 02:00:57 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-10-05 14:20:33 (GMT)
commitd45dd605e97fa6c8f6e90495fbb1ae203ac314df (patch)
treea53149f388f073d5a41fc50ad3b29355535cce6e /src/client/Client.cpp
parentcb8efcd0f98185104805c8caa88decd39fbd9070 (diff)
downloadpowder-d45dd605e97fa6c8f6e90495fbb1ae203ac314df.zip
powder-d45dd605e97fa6c8f6e90495fbb1ae203ac314df.tar.gz
Stamp fix button to bring back deleted stamps
Diffstat (limited to 'src/client/Client.cpp')
-rw-r--r--src/client/Client.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index 238c216..a1becf4 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <deque>
#include <fstream>
+#include <dirent.h>
#ifdef MACOSX
#include <mach-o/dyld.h>
@@ -910,6 +911,28 @@ void Client::updateStamps()
return;
}
+void Client::UnDeleteStamps()
+{
+ DIR * directory;
+ struct dirent * entry;
+ directory = opendir("stamps");
+ if (directory != NULL)
+ {
+ stampIDs.clear();
+ while (entry = readdir(directory))
+ {
+ if(strncmp(entry->d_name, "..", 3) && strncmp(entry->d_name, ".", 2) && strcmp(entry->d_name, ".stm"))
+ {
+ char stampname[11];
+ strncpy(stampname, entry->d_name, 10);
+ stampIDs.push_front(stampname);
+ }
+ }
+ closedir(directory);
+ updateStamps();
+ }
+}
+
int Client::GetStampsCount()
{
return stampIDs.size();