• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevelop/kdevplatform/vcs

  • extragear
  • kdevelop
  • kdevelop
  • kdevplatform
  • vcs
  • models
brancheslistmodel.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright 2008 Evgeniy Ivanov <[email protected]> *
3  * Copyright 2012 Aleix Pol Gonzalez <[email protected]> *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License or (at your option) version 3 or any later version *
9  * accepted by the membership of KDE e.V. (or its successor approved *
10  * by the membership of KDE e.V.), which shall act as a proxy *
11  * defined in Section 14 of version 3 of the license. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
20  ***************************************************************************/
21 
22 #ifndef KDEVPLATFORM_BRANCHESLISTMODEL_H
23 #define KDEVPLATFORM_BRANCHESLISTMODEL_H
24 
25 #include <QStandardItemModel>
26 #include <QUrl>
27 
28 #include <vcs/vcsexport.h>
29 
30 namespace KDevelop {
31 class IBranchingVersionControl;
32 class IProject;
33 class BranchesListModelPrivate;
34 
35 class KDEVPLATFORMVCS_EXPORT BranchesListModel : public QStandardItemModel
36 {
37  Q_OBJECT
38  Q_PROPERTY(KDevelop::IProject* project READ project WRITE setProject)
39  Q_PROPERTY(QString currentBranch READ currentBranch WRITE setCurrentBranch NOTIFY currentBranchChanged)
40  public:
41  enum Roles { CurrentRole = Qt::UserRole+1 };
42 
43  explicit BranchesListModel(QObject* parent = nullptr);
44  ~BranchesListModel() override;
45 
46  void initialize(KDevelop::IBranchingVersionControl* dvcsplugin, const QUrl& repo);
47 
48  QHash<int, QByteArray> roleNames() const override;
49 
50  Q_INVOKABLE void createBranch(const QString& baseBranch, const QString& newBranch);
51  Q_INVOKABLE void removeBranch(const QString& branch);
52 
53  QUrl repository() const;
54  KDevelop::IBranchingVersionControl* interface() const;
55  void refresh();
56  QString currentBranch() const;
57  void setCurrentBranch(const QString& branch);
58 
59  KDevelop::IProject* project() const;
60  void setProject(KDevelop::IProject* p);
61 
62  public Q_SLOTS:
63  void resetCurrent();
64 
65  Q_SIGNALS:
66  void currentBranchChanged();
67 
68  private:
69  const QScopedPointer<class BranchesListModelPrivate> d_ptr;
70  Q_DECLARE_PRIVATE(BranchesListModel)
71 };
72 
73 }
74 
75 #endif // KDEVPLATFORM_BRANCHESLISTMODEL_H
QStandardItemModel
KDevelop::IBranchingVersionControl
Definition: ibranchingversioncontrol.h:35
KDevelop::BranchesListModel
Definition: brancheslistmodel.h:35
QHash
QObject
QScopedPointer< class BranchesListModelPrivate >
QString
QUrl
KDevelop::BranchesListModel::Roles
Roles
Definition: brancheslistmodel.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 5 2019 05:01:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevelop/kdevplatform/vcs

Skip menu "kdevelop/kdevplatform/vcs"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  •   kdevplatform
  •     debugger
  •     documentation
  •     interfaces
  •     language
  •       assistant
  •       backgroundparser
  •       checks
  •       classmodel
  •       codecompletion
  •       codegen
  •       duchain
  •       editor
  •       highlighting
  •       interfaces
  •       util
  •     outputview
  •     project
  •     serialization
  •     shell
  •     sublime
  •     tests
  •     util
  •     vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal