~kdevelop/kdevplatform/master

« back to all changes in this revision

Viewing changes to plugins/problemreporter/problemreportermodel.h

  • Committer: Friedrich W. H. Kossebau
  • Date: 2017-08-13 21:54:31 UTC
  • Revision ID: git-v1:8ce76bea4df0831deb2fb243af33cc90d3cc8043
Wipe master branch and point in README to new location

Summary: also add util script for moving over existing personal branches

Reviewers: #kdevelop, apol, kfunk

Reviewed By: #kdevelop, apol, kfunk

Subscribers: kfunk, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D7244

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2007 Hamish Rodda <rodda@kde.org>
3
 
 * Copyright 2015 Laszlo Kis-Adam <laszlo.kis-adam@kdemail.net>
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU Library General Public License as
7
 
 * published by the Free Software Foundation; either version 2 of the
8
 
 * License, or (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public
16
 
 * License along with this program; if not, write to the
17
 
 * Free Software Foundation, Inc.,
18
 
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 
 */
20
 
 
21
 
#ifndef PROBLEMREPORTERMODEL_H
22
 
#define PROBLEMREPORTERMODEL_H
23
 
 
24
 
#include <shell/problemmodel.h>
25
 
 
26
 
namespace KDevelop
27
 
{
28
 
class IndexedString;
29
 
class TopDUContext;
30
 
}
31
 
 
32
 
class WatchedDocumentSet;
33
 
class QTimer;
34
 
 
35
 
/**
36
 
 * @brief ProblemModel subclass that retrieves the problems from DUChain.
37
 
 *
38
 
 * Provides a ProblemModel interface so these problems can be shown in the Problems toolview.
39
 
 */
40
 
class ProblemReporterModel : public KDevelop::ProblemModel
41
 
{
42
 
    Q_OBJECT
43
 
public:
44
 
    explicit ProblemReporterModel(QObject* parent);
45
 
    ~ProblemReporterModel() override;
46
 
 
47
 
    /**
48
 
     * Get merged list of problems for all @ref urls.
49
 
     */
50
 
    QVector<KDevelop::IProblem::Ptr> problems(const QSet<KDevelop::IndexedString>& urls) const;
51
 
 
52
 
public Q_SLOTS:
53
 
    /**
54
 
     * List of problems for @ref url has been updated
55
 
     */
56
 
    void problemsUpdated(const KDevelop::IndexedString& url);
57
 
 
58
 
    void forceFullUpdate() override;
59
 
 
60
 
protected Q_SLOTS:
61
 
    /// Triggered when the problemstore's problems have changed
62
 
    void onProblemsChanged() override;
63
 
 
64
 
private Q_SLOTS:
65
 
    void timerExpired();
66
 
    void setCurrentDocument(KDevelop::IDocument* doc) override;
67
 
 
68
 
private:
69
 
    void rebuildProblemList();
70
 
 
71
 
    QTimer* m_minTimer;
72
 
    QTimer* m_maxTimer;
73
 
    const static int MinTimeout;
74
 
    const static int MaxTimeout;
75
 
};
76
 
 
77
 
#endif