X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=launcher-item.h;h=af40ca2e70e169a88b4b7ab682ee858ec6c762ea;hb=HEAD;hp=038b4c7569c12cd40581577dd1a4f9bb3b3f721e;hpb=84901ff2885ec9a4db4be3febf9781b24e194e2f;p=simple-launcher diff --git a/launcher-item.h b/launcher-item.h index 038b4c7..af40ca2 100644 --- a/launcher-item.h +++ b/launcher-item.h @@ -36,9 +36,10 @@ public: GdkPixbuf *getIcon(int icon_size) const; const std::string& getFileName() const { return myFileName; } - const std::string& getName() const { return myName; } - const std::string& getComment() const { return myComment; } + std::string getName(bool translate = true) const { return translate ? translateString(myName) : myName; } + std::string getComment(bool translate = true) const { return translate ? translateString(myComment) : myComment; } const std::string& getService() const { return myService; } + const std::string& getExec() const { return myExec; } bool isEnabled(void) const { return myEnabled; } @@ -52,17 +53,19 @@ public: } } + bool checkSanity(void) { return !myName.empty() && (!myService.empty() || !myExec.empty()); } + private: - bool checkSanity(void) { return !(myName.empty() || myIcon.empty() || myService.empty()); } + std::string translateString(const std::string& what) const; private: - std::string myFileName, myName, myComment, myIcon, myService; + std::string myFileName, myName, myComment, myIcon, myService, myExec, myTextDomain; bool myEnabled; static GtkIconTheme *ourTheme; }; -typedef struct { +struct LauncherItems { typedef std::vector Names; typedef std::map Items; @@ -103,7 +106,14 @@ typedef struct { myNames.resize(0); myItems.clear(); } -} LauncherItems; + + LauncherItems& operator=(const LauncherItems& that) { + myNames = that.myNames; + myItems = that.myItems; + + return *this; + } +}; #endif