summaryrefslogtreecommitdiff
path: root/library/backend/categories.h
Side-by-side diff
Diffstat (limited to 'library/backend/categories.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/categories.h12
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
@@ -66,18 +66,17 @@ public:
* not found
*/
const QString &label(int id) const;
/** Returns the uid associated with label or 0 if not found */
int id(const QString &label) const;
/** Returns a sorted list of labels */
QStringList labels() const;
- QArray<int> ids( const QStringList &cats ) const;
- QArray<int> ids() const;
+
QStringList labels( const QArray<int> &catids ) const;
const QMap<int, QString> &idMap() const { return mIdLabelMap; }
private:
void insert( int uid, const QString &label );
QMap<int, QString> mIdLabelMap;
QMap<QString, int> mLabelIdMap;
@@ -125,19 +124,18 @@ public:
* in the application, then it removes it from the global list
*/
bool removeCategory( const QString &appName, const QString &catName,
bool checkGlobal = TRUE);
bool removeCategory( const QString &appName, int uid );
bool removeGlobalCategory( const QString &catName );
bool removeGlobalCategory( int uid );
- QArray<int> ids( const QString &app ) const;
- QArray<int> ids( const QString &app,
- const QStringList &cats ) const;
+ QArray<int> ids( const QString &app, const QStringList &labels) const;
+
/** Returns the id associated with the app */
int id( const QString &app, const QString &cat ) const;
/** Returns the label associated with the id */
QString label( const QString &app, int id ) const;
enum ExtraLabels { NoExtra, AllUnfiled, AllLabel, UnfiledLabel };
/** Returns the sorted list of all categories that are
* associated with the app.
@@ -148,20 +146,16 @@ public:
* the list
* If extra = AllLabel, then All is prepended
* If extra = UnfiledLabel, then Unfiled is prepended
*/
QStringList labels( const QString &app,
bool includeGlobal = TRUE,
ExtraLabels extra = NoExtra ) const;
- /** Returns the labels of the categories associated with the uids */
- QStringList labels( const QString & app,
- const QArray<int> &catids ) const;
-
enum DisplaySingle { ShowMulti, ShowAll, ShowFirst };
/** Returns a single string associated with the cat ids for display in
* a combobox or any area that requires one string. If catids are empty
* then "Unfiled" will be returned. If multiple categories are assigned
* then the behavior depends on the DisplaySingle type.
* If /a display is set to ShowMulti then " (multi)" appended to the
* first string. If /a display is set to ShowAll, then a space seperated