From: Arvin Schnell Date: Thu, 16 Aug 2012 20:58:37 +0000 (+0200) Subject: - work on dbus interface X-Git-Tag: v0.1.3~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a25a628d53e1654899513dedc0a526d912d63fe;p=thirdparty%2Fsnapper.git - work on dbus interface --- diff --git a/client/snapper.cc b/client/snapper.cc index 9699e937..576bb621 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -986,7 +986,7 @@ command_undo(DBus::Connection& conn) for (vector::const_iterator it1 = undo_steps.begin(); it1 != undo_steps.end(); ++it1) { - vector::const_iterator it2 = files.find(it1->name); + vector::iterator it2 = files.find(it1->name); if (it2 == files.end()) { cerr << "internal error" << endl; diff --git a/snapper/File.cc b/snapper/File.cc index 72969b65..b0f3097c 100644 --- a/snapper/File.cc +++ b/snapper/File.cc @@ -53,19 +53,6 @@ namespace snapper } - UndoStatistic::UndoStatistic() - : numCreate(0), numModify(0), numDelete(0) - { - } - - - bool - UndoStatistic::empty() const - { - return numCreate == 0 && numModify == 0 && numDelete == 0; - } - - std::ostream& operator<<(std::ostream& s, const File& file) { s << "name:\"" << file.name << "\""; @@ -496,7 +483,7 @@ namespace snapper bool - File::doUndo() const + File::doUndo() { bool error = false; @@ -518,6 +505,9 @@ namespace snapper error = true; } + pre_to_system_status = (unsigned int) -1; + post_to_system_status = (unsigned int) -1; + return !error; } @@ -583,9 +573,9 @@ namespace snapper bool - Files::doUndoStep(const UndoStep& undo_step) const + Files::doUndoStep(const UndoStep& undo_step) { - vector::const_iterator it = find(undo_step.name); + vector::iterator it = find(undo_step.name); if (it == end()) return false; diff --git a/snapper/File.h b/snapper/File.h index 5b93c00f..0e6268db 100644 --- a/snapper/File.h +++ b/snapper/File.h @@ -60,9 +60,9 @@ namespace snapper struct UndoStatistic { - UndoStatistic(); + UndoStatistic() : numCreate(0), numModify(0), numDelete(0) {} - bool empty() const; + bool empty() const { return numCreate == 0 && numModify == 0 && numDelete == 0; } unsigned int numCreate; unsigned int numModify; @@ -111,7 +111,7 @@ namespace snapper bool getUndo() const { return undo; } void setUndo(bool value) { undo = value; } - bool doUndo() const; + bool doUndo(); Action getAction() const; @@ -175,11 +175,10 @@ namespace snapper vector getUndoSteps() const; - bool doUndoStep(const UndoStep& undo_step) const; + bool doUndoStep(const UndoStep& undo_step); protected: - void clear() { entries.clear(); } void push_back(File file) { entries.push_back(file); } void filter(const vector& ignore_patterns);