]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- work on dbus interface
authorArvin Schnell <aschnell@suse.de>
Thu, 16 Aug 2012 20:58:37 +0000 (22:58 +0200)
committerArvin Schnell <aschnell@suse.de>
Thu, 16 Aug 2012 20:58:37 +0000 (22:58 +0200)
client/snapper.cc
snapper/File.cc
snapper/File.h

index 9699e937104f0c6a8568974daf169d79ffd5743c..576bb621f35afd5f3e1fd6dc06a452dbd8e61b1c 100644 (file)
@@ -986,7 +986,7 @@ command_undo(DBus::Connection& conn)
 
     for (vector<UndoStep>::const_iterator it1 = undo_steps.begin(); it1 != undo_steps.end(); ++it1)
     {
-       vector<File>::const_iterator it2 = files.find(it1->name);
+       vector<File>::iterator it2 = files.find(it1->name);
        if (it2 == files.end())
        {
            cerr << "internal error" << endl;
index 72969b657df18c1ecb5620fa785542c554f8f95d..b0f3097c9e71984ff316e4588b18566b441d7d64 100644 (file)
@@ -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<File>::const_iterator it = find(undo_step.name);
+       vector<File>::iterator it = find(undo_step.name);
        if (it == end())
            return false;
 
index 5b93c00f2cd65b0033780cf654941445d8698ac6..0e6268dba19e43fb326e0d49c36ba96606086b7b 100644 (file)
@@ -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<UndoStep> 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<string>& ignore_patterns);