updated debian/changelog in anticipation of 0.8
[simple-launcher] / launcher-item.h
index 6005d28..3b4065e 100644 (file)
@@ -1,6 +1,6 @@
 // This file is a part of Simple Launcher
 //
-// Copyright (C) 2006, Mikhail Sobolev
+// Copyright (C) 2006, 2007, Mikhail Sobolev
 //
 // Simple Launcher is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License version 2 as published by
@@ -21,6 +21,7 @@
 #include <vector>
 #include <map>
 #include <string>
+#include <algorithm>
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gtk/gtkicontheme.h>
@@ -61,7 +62,7 @@ private:
   static GtkIconTheme *ourTheme;
 };
 
-typedef struct {
+typedef struct LauncherItems {
   typedef std::vector<std::string> Names;
   typedef std::map<std::string, LauncherItem *> Items;
 
@@ -69,7 +70,7 @@ typedef struct {
   Items myItems;
 
   bool exists(const std::string& name) {
-    return myNames.find(name) != myNames.end();
+    return std::find(myNames.begin(), myNames.end(), name) != myNames.end();
   }
 
   size_t size() { return myNames.size(); }
@@ -102,7 +103,14 @@ typedef struct {
     myNames.resize(0);
     myItems.clear();
   }
-} LauncherItems;
+
+  LauncherItems& operator=(const LauncherItems& that) {
+    myNames = that.myNames;
+    myItems = that.myItems;
+
+    return *this;
+  }
+};
 
 #endif