Switch to unified view

a/src/utils/appformime.h b/src/utils/appformime.h
...
...
31
    class AppDef {
31
    class AppDef {
32
    public:
32
    public:
33
        AppDef(const std::string& nm, const std::string& cmd)
33
        AppDef(const std::string& nm, const std::string& cmd)
34
            : name(nm), command(cmd)
34
            : name(nm), command(cmd)
35
            {}
35
            {}
36
        AppDef() {}
37
36
        std::string name;
38
        std::string name;
37
        std::string command;
39
        std::string command;
38
    };
40
    };
39
41
42
    /** Build/Get the db for the standard fdo directory */
40
    static DesktopDb* getDb();
43
    static DesktopDb* getDb();
44
45
    /** Constructor for a db based on a non-standard location */
46
    DesktopDb(const string& dir);
47
48
    /** In case of error: what happened ? */
41
    static const string& getReason();
49
    const string& getReason();
42
    ~DesktopDb();
43
50
44
    /**
51
    /**
45
     * Get a list of applications able to process a given MIME type.
52
     * Get a list of applications able to process a given MIME type.
46
     * @param mime MIME type we want the apps for
53
     * @param mime MIME type we want the apps for
47
     * @param[output] apps appropriate applications 
54
     * @param[output] apps appropriate applications 
...
...
50
     *   problem was detected.
57
     *   problem was detected.
51
     */
58
     */
52
    bool appForMime(const std::string& mime, vector<AppDef> *apps, 
59
    bool appForMime(const std::string& mime, vector<AppDef> *apps, 
53
                    std::string *reason = 0);
60
                    std::string *reason = 0);
54
61
62
    /**
63
     * Get all applications defs:
64
     * @param[output] apps applications 
65
     * @return true 
66
     */
67
    bool allApps(vector<AppDef> *apps);
68
69
    /** 
70
     * Get app with given name 
71
     */
72
    bool appByName(const string& nm, AppDef& app);
73
74
    typedef map<string, vector<DesktopDb::AppDef> > AppMap;
75
55
private:
76
private:
77
    /** This is used by getDb() and builds a db for the standard location */
56
    DesktopDb();
78
    DesktopDb();
79
    void build(const string& dir);
57
    DesktopDb(const DesktopDb &);
80
    DesktopDb(const DesktopDb &);
58
    DesktopDb& operator=(const DesktopDb &);
81
    DesktopDb& operator=(const DesktopDb &);
82
83
    AppMap m_appMap;
84
    std::string m_reason;
85
    bool m_ok;
59
};
86
};
60
87
61
88
62
#endif /* _APPFORMIME_H_INCLUDED_ */
89
#endif /* _APPFORMIME_H_INCLUDED_ */