Diffstat (limited to 'library/backend/categories.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | library/backend/categories.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/library/backend/categories.h b/library/backend/categories.h index 82d765b..ba65ee3 100644 --- a/library/backend/categories.h +++ b/library/backend/categories.h | |||
@@ -68,14 +68,13 @@ public: | |||
68 | const QString &label(int id) const; | 68 | const QString &label(int id) const; |
69 | /** Returns the uid associated with label or 0 if not found */ | 69 | /** Returns the uid associated with label or 0 if not found */ |
70 | int id(const QString &label) const; | 70 | int id(const QString &label) const; |
71 | 71 | ||
72 | /** Returns a sorted list of labels */ | 72 | /** Returns a sorted list of labels */ |
73 | QStringList labels() const; | 73 | QStringList labels() const; |
74 | QArray<int> ids( const QStringList &cats ) const; | 74 | |
75 | QArray<int> ids() const; | ||
76 | QStringList labels( const QArray<int> &catids ) const; | 75 | QStringList labels( const QArray<int> &catids ) const; |
77 | 76 | ||
78 | const QMap<int, QString> &idMap() const { return mIdLabelMap; } | 77 | const QMap<int, QString> &idMap() const { return mIdLabelMap; } |
79 | 78 | ||
80 | private: | 79 | private: |
81 | void insert( int uid, const QString &label ); | 80 | void insert( int uid, const QString &label ); |
@@ -127,15 +126,14 @@ public: | |||
127 | bool removeCategory( const QString &appName, const QString &catName, | 126 | bool removeCategory( const QString &appName, const QString &catName, |
128 | bool checkGlobal = TRUE); | 127 | bool checkGlobal = TRUE); |
129 | bool removeCategory( const QString &appName, int uid ); | 128 | bool removeCategory( const QString &appName, int uid ); |
130 | bool removeGlobalCategory( const QString &catName ); | 129 | bool removeGlobalCategory( const QString &catName ); |
131 | bool removeGlobalCategory( int uid ); | 130 | bool removeGlobalCategory( int uid ); |
132 | 131 | ||
133 | QArray<int> ids( const QString &app ) const; | 132 | QArray<int> ids( const QString &app, const QStringList &labels) const; |
134 | QArray<int> ids( const QString &app, | 133 | |
135 | const QStringList &cats ) const; | ||
136 | /** Returns the id associated with the app */ | 134 | /** Returns the id associated with the app */ |
137 | int id( const QString &app, const QString &cat ) const; | 135 | int id( const QString &app, const QString &cat ) const; |
138 | /** Returns the label associated with the id */ | 136 | /** Returns the label associated with the id */ |
139 | QString label( const QString &app, int id ) const; | 137 | QString label( const QString &app, int id ) const; |
140 | 138 | ||
141 | enum ExtraLabels { NoExtra, AllUnfiled, AllLabel, UnfiledLabel }; | 139 | enum ExtraLabels { NoExtra, AllUnfiled, AllLabel, UnfiledLabel }; |
@@ -150,16 +148,12 @@ public: | |||
150 | * If extra = UnfiledLabel, then Unfiled is prepended | 148 | * If extra = UnfiledLabel, then Unfiled is prepended |
151 | */ | 149 | */ |
152 | QStringList labels( const QString &app, | 150 | QStringList labels( const QString &app, |
153 | bool includeGlobal = TRUE, | 151 | bool includeGlobal = TRUE, |
154 | ExtraLabels extra = NoExtra ) const; | 152 | ExtraLabels extra = NoExtra ) const; |
155 | 153 | ||
156 | /** Returns the labels of the categories associated with the uids */ | ||
157 | QStringList labels( const QString & app, | ||
158 | const QArray<int> &catids ) const; | ||
159 | |||
160 | enum DisplaySingle { ShowMulti, ShowAll, ShowFirst }; | 154 | enum DisplaySingle { ShowMulti, ShowAll, ShowFirst }; |
161 | 155 | ||
162 | /** Returns a single string associated with the cat ids for display in | 156 | /** Returns a single string associated with the cat ids for display in |
163 | * a combobox or any area that requires one string. If catids are empty | 157 | * a combobox or any area that requires one string. If catids are empty |
164 | * then "Unfiled" will be returned. If multiple categories are assigned | 158 | * then "Unfiled" will be returned. If multiple categories are assigned |
165 | * then the behavior depends on the DisplaySingle type. | 159 | * then the behavior depends on the DisplaySingle type. |