~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/controllers/anonusagestats.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-01-09 07:37:09 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20140109073709-rpuh5x3p3finvtze
Tags: 3.6.0.1228.33+dfsg-1
New upstream release [December 2013]

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*  $Id: gnkprocontroller.cpp $
 
3
*  Proyecto Ginkgo
 
4
*
 
5
*  Copyright 2008 MetaEmotion S.L. All rights reserved.
 
6
*
 
7
*/
 
8
 
 
9
#include "anonusagestats.h"
 
10
 
 
11
//singleton
 
12
GNC::GCS::AnonUsageStats* GNC::GCS::AnonUsageStats::m_pInstance = NULL;
 
13
 
 
14
GNC::GCS::AnonUsageStats * GNC::GCS::AnonUsageStats::Instance()
 
15
{
 
16
        if (m_pInstance == NULL) {
 
17
                m_pInstance = new AnonUsageStats();
 
18
        }
 
19
        return m_pInstance;
 
20
}
 
21
void GNC::GCS::AnonUsageStats::FreeInstance()
 
22
{
 
23
        if (m_pInstance != NULL) {
 
24
                delete m_pInstance;
 
25
                m_pInstance = NULL;
 
26
        }
 
27
}
 
28
//
 
29
 
 
30
GNC::GCS::IAnonUsageStatsDelegate::~IAnonUsageStatsDelegate()
 
31
{
 
32
}
 
33
 
 
34
GNC::GCS::AnonUsageStats::AnonUsageStats()
 
35
{
 
36
}
 
37
 
 
38
GNC::GCS::AnonUsageStats::~AnonUsageStats()
 
39
{
 
40
}
 
41
 
 
42
void GNC::GCS::AnonUsageStats::log(const std::string& operation, const std::string& description)
 
43
{
 
44
        try {
 
45
                if (Delegate.IsValid()) {
 
46
                        Delegate->log(operation, description);
 
47
                }
 
48
        } 
 
49
        catch(...)
 
50
        {
 
51
        }
 
52
}
 
53
 
 
54
void GNC::GCS::AnonUsageStats::setDelegate(const GNC::GCS::Ptr<IAnonUsageStatsDelegate>& delegate)
 
55
{
 
56
        Delegate = delegate;
 
57
}
 
58
 
 
59
void GNC::GCS::AnonUsageStats::resetSettings()
 
60
{
 
61
        if (Delegate.IsValid()) {
 
62
                Delegate->resetSettings();
 
63
        }
 
64
}
 
65