~ps-jenkins/qtubuntu/latestsnapshot-0.52+13.10.20130912.1-0ubuntu1

« back to all changes in this revision

Viewing changes to src/modules/application/desktopdata.h

  • Committer: Tarmac
  • Author(s): Gerry Boland
  • Date: 2013-09-10 13:12:34 UTC
  • mfrom: (170.2.15 using-new-api)
  • Revision ID: tarmac-20130910131234-bzowv55avwej97i5
Implement ApplicationManager API as defined in unity-api. This requires renaming QML plugin to Unity.Application, removing the ApplicationListModel class and supplying just one model of applications running.

Approved by PS Jenkins bot, Daniel d'Andrada.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
 
2
// Copyright © 2013 Canonical Ltd.
 
3
//
 
4
// This program is free software: you can redistribute it and/or modify it under
 
5
// the terms of the GNU Lesser General Public License version 3, as published by
 
6
// the Free Software Foundation.
 
7
//
 
8
// This program is distributed in the hope that it will be useful, but WITHOUT
 
9
// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
 
10
// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
// Lesser General Public License for more details.
 
12
//
 
13
// You should have received a copy of the GNU Lesser General Public License
 
14
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 
 
16
#ifndef DESKTOPDATA_H
 
17
#define DESKTOPDATA_H
 
18
 
 
19
#include <QString>
 
20
#include <QVector>
 
21
#include <QUrl>
 
22
 
 
23
class DesktopData {
 
24
public:
 
25
    DesktopData(QString appId);
 
26
    ~DesktopData();
 
27
 
 
28
    QString appId() const { return appId_; }
 
29
    QString file() const;
 
30
    QString name() const { return entries_[kNameIndex]; }
 
31
    QString comment() const { return entries_[kCommentIndex]; }
 
32
    QUrl icon() const { return QUrl(entries_[kIconIndex]); }
 
33
    QString exec() const { return entries_[kExecIndex]; }
 
34
    QString path() const { return entries_[kPathIndex]; }
 
35
    QString stageHint() const { return entries_[kStageHintIndex]; }
 
36
    bool loaded() const { return loaded_; }
 
37
 
 
38
private:
 
39
    static const int kNameIndex = 0,
 
40
    kCommentIndex = 1,
 
41
    kIconIndex = 2,
 
42
    kExecIndex = 3,
 
43
    kPathIndex = 4,
 
44
    kStageHintIndex = 5,
 
45
    kNumberOfEntries = 6;
 
46
 
 
47
    bool load();
 
48
 
 
49
    QString appId_;
 
50
    QVector<QString> entries_;
 
51
    bool loaded_;
 
52
};
 
53
 
 
54
#endif // DESKTOPDATA_H