~ubuntu-branches/ubuntu/vivid/muon/vivid-proposed

« back to all changes in this revision

Viewing changes to libmuon/backends/ApplicationBackend/AptSourcesBackend.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Harald Sitter, Jonathan Riddell
  • Date: 2015-01-15 01:33:55 UTC
  • mfrom: (1.4.31)
  • mto: This revision was merged to the branch mainline in revision 81.
  • Revision ID: package-import@ubuntu.com-20150115013355-3h99wieurdvo6z6q
Tags: 4:5.1.95-0ubuntu1
[ Harald Sitter ]
* New upstream release based on KDE Frameworks 5
* muon-installer is no more remove binary package and all references
* Drop all patches, they all came from upstream anyway
* Remove muon.1 it was wrong and is now outdated
* Fix lintian warnings and ignore all that are bogus or not worth
  fixing

[ Jonathan Riddell ]
* New upstream beta release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright © 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>       *
 
3
 *                                                                         *
 
4
 *   This program is free software; you can redistribute it and/or         *
 
5
 *   modify it under the terms of the GNU General Public License as        *
 
6
 *   published by the Free Software Foundation; either version 2 of        *
 
7
 *   the License or (at your option) version 3 or any later version        *
 
8
 *   accepted by the membership of KDE e.V. (or its successor approved     *
 
9
 *   by the membership of KDE e.V.), which shall act as a proxy            *
 
10
 *   defined in Section 14 of version 3 of the license.                    *
 
11
 *                                                                         *
 
12
 *   This program is distributed in the hope that it will be useful,       *
 
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
15
 *   GNU General Public License for more details.                          *
 
16
 *                                                                         *
 
17
 *   You should have received a copy of the GNU General Public License     *
 
18
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 
19
 ***************************************************************************/
 
20
 
 
21
#ifndef APTSOURCESBACKEND_H
 
22
#define APTSOURCESBACKEND_H
 
23
 
 
24
#include <QStandardItemModel>
 
25
#include <resources/AbstractSourcesBackend.h>
 
26
#include <QApt/SourcesList>
 
27
 
 
28
class ApplicationBackend;
 
29
class SourceItem;
 
30
 
 
31
class AptSourcesBackend : public AbstractSourcesBackend
 
32
{
 
33
Q_OBJECT
 
34
public:
 
35
    enum Roles {
 
36
        UriRole
 
37
    };
 
38
    
 
39
    AptSourcesBackend(ApplicationBackend* backend);
 
40
    virtual QAbstractItemModel* sources();
 
41
    virtual bool removeSource(const QString& uri);
 
42
    virtual bool addSource(const QString& uri);
 
43
    virtual QString idDescription();
 
44
    virtual QString name() const;
 
45
    ApplicationBackend* appsBackend() const;
 
46
    virtual QList<QAction*> actions() const;
 
47
 
 
48
private slots:
 
49
    void load();
 
50
    void removalDone(int processErrorCode);
 
51
    void additionDone(int processErrorCode);
 
52
 
 
53
private:
 
54
    SourceItem* sourceForUri(const QString& uri);
 
55
 
 
56
    QStandardItemModel* m_sources;
 
57
    QApt::SourcesList m_sourcesList;
 
58
};
 
59
 
 
60
#endif // APTSOURCESBACKEND_H