~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/compilergcc/compiler_defs.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3
 
 * http://www.gnu.org/licenses/gpl-3.0.html
4
 
 *
5
 
 * $Revision: 4909 $
6
 
 * $Id: compiler_defs.cpp 4909 2008-02-27 13:15:26Z mortenmacfly $
7
 
 * $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/compilergcc/compiler_defs.cpp $
8
 
 */
9
 
 
10
 
#include <sdk.h>
11
 
#include "compiler_defs.h"
12
 
#include <cbproject.h>
13
 
#include <projectbuildtarget.h>
14
 
 
15
 
#include <wx/listimpl.cpp>
16
 
WX_DEFINE_LIST(CompilerCommands);
17
 
 
18
 
CompilerQueue::CompilerQueue()
19
 
    : m_LastWasRun(false)
20
 
{
21
 
}
22
 
 
23
 
CompilerQueue::~CompilerQueue()
24
 
{
25
 
    Clear();
26
 
}
27
 
 
28
 
void CompilerQueue::Clear()
29
 
{
30
 
    m_Commands.DeleteContents(true);
31
 
    m_Commands.Clear();
32
 
    m_Commands.DeleteContents(false);
33
 
}
34
 
 
35
 
size_t CompilerQueue::GetCount() const
36
 
{
37
 
    return m_Commands.GetCount();
38
 
}
39
 
 
40
 
bool CompilerQueue::LastCommandWasRun() const
41
 
{
42
 
    return m_LastWasRun;
43
 
}
44
 
 
45
 
void CompilerQueue::Add(CompilerCommand* cmd)
46
 
{
47
 
    if (cmd)
48
 
    {
49
 
        if (cmd->dir.IsEmpty() && cmd->project)
50
 
            cmd->dir = cmd->project->GetBasePath();
51
 
        m_Commands.Append(cmd);
52
 
    }
53
 
}
54
 
 
55
 
void CompilerQueue::Add(CompilerQueue* queue)
56
 
{
57
 
    wxCompilerCommandsNode* node = queue->m_Commands.GetFirst();
58
 
    while (node)
59
 
    {
60
 
        if (node->GetData())
61
 
            Add(new CompilerCommand(*(node->GetData())));
62
 
        node = node->GetNext();
63
 
    }
64
 
}
65
 
 
66
 
CompilerCommand* CompilerQueue::Peek()
67
 
{
68
 
    wxCompilerCommandsNode* node = m_Commands.GetFirst();
69
 
    if (!node)
70
 
        return 0;
71
 
    return node->GetData();
72
 
}
73
 
 
74
 
CompilerCommand* CompilerQueue::Next()
75
 
{
76
 
    wxCompilerCommandsNode* node = m_Commands.GetFirst();
77
 
    if (!node)
78
 
        return 0;
79
 
    CompilerCommand* cmd = node->GetData();
80
 
    m_Commands.Erase(node);
81
 
    m_LastWasRun = cmd ? cmd->isRun : false;
82
 
    return cmd;
83
 
}
 
1
/*
 
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
 
3
 * http://www.gnu.org/licenses/gpl-3.0.html
 
4
 *
 
5
 * $Revision: 5929 $
 
6
 * $Id: compiler_defs.cpp 5929 2009-11-21 14:34:53Z biplab $
 
7
 * $HeadURL: svn+ssh://jenslody@svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/compilergcc/compiler_defs.cpp $
 
8
 */
 
9
 
 
10
#include <sdk.h>
 
11
#include "compiler_defs.h"
 
12
#include <cbproject.h>
 
13
#include <projectbuildtarget.h>
 
14
 
 
15
#include <wx/listimpl.cpp>
 
16
WX_DEFINE_LIST(CompilerCommands);
 
17
 
 
18
CompilerQueue::CompilerQueue()
 
19
    : m_LastWasRun(false)
 
20
{
 
21
}
 
22
 
 
23
CompilerQueue::~CompilerQueue()
 
24
{
 
25
    Clear();
 
26
}
 
27
 
 
28
void CompilerQueue::Clear()
 
29
{
 
30
    m_Commands.DeleteContents(true);
 
31
    m_Commands.Clear();
 
32
    m_Commands.DeleteContents(false);
 
33
}
 
34
 
 
35
size_t CompilerQueue::GetCount() const
 
36
{
 
37
    return m_Commands.GetCount();
 
38
}
 
39
 
 
40
bool CompilerQueue::LastCommandWasRun() const
 
41
{
 
42
    return m_LastWasRun;
 
43
}
 
44
 
 
45
void CompilerQueue::Add(CompilerCommand* cmd)
 
46
{
 
47
    if (cmd)
 
48
    {
 
49
        if (cmd->dir.IsEmpty() && cmd->project)
 
50
            cmd->dir = cmd->project->GetExecutionDir();
 
51
        m_Commands.Append(cmd);
 
52
    }
 
53
}
 
54
 
 
55
void CompilerQueue::Add(CompilerQueue* queue)
 
56
{
 
57
    wxCompilerCommandsNode* node = queue->m_Commands.GetFirst();
 
58
    while (node)
 
59
    {
 
60
        if (node->GetData())
 
61
            Add(new CompilerCommand(*(node->GetData())));
 
62
        node = node->GetNext();
 
63
    }
 
64
}
 
65
 
 
66
CompilerCommand* CompilerQueue::Peek()
 
67
{
 
68
    wxCompilerCommandsNode* node = m_Commands.GetFirst();
 
69
    if (!node)
 
70
        return 0;
 
71
    return node->GetData();
 
72
}
 
73
 
 
74
CompilerCommand* CompilerQueue::Next()
 
75
{
 
76
    wxCompilerCommandsNode* node = m_Commands.GetFirst();
 
77
    if (!node)
 
78
        return 0;
 
79
    CompilerCommand* cmd = node->GetData();
 
80
    m_Commands.Erase(node);
 
81
    m_LastWasRun = cmd ? cmd->isRun : false;
 
82
    return cmd;
 
83
}