forked from xaionaro/redmine-qt
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathExample.cpp
More file actions
47 lines (37 loc) · 938 Bytes
/
Example.cpp
File metadata and controls
47 lines (37 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "Example.h"
#include "logging.h"
#include <QDebug>
using namespace qtredmine;
Example::Example( QObject *parent )
: QObject( parent )
{
redmine_ = new SimpleRedmineClient( "https://redmine.site", "34z58c7346btv847brcw478c6br434f234", this );
printProjects();
}
void
Example::cacheIssues()
{
redmine_->retrieveIssues( [&]( Issues issues, RedmineError redmineError, QStringList errors )
{
if( redmineError != RedmineError::NO_ERR )
{
DEBUG()(errors);
return;
}
issues_ = issues;
} );
}
void
Example::printProjects()
{
redmine_->retrieveProjects( []( Projects projects, RedmineError redmineError, QStringList errors )
{
if( redmineError != RedmineError::NO_ERR )
{
DEBUG()(errors);
return;
}
for( const auto& project : projects )
DEBUG() << project.name;
} );
}